Exim
Exim 路由到 Cyrus LMTP 失敗
我在讓 Exim 與 Cyrus lmtp 交談時遇到問題。
我知道 lmtp 正在接收。它正在偵聽埠 2003。我使用以下 perl 腳本對其進行了測試。
!/usr/bin/perl -w use Net::LMTP; my $lmtp = Net::LMTP->new('localhost', 2003); $lmtp->mail($ENV{USER}); $lmtp->to('test@example.com'); $lmtp->data(); $lmtp->datasend("To: postmaster\n"); $lmtp->datasend("\n"); $lmtp->datasend("A simple test message\n"); $lmtp->dataend(); $lmtp->quit;
執行它會產生一個文件, 1. 出現在相應的 cyrus spool 文件夾中:
root@myhost:/var/spool/cyrus/mail/domain/e/example.com/t/user/test# cat 1. Return-Path: <root@myhost.example.net> Received: from myhost.example.net (localhost [127.0.0.1]) by myhost.example.net (Cyrus 2.5.10-Debian-2.5.10-3) with LMTPA; Sun, 07 Oct 2018 12:45:48 +0100 X-Sieve: CMU Sieve 2.4 To: postmaster Message-ID: <cmu-lmtpd-11754-1538912748-0@myhost.example.net> Date: Sun, 07 Oct 2018 12:45:48 +0100 A simple test message
我正在執行我自己的 exim 自定義版本。
執行 exim 的 -bt 測試路由選項
/usr/exim/bin/exim -bt test@example.com
結果是
test@example.com router = cyrus_vdom, transport = cyrus_ltcp
這是exim路由器和傳輸:
cyrus_vdom: driver = accept domains = +cyrus_domains transport = cyrus_ltcp no_more cyrus_ltcp: driver = smtp protocol = lmtp hosts = localhost port = 2003
消息卡在 exim 中,正在執行
exim -qff
不會將它們移出。
2018-10-07 12:35:48 exim 4.91 daemon started: pid=11455, -q30m, listening for SMTP on port 25 (IPv6 and IPv4) port 587 (IPv6 and IPv4) and for SMTPS on port 465 (IPv6 and IPv4) 2018-10-07 12:35:48 Start queue run: pid=11456 2018-10-07 12:35:48 1g8uZF-00027o-TS Message is frozen 2018-10-07 12:35:48 1g8oBv-0000L0-JO Message is frozen 2018-10-07 12:35:48 End queue run: pid=11456 2018-10-07 13:05:48 Start queue run: pid=11812 2018-10-07 13:05:48 1g8uZF-00027o-TS Message is frozen 2018-10-07 13:05:48 1g8oBv-0000L0-JO Message is frozen 2018-10-07 13:05:48 End queue run: pid=11812 2018-10-07 13:35:49 Start queue run: pid=11955 2018-10-07 13:35:49 1g8oBv-0000L0-JO Message is frozen 2018-10-07 13:35:49 1g8uZF-00027o-TS Message is frozen 2018-10-07 13:35:49 End queue run: pid=11955
歡迎任何建議。
Ping localhost 導致
PING localhost(localhost (::1)) 56 data bytes 64 bytes from localhost (::1): icmp_seq=1 ttl=64 time=0.039 ms 64 bytes from localhost (::1): icmp_seq=2 ttl=64 time=0.046 ms 64 bytes from localhost (::1): icmp_seq=3 ttl=64 time=0.047 ms
IPv6,很明顯。
跑步
netstat -anp
表明在 IPv6 上沒有監聽埠 2003,只有 IP4。
將 exim 傳輸主機更改為此修復它。
cyrus_ltcp: driver = smtp protocol = lmtp hosts = 127.0.0.1 port = 2003 allow_localhost