Postfix+courier - IMAP working but nothing arrives

Hi everyone,

I'm nearly there with setting up all the services I want, but I haven't got email working yet.

I followed the guide in the library for postfix+courier on debian. The only thing I did wrong was say "yes" to "create directories for web based administration", which I doubt would cause a problem (please let me know if you think I should disable that..and how ;) )

I've double checked that all the steps were completed properly, as much as I was able to (database and config files look ok to me, matching what the guide says to do). I've run both the telnet checks that guide recommends, and have sent an email from mailx on localhost. Also sent email from my home pc. I can see those emails in /var/mail/user.

I've set up IMAP successfully as far as I can tell (thunderbird complained until I had all the addresses, usernames and passwords set up right, and now it seems to be happily logging in to courier). I can see my inbox in thunderbird, but no email arrives in my inbox.

Any idea what I might be doing wrong or what I can look for?

BTW one little complexity that I don't expect will make any difference: I have iptables only allowing input on port 25 on eth0 and am connecting to courier-imap over my VPN (i.e. courier-imap-ssl is blocked at the firewall and is only listening on a VPN address anyway). As I said though, the connection to courier from my client doesn't seem to be the problem. I've also stopped courier-pop, courier-pop-ssl and courier-imap because I'm not using them - I think that's fine? Restarting them doesn't seem to help anyway.

Many thanks for any help!

Dave.

5 Replies

Courier uses Maildir to store the emails, and not mbox (which you are currently using). See http://en.wikipedia.org/wiki/Maildir

Do, as root:

echo "home_mailbox = Maildir/" >> /etc/postfix/main.cf
/etc/init.d/postfix restart

Then send an e-mail to yourself, you should see it appear in /home/user/Maildir/new and also in Thunderbird.

@saman007uk:

Courier uses Maildir to store the emails, and not mbox (which you are currently using). See http://en.wikipedia.org/wiki/Maildir

Do, as root:

echo "home_mailbox = Maildir/" >> /etc/postfix/main.cf
/etc/init.d/postfix restart

Then send an e-mail to yourself, you should see it appear in /home/user/Maildir/new and also in Thunderbird.

Thanks for looking Saman. I did that, and the email did then arrive in /home/user/Maildir, but no luck still with getting it delivered. I've connected by pop3 too and no sign that courier has picked the email up.

Has this got something to do with virtual mailboxes? The configuration specified in the guide doesn't mention home_mailbox, just the following settings:

myhostname = server.yourdomain.com

mydestination = server.yourdomain.com, localhost, localhost.localdomain'

mynetworks = 127.0.0.0/8

messagesizelimit = 30720000

virtualaliasdomains =

virtualaliasmaps = proxy:mysql:/etc/postfix/mysql-virtualforwardings.cf, mysql:/etc/postfix/mysql-virtualemail2email.cf

virtualmailboxdomains = proxy:mysql:/etc/postfix/mysql-virtual_domains.cf

virtualmailboxmaps = proxy:mysql:/etc/postfix/mysql-virtual_mailboxes.cf

virtualmailboxbase = /home/vmail

virtualuidmaps = static:5000

virtualgidmaps = static:5000

smtpdsaslauth_enable = yes

brokensaslauth_clients = yes

smtpdsaslauthenticated_header = yes

smtpdrecipientrestrictions = permitmynetworks, permitsaslauthenticated, rejectunauth_destination

smtpdusetls = yes

smtpdtlscert_file = /etc/postfix/smtpd.cert

smtpdtlskey_file = /etc/postfix/smtpd.key

virtualcreatemaildirsize = yes

virtualmaildirextended = yes

proxyreadmaps = $localrecipientmaps mydestination $virtualaliasmaps $virtualaliasdomains $virtualmailboxmaps $virtualmailboxdomains $relayrecipientmaps $relaydomains $canonicalmaps $sendercanonicalmaps $recipientcanonicalmaps $relocatedmaps $transportmaps $mynetworks $virtualmailboxlimit_maps'

