Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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 (though local 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,
    A=FILE /var/run/dovecot/lmtp

SMTP conversation:

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

Hello there, everyone!
250-mail.example.com Hello localhost [], pleased to meet you
250 HELP
250 2.1.0 root@example.com... Sender ok
250 2.1.5 mscharley@example.com... 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
> MAIL From:<root@example.com>\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 mscharley@example.com
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
share|improve this question
your information is not consistent between the displays. Thus confusion! –  mdpc Nov 1 '11 at 0:23
@mdpc Yes, I tried to sanitise a bit, but failed miserably. Oops. Should be consistent now though (though, see my answer). –  Matthew Scharley Nov 1 '11 at 0:33

1 Answer 1

up vote 1 down vote accepted

Sometimes you just need to type everything out to straighten out your own mind.

This was caused by a blank domain in mailertable, ie:

example.com    dovecot:

Changing this to the following resolved the issue entirely:

example.com    dovecot:example.com
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.