Fetchmail 不会将消息放入 Cyrus。Postfix LMTP 问题?

Fetchmail 不会将消息放入 Cyrus。Postfix LMTP 问题?

我正在尝试让 fetchmail 从 POP3 服务器吸取消息,并将它们插入 Cyrus 以进行本地 IMAP 传送。

Cyrus 本身运行良好,而且我可以使用远程计算机上的 ThunderBird 连接到它。

Fetchmail 似乎正在接收消息,但并没有将它们放在 Cyrus 中(或者任何地方)。

/var/log/mail.log显示:


Aug  5 03:58:57 IMAP postfix/lmtp[8537]: 57ECB1A15BC: to=, relay=none,
delay=77830, delays=77829/0.56/0/0, dsn=4.4.1, status=deferred
(connect to IMAP.IMAP[/var/run/cyrus/socket/lmtp]: No such file or directory)

套接字“/var/run/cyrus/socket/lmtp”确实存在于系统中。它归 root:root 所有,但为了排除故障,我已将其 chmode 设置为 777,因此应该不存在任何权限问题。

我的 postfix main.cf 文件:


smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no

append_dot_mydomain = no

readme_directory = no

smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache

myhostname = IMAP.IMAP
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = myserver.com, IMAP.IMAP, localhost.IMAP, localhost
relayhost = 
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all

mailbox_transport = lmtp:unix:/var/run/cyrus/socket/lmtp
virtual_transport = lmtp:unix:/var/run/cyrus/socket/lmtp

virtual_alias_domains = somesite.com
virtual_alias_maps = hash:/etc/postfix/virtual
home_mailbox = Maildir/
mailbox_command = 

postfix 主控文件


....
# ==========================================================================
# service type  private unpriv  chroot  wakeup  maxproc command + args
#               (yes)   (yes)   (yes)   (never) (100)
# ==========================================================================
smtp      inet  n       -       n       -       -       smtpd
#submission inet n       -       -       -       -       smtpd
#  -o smtpd_tls_security_level=encrypt
#  -o smtpd_sasl_auth_enable=yes
#  -o smtpd_client_restrictions=permit_sasl_authenticated,reject
#  -o milter_macro_daemon_name=ORIGINATING
#smtps     inet  n       -       -       -       -       smtpd
#  -o smtpd_tls_wrappermode=yes
#  -o smtpd_sasl_auth_enable=yes
#  -o smtpd_client_restrictions=permit_sasl_authenticated,reject
#  -o milter_macro_daemon_name=ORIGINATING
#628      inet  n       -       -       -       -       qmqpd
pickup    fifo  n       -       -       60      1       pickup
cleanup   unix  n       -       -       -       0       cleanup
qmgr      fifo  n       -       n       300     1       qmgr
#qmgr     fifo  n       -       -       300     1       oqmgr
tlsmgr    unix  -       -       -       1000?   1       tlsmgr
rewrite   unix  -       -       -       -       -       trivial-rewrite
bounce    unix  -       -       -       -       0       bounce
defer     unix  -       -       -       -       0       bounce
trace     unix  -       -       -       -       0       bounce
verify    unix  -       -       -       -       1       verify
flush     unix  n       -       -       1000?   0       flush
proxymap  unix  -       -       n       -       -       proxymap
proxywrite unix -       -       n       -       1       proxymap
smtp      unix  -       -       n       -       -       smtp
# When relaying mail as backup MX, disable fallback_relay to avoid MX loops
relay     unix  -       -       -       -       -       smtp
        -o smtp_fallback_relay=
#       -o smtp_helo_timeout=5 -o smtp_connect_timeout=5
showq     unix  n       -       -       -       -       showq
error     unix  -       -       -       -       -       error
retry     unix  -       -       -       -       -       error
discard   unix  -       -       -       -       -       discard
local     unix  -       n       n       -       -       local
virtual   unix  -       n       n       -       -       virtual
lmtp      unix  -       -       n       -       -       lmtp
anvil     unix  -       -       -       -       1       anvil
scache    unix  -       -       -       -       1       scache
...

imapd配置文件


...
# Unix domain socket that lmtpd listens on.
lmtpsocket: /var/run/cyrus/socket/lmtp
...

cyrus.conf


...
lmtpunix    cmd="lmtpd" listen="/var/run/cyrus/socket/lmtp" prefork=0 maxchild=20
...

.fetchmailrc


set syslog;
set daemon 90;
set postmaster "postfix"

poll "mail.somesite.com"
with protocol pop3
user "[email protected]" there with password "54321" is "me" here --keep

poll "mail.mia.bellsouth.net"
with protocol pop3
user "me" there with password "54321" is "me" here --keep

我还可以尝试什么?

答案1

请检查您的 postfix lmtp 是否通过 master.cf 中的配置进行 chrooted

如果你发现像这样的一行

lmtp unix - - - - - lmtp

甚至

lmtp unix - - y - - lmtp

您需要检查套接字是否存在于 chroot 中(最有可能是 /var/spool/postfix)。

例如:/var/spool/postfix/var/run/cyrus/socket/lmtp 是否存在?(而不是 /var/run/cyrus/socket/lmtp)

如果是这种情况,您可以通过 master.cf 中的以下行从 lmtp 中删除 chrooting:

lmtp unix - - n - - lmtp

或者您可以 mount-bind /var/run/cyrus/socket 以与 chroot 共存。

答案2

现在似乎可以正常工作了。我在 postfix/main.cf 中将“myhostname”更改为“localhost”,突然一切似乎都正常工作了。感谢您的回复!

相关内容