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?

Jojodmo
  • 131
  • 6
  • 2
    Show logs from postfix and dovecot when it receiving message – masegaloeh Sep 03 '15 at 07:19
  • @masegaloeh I can't believe I didn't include that, sorry! I just edited it in – Jojodmo Sep 04 '15 at 02: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 04 '15 at 02: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 05 '15 at 19:23
  • 1
    Feel free to add the solution in answer section below... – masegaloeh Sep 05 '15 at 22:43
  • @masegaloeh I was about to, but it isn't actually an answer to the question - I'm going to add it if theres no other answers within a few hours – Jojodmo Sep 05 '15 at 22:58
  • So, there are no answer? – masegaloeh Sep 08 '15 at 22:24
  • @masegaloeh No - at least no direct one – Jojodmo Sep 08 '15 at 22:47

1 Answers1

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

Jojodmo
  • 131
  • 6