The title pretty much sums in up. Local mail is working fine via LMTP, however non-local mail (virtual hosting) is struggling. I've provided as much information below as possible, trying to keep it relevant. I can't figure out what is going wrong here.
Things I've verified:
example.com
is in{VirtHost}
- It is trying to deliver via my mailer, not
local
(thoughlocal
is delivering to LMTP too, and is working perfectly). Verified via log and changing the LMTP socket for virtual mail only (see below).
Mailer specification:
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 conversation:
$ 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.
Resulting LMTP conversation:
# 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 address translation (I think this is the way the internal processing works, someone correct me if not and I'll fix this):
$ 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
Sometimes you just need to type everything out to straighten out your own mind.
This was caused by a blank domain in
mailertable
, ie:Changing this to the following resolved the issue entirely: