Sendmail 通过 LMTP 发送空白收件人

Sendmail 通过 LMTP 发送空白收件人

标题基本概括了一切。本地邮件通过 LMTP 运行良好,但非本地邮件(虚拟主机)却遇到了麻烦。我在下面提供了尽可能多的信息,尽量保持相关性。我搞不清楚这里出了什么问题。

我已经验证过的事情:

  • example.com位于{VirtHost}
  • 它试图通过我的邮件程序发送,但失败了local(尽管local它也向 LMTP 发送,并且运行正常)。已通过日志验证并仅更改虚拟邮件的 LMTP 套接字(见下文)。

邮寄器规格:

Mdovecot, P=[IPC], F=SXmnz9,
    S=EnvFromSMTP/HdrFromL, R=EnvToSMTP/HdrToL, E=\r\n,
    T=DNS/RFC822/SMTP,
    A=FILE /var/run/dovecot/lmtp

SMTP 对话:

$ telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 mail.example.com ESMTP Sendmail; Mon, 31 Oct 2011 23:29:54 GMT
EHLO localhost
MAIL FROM: [email protected]
RCPT TO: [email protected]
DATA
To: [email protected]
From: [email protected]
Subject: Hello world!

Hello there, everyone!
.
quit
250-mail.example.com Hello localhost [127.0.0.1], pleased to meet you
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-8BITMIME
250-SIZE
250-DSN
250-ETRN
250-DELIVERBY
250 HELP
250 2.1.0 [email protected]... Sender ok
250 2.1.5 [email protected]... Recipient ok
354 Enter mail, end with "." on a line by itself
250 2.0.0 p9VNTswi016356 Message accepted for delivery
221 2.0.0 mail.example.com closing connection
Connection closed by foreign host.

产生的 LMTP 对话:

# socat -v UNIX-LISTEN:lmtp-socat UNIX-CLIENT:lmtp
< 220 mail.example.com Dovecot LMTP ready\r
> LHLO mail.example.com\r
< 250-mail.example.com\r
< 250-8BITMIME\r
< 250-ENHANCEDSTATUSCODES\r
< 250 PIPELINING\r
> MAIL From:<[email protected]>\r
< 250 2.1.0 OK\r
> RCPT To:<>\r
> DATA\r
< 550 5.1.1 <> User doesn't exist: \r
< 554 5.5.1 No valid recipients\r
> RSET\r
< 250 2.0.0 OK\r
> QUIT\r
< 221 2.0.0 Client quit\r

Sendmail 地址转换(我认为这是内部处理的工作方式,如果不是,请有人纠正我,我会解决这个问题):

$ sendmail -bt
ADDRESS TEST MODE (ruleset 3 NOT automatically invoked)
Enter <ruleset> <address>
> 0,3,EnvToSMTP [email protected]
parse              input: mscharley @ example . com
Parse0             input: mscharley @ example . com
Parse0           returns: mscharley @ example . com
ParseLocal         input: mscharley @ example . com
ParseLocal       returns: mscharley @ example . com
Parse1             input: mscharley @ example . com
Parse1           returns: $# local $: mscharley @ example . com
parse            returns: $# local $: mscharley @ example . com
canonify           input: $# local $: mscharley @ example . com
canonify         returns: $# local $: mscharley @ example . com
EnvToSMTP          input: $# local $: mscharley @ example . com
EnvToSMTP        returns: $# local $: mscharley @ example . com

答案1

有时您只需要将所有内容都打出来以理清自己的思绪。

这是由 中的空白域引起的mailertable,即:

example.com    dovecot:

将其更改为以下内容完全解决了该问题:

example.com    dovecot:example.com

相关内容