我已经按照本指南设置了 postfix。我还没有完成它,因为从发送测试电子邮件开始,自从从 mbox 切换到 Maildir 后,电子邮件不再被发送。
我创建了一个包含 cur、new 和 tmp 子目录的 Maildir 目录。
~$ 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
发送测试邮件。
~$ 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
检查邮件队列。
~$ mailq
Mail queue is empty
检查邮件是否已送达。
~$ ls -l Maildir/new
total 0
一些后缀设置:
~$ 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
有任何想法吗?
您的问题与 maildir 无关,而与错误的邮件路由有关。关键是错误消息“domain.com 的邮件循环回我自己”。您已设置 MX 记录,使 domain.com 的邮件指向您自己的邮件服务器,但您尚未配置所述邮件服务器以实际接受和发送邮件。将
mydestination
(或相应的虚拟邮件配置,如果那是你的包)设置为 includedomain.com
,一切都会好起来的。