2

For some reason, emails that I receive on my Amazon Linux EC2 instance, running postfix and dovecot, are put in the directory /var/mail/<user>/.Sent\ Messages, instead of the expected /var/mail/<user>.

Postfix's master.cf contains the following pertaining to dovecot

dovecot   unix  -       n       n       -       -       pipe
    flags=DRhu user=vmail:vmail argv=/usr/libexec/dovecot/deliver -f ${sender} -d ${recipient}

and the mail_location in Dovecot's dovecot.conf is set to

maildir:/var/mail/%u

And here's the log for postfix and dovecot (/var/log/maillog)

Sep 4 02:43:02 mail dovecot: imap-login: Login: user=, method=PLAIN, rip=108.23.86.62, lip=172.31.50.106, mpid=9156, TLS

Sep 4 02:43:02 mail dovecot: imap(support): Disconnected: Logged out bytes=32/392 Sep 4 02:43:23 mail dovecot: imap-login: Login: user=, method=PLAIN, rip=108.23.86.62, lip=172.31.50.106, mpid=9158, TLS

Sep 4 02:43:24 mail dovecot: imap-login: Login: user=, method=PLAIN, rip=108.23.86.62, lip=172.31.50.106, mpid=9160, TLS

Sep 4 02:43:25 mail dovecot: imap-login: Login: user=, method=PLAIN, rip=108.23.86.62, lip=172.31.50.106, mpid=9162, TLS

Sep 4 02:43:25 mail dovecot: imap-login: Login: user=, method=PLAIN, rip=108.23.86.62, lip=172.31.50.106, mpid=9164, TLS

All of the messages are received correctly, but they are just put in the incorrect directory, making dovecot not work properly.

Could this have something to do with the way I configured postfix?

  • 2
    Show logs from postfix and dovecot when it receiving message – masegaloeh Sep 3 '15 at 7:19
  • @masegaloeh I can't believe I didn't include that, sorry! I just edited it in – Jojodmo Sep 4 '15 at 2:47
  • Umm, the logs above doesn't include event when email received by your mail server. Try to send email to your server again and watch the logs when postfix receiving message. – masegaloeh Sep 4 '15 at 2:50
  • @masegaloeh I'm not sure what happened, but I broke something with postfix, and it took me a few hours to fix it, but now that it's fixed, the problem no longer occurs... I have a feeling it had something to do with dovecot, though. I also set home_mailbox to Maildir/ in postfix's main.cf, which was commented out before. – Jojodmo Sep 5 '15 at 19:23
  • 1
    Feel free to add the solution in answer section below... – masegaloeh Sep 5 '15 at 22:43
1

I re-installed both postfix and dovecot, and also set home_mailbox to Maildir/ in postfix's main.cf.

Although I'm unsure, I assume the problem had something to do with the misconfiguration of either dovecot or postfix

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.