Any other ideas please? Is there a way I can interrogate courier to see if it's seen these messages?

Cheers,

Dave

Can you post Courier-Imaps config?

The files you requested are below, but I think I may have just spotted something: in /var/log/mail.info.1 I have the error message: imapd-ssl: chdir mydomain.com/user/: No such file or directory … well duh! ;)

Also: postfix/trivial-rewrite[10716]: warning: do not list domain mydomain.com in BOTH mydestination and virtualmailboxdomains

I think the first one may well be my problem (and I suppose maybe it's caused by the second one?).. haven't a clue how right now, but I'll have some spare time tomorrow to scratch my head… Any hints very welcome!

Here are those files anyway :)

imapd-ssl

SSLPORT=993

SSLADDRESS=10.8.0.1

SSLPIDFILE=/var/run/courier/imapd-ssl.pid

SSLLOGGEROPTS="-name=imapd-ssl"

IMAPDSSLSTART=YES

IMAPDSTARTTLS=YES

IMAPTLSREQUIRED=0

COURIERTLS=/usr/bin/couriertls

TLSKXLIST=ALL

TLS_COMPRESSION=ALL

TLS_CERTS=X509

TLS_CERTFILE=/etc/courier/imapd.pem

TLS_TRUSTCERTS=/etc/ssl/certs

TLS_VERIFYPEER=NONE

TLS_CACHEFILE=/var/lib/courier/couriersslcache

TLS_CACHESIZE=524288

MAILDIRPATH=Maildir

imapd

ADDRESS=10.8.0.1

PORT=143

MAXDAEMONS=40

MAXPERIP=20

PIDFILE=/var/run/courier/imapd.pid

TCPDOPTS="-nodnslookup -noidentlookup"

LOGGEROPTS="-name=imapd"

IMAP_CAPABILITY="IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA IDLE"

IMAP_KEYWORDS=1

IMAP_ACL=1

IMAPCAPABILITYORIG="IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA AUTH=CRAM-MD5 AUTH=CRAM-SHA1 AUTH=CRAM-SHA256 IDLE"

IMAP_PROXY=0

IMAPPROXYFOREIGN=0

IMAPIDLETIMEOUT=60

IMAPMAILBOXSANITY_CHECK=1

IMAPCAPABILITYTLS="$IMAP_CAPABILITY AUTH=PLAIN"

IMAPCAPABILITYTLSORIG="$IMAPCAPABILITY_ORIG AUTH=PLAIN"

IMAP_DISABLETHREADSORT=0

IMAPCHECKALL_FOLDERS=0

IMAPOBSOLETECLIENT=0

IMAP_UMASK=022

IMAP_ULIMITD=65536

IMAP_USELOCKS=1

IMAP_SHAREDINDEXFILE=/etc/courier/shared/index

IMAP_ENHANCEDIDLE=0

IMAP_TRASHFOLDERNAME=Trash

IMAP_EMPTYTRASH=Trash:7

IMAPMOVEEXPUNGETOTRASH=0

SENDMAIL=/usr/sbin/sendmail

HEADERFROM=X-IMAP-Sender

IMAPDSTART=YES

MAILDIRPATH=Maildir

Cheers,

Dave

Ok I figured it out :)

I don't need the "home_mailbox = Maildir/" line sama recommended, because this is a virtual mail setup, and we (courier) want the emails to appear in /home/vmail/mydomain.com.

The linode debian postfix tutorial says to:

"Issue the following commands to complete the remaining steps required for Postfix configuration. Please be sure to replace "server.yourdomain.com" with the fully qualified domain name you used for your system mail name.

[…]

postconf -e 'mydestination = server.yourdomain.com, localhost, localhost.localdomain'

"

BUT - our domain mydomain.com MUST NOT be in the mydestination list because it's a virtual mailbox domain:

(from this tutorial)

"NEVER list a virtual MAILBOX domain name as a mydestination domain!"

Glad to have it working, but IMO the linode tutorial needs clarification on this point.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct