3

I've followed this guide to get postfix set up. I've not completed it yet, as from sending test emails, email is no longer being delivered since switching to Maildir from mbox.

I have created a Maildir directory with cur, new and tmp sub directories.

~$ ll
drwxrwxr-x 5 greg greg    4096 2012-07-07 16:40 Maildir/
~$ ll Maildir/
drwxrwxr-x 2 greg greg 4096 2012-07-07 16:40 cur
drwxrwxr-x 2 greg greg 4096 2012-07-07 16:40 new
drwxrwxr-x 2 greg greg 4096 2012-07-07 16:40 tmp

Send a test email.

~$ netcat mail.example.com 25
220 ubuntu ESMTP Postfix (Ubuntu)
ehlo example.com
250-ubuntu
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-STARTTLS
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
mail from: [email protected]
250 2.1.0 Ok
rcpt to: [email protected]
250 2.1.5 Ok
data
354 End data with <CR><LF>.<CR><LF>
Subject: test email

Hi,
Just testing.
.
250 2.0.0 Ok: queued as 56B541EA53
quit
221 2.0.0 Bye

Check the mail queue.

~$ mailq
Mail queue is empty

Check if mail has been delivered.

~$ ls -l Maildir/new
total 0

Some postfix settings:

~$ sudo postconf home_mailbox
home_mailbox = Maildir/
~$ sudo postconf mailbox_command
mailbox_command =

/var/log/mail.log

Jul  7 16:57:33 li305-246 postfix/smtpd[21039]: connect from example.com[178.79.168.xxx]
Jul  7 16:58:14 li305-246 postfix/smtpd[21039]: 56B541EA53: client=example.com[178.79.168.xxx]
Jul  7 16:58:33 li305-246 postfix/cleanup[21042]: 56B541EA53: message-id=<20120707155814.56B541EA53@ubuntu>
Jul  7 16:58:33 li305-246 postfix/qmgr[20882]: 56B541EA53: from=<[email protected]>, size=321, nrcpt=1 (queue active)
Jul  7 16:58:33 li305-246 postfix/smtp[21043]: 56B541EA53: to=<[email protected]>, relay=none, delay=30, delays=30/0.01/0/0, dsn=5.4.6, status=bounced (mail for example.com loops back to myself)
Jul  7 16:58:33 li305-246 postfix/cleanup[21042]: 1F68B1EA55: message-id=<20120707155833.1F68B1EA55@ubuntu>
Jul  7 16:58:33 li305-246 postfix/bounce[21044]: 56B541EA53: sender non-delivery notification: 1F68B1EA55
Jul  7 16:58:33 li305-246 postfix/qmgr[20882]: 1F68B1EA55: from=<>, size=1999, nrcpt=1 (queue active)
Jul  7 16:58:33 li305-246 postfix/qmgr[20882]: 56B541EA53: removed
Jul  7 16:58:33 li305-246 postfix/smtp[21043]: 1F68B1EA55: to=<[email protected]>, relay=none, delay=0, delays=0/0/0/0, dsn=5.4.6, status=bounced (mail for example.com loops back to myself)
Jul  7 16:58:33 li305-246 postfix/qmgr[20882]: 1F68B1EA55: removed
Jul  7 16:58:36 li305-246 postfix/smtpd[21039]: disconnect from domain.me[178.79.168.xxx]
Jul  7 17:10:38 li305-246 postfix/master[20878]: terminating on signal 15
Jul  7 17:10:39 li305-246 postfix/master[21254]: daemon started -- version 2.8.5, configuration /etc/postfix

Any ideas?

0

1 Answer 1

4

Your problem has nothing to do with maildir, and everything to do with bad mail routing. The key is the error message "mail for domain.com loops back to myself". You've setup MX records such that mail for domain.com points to your own mail server, but you haven't configured said mail server to actually accept and deliver mail. Set mydestination (or the corresponding virtual mail config, if that's your bag) to include domain.com, and all will be well.

1
  • Thanks, I just googled the error in the log and came across this blog post which is exactly what you've said here. So I added domain.com to mydestination: sudo postconf -e "mydestination = domain.com, mail.domain.com, ubuntu, localhost.localdomain, localhost" and then restarted postfix.
    – Greg K
    Jul 7, 2012 at 19:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .