From: Stan Hoeppner on
Johan Vromans put forth on 7/13/2010 2:36 AM:

> The problem: although I have configured
>
> mydomain = squirrel.nl
> myorigin = squirrel.nl
>
> postfix stil uses the real, local hostname in the SMTP envelope:

What do you want the SMTP host name to be? squirrel.nl ? johan.squirrel.nl ?

/etc/postfix/main.cf

myhostname = squirrel.nl

or

myhostname = johan.squirrel.nl

Maybe I'm missing something, but AFAIK this should permanently fix your
problem. Your scenario is exactly why the myhostname option exists: for when
you desire an SMTP hostname different from the local machine hostname+domain.

This is the correct way to fix your problem AFAIK. As to why the behavior
changed with Fedora 13/Postfix 2.7 I don't know. You'll likely have to comb
your Fedora and Postfix configs with fine teeth to find the answer. Or as
Noel suggests, post logging of the transactions so we can see exactly what's
happening.

--
Stan

From: Johan Vromans on
Noel Jones <njones(a)megan.vbhcs.org> writes:

> It might be helpful if you shared the logs of mail entering postfix
> when you run your test command.

As basic as possible:

$ cat test.msg
To: johan(a)sppn.nl

test message
$ /usr/sbin/sendmail -v -t < test.msg

While figuring this out I ran severeal tests and it occurred to me
that it was rather strange for sendmail to pass the message to postfix
using SMTP. Further investigation revealed the real cause of my
problems: for some reasons /usr/sbin/sendmail had not been replaced by
its postfix variant.

With the following (relevant) entries in main,cf:

myorigin = $mydomain
#masquerade_domains = $mydomain

This is what happens when I pass the message to the sendmail variant:

postfix/smtpd[1331]: connect from localhost.localdomain[127.0.0.1]
postfix/smtpd[1331]: BC22AC53F7: client=localhost.localdomain[127.0.0.1]
postfix/cleanup[1333]: BC22AC53F7: message-id=<201007140925.o6E9POvn001329(a)phoenix.squirrel.nl>
postfix/qmgr[4845]: BC22AC53F7: from=<jv(a)phoenix.squirrel.nl>, size=509, nrcpt=1 (queue active)
sendmail[1329]: o6E9POvn001329: to=johan(a)sppn.nl, ctladdr=jv (501/501), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30032, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (Ok: queued as BC22AC53F7)
postfix/smtpd[1331]: disconnect from localhost.localdomain[127.0.0.1]
postfix/smtp[1334]: < smtp.xs4all.nl[194.109.6.51]:25: 220 smtp-vbr12.xs4all.nl ESMTP Sendmail 8.13.8/8.13.8; Wed, 14 Jul 2010 11:25:25 +0200 (CEST)
postfix/smtp[1334]: > smtp.xs4all.nl[194.109.6.51]:25: EHLO phoenix.squirrel.nl
postfix/smtp[1334]: < smtp.xs4all.nl[194.109.6.51]:25: 250-smtp-vbr12.xs4all.nl Hello sioban.squirrel.nl [80.101.24.220], pleased to meet you
postfix/smtp[1334]: < smtp.xs4all.nl[194.109.6.51]:25: 250-ENHANCEDSTATUSCODES
postfix/smtp[1334]: < smtp.xs4all.nl[194.109.6.51]:25: 250-PIPELINING
postfix/smtp[1334]: < smtp.xs4all.nl[194.109.6.51]:25: 250-8BITMIME
postfix/smtp[1334]: < smtp.xs4all.nl[194.109.6.51]:25: 250-SIZE 31457280
postfix/smtp[1334]: < smtp.xs4all.nl[194.109.6.51]:25: 250-DSN
postfix/smtp[1334]: < smtp.xs4all.nl[194.109.6.51]:25: 250-AUTH LOGIN PLAIN
postfix/smtp[1334]: < smtp.xs4all.nl[194.109.6.51]:25: 250-STARTTLS
postfix/smtp[1334]: < smtp.xs4all.nl[194.109.6.51]:25: 250-DELIVERBY
postfix/smtp[1334]: < smtp.xs4all.nl[194.109.6.51]:25: 250 HELP
postfix/smtp[1334]: server features: 0x901f size 31457280
postfix/smtp[1334]: Using ESMTP PIPELINING, TCP send buffer size is 4096
postfix/smtp[1334]: > smtp.xs4all.nl[194.109.6.51]:25: MAIL FROM:<jv(a)phoenix.squirrel.nl> SIZE=509
postfix/smtp[1334]: > smtp.xs4all.nl[194.109.6.51]:25: RCPT TO:<johan(a)sppn.nl> ORCPT=rfc822;johan(a)sppn.nl
postfix/smtp[1334]: > smtp.xs4all.nl[194.109.6.51]:25: DATA
postfix/smtp[1334]: < smtp.xs4all.nl[194.109.6.51]:25: 250 2.1.0 <jv(a)phoenix.squirrel.nl>... Sender ok
postfix/smtp[1334]: < smtp.xs4all.nl[194.109.6.51]:25: 250 2.1.5 <johan(a)sppn.nl>... Recipient ok
postfix/smtp[1334]: < smtp.xs4all.nl[194.109.6.51]:25: 354 Enter mail, end with "." on a line by itself
postfix/smtp[1334]: > smtp.xs4all.nl[194.109.6.51]:25: .
postfix/smtp[1334]: > smtp.xs4all.nl[194.109.6.51]:25: QUIT
postfix/smtp[1334]: < smtp.xs4all.nl[194.109.6.51]:25: 250 2.0.0 smtp-vbr12.xs4all.nl accepted message o6E9PPBt095223
postfix/smtp[1334]: BC22AC53F7: to=<johan(a)sppn.nl>, relay=smtp.xs4all.nl[194.109.6.51]:25, delay=0.37, delays=0.1/0.02/0.11/0.14, dsn=2.0.0, status=sent (250 2.0.0 smtp-vbr12.xs4all.nl accepted message o6E9PPBt095223)

This is the postfix variant:

postfix/pickup[31556]: 94A56C53F6: uid=501 from=<jv>
postfix/cleanup[1333]: 94A56C53F6: message-id=<20100714092541.94A56C53F6(a)phoenix.squirrel.nl>
postfix/qmgr[4845]: 94A56C53F6: from=<jv(a)squirrel.nl>, size=297, nrcpt=1 (queue active)
postfix/smtp[1334]: < smtp.xs4all.nl[194.109.6.51]:25: 220 smtp-vbr2.xs4all.nl ESMTP Sendmail 8.13.8/8.13.8; Wed, 14 Jul 2010 11:25:41 +0200 (CEST)
postfix/smtp[1334]: > smtp.xs4all.nl[194.109.6.51]:25: EHLO phoenix.squirrel.nl
postfix/smtp[1334]: < smtp.xs4all.nl[194.109.6.51]:25: 250-smtp-vbr2.xs4all.nl Hello sioban.squirrel.nl [80.101.24.220], pleased to meet you
postfix/smtp[1334]: < smtp.xs4all.nl[194.109.6.51]:25: 250-ENHANCEDSTATUSCODES
postfix/smtp[1334]: < smtp.xs4all.nl[194.109.6.51]:25: 250-PIPELINING
postfix/smtp[1334]: < smtp.xs4all.nl[194.109.6.51]:25: 250-8BITMIME
postfix/smtp[1334]: < smtp.xs4all.nl[194.109.6.51]:25: 250-SIZE 31457280
postfix/smtp[1334]: < smtp.xs4all.nl[194.109.6.51]:25: 250-DSN
postfix/smtp[1334]: < smtp.xs4all.nl[194.109.6.51]:25: 250-AUTH LOGIN PLAIN
postfix/smtp[1334]: < smtp.xs4all.nl[194.109.6.51]:25: 250-STARTTLS
postfix/smtp[1334]: < smtp.xs4all.nl[194.109.6.51]:25: 250-DELIVERBY
postfix/smtp[1334]: < smtp.xs4all.nl[194.109.6.51]:25: 250 HELP
postfix/smtp[1334]: server features: 0x901f size 31457280
postfix/smtp[1334]: Using ESMTP PIPELINING, TCP send buffer size is 4096
postfix/smtp[1334]: > smtp.xs4all.nl[194.109.6.51]:25: MAIL FROM:<jv(a)squirrel.nl> SIZE=297
postfix/smtp[1334]: > smtp.xs4all.nl[194.109.6.51]:25: RCPT TO:<johan(a)sppn.nl> ORCPT=rfc822;johan(a)sppn.nl
postfix/smtp[1334]: > smtp.xs4all.nl[194.109.6.51]:25: DATA
postfix/smtp[1334]: < smtp.xs4all.nl[194.109.6.51]:25: 250 2.1.0 <jv(a)squirrel.nl>... Sender ok
postfix/smtp[1334]: < smtp.xs4all.nl[194.109.6.51]:25: 250 2.1.5 <johan(a)sppn.nl>... Recipient ok
postfix/smtp[1334]: < smtp.xs4all.nl[194.109.6.51]:25: 354 Enter mail, end with "." on a line by itself
postfix/smtp[1334]: > smtp.xs4all.nl[194.109.6.51]:25: .
postfix/smtp[1334]: > smtp.xs4all.nl[194.109.6.51]:25: QUIT
postfix/smtp[1334]: < smtp.xs4all.nl[194.109.6.51]:25: 250 2.0.0 smtp-vbr2.xs4all.nl accepted message o6E9PfiS042972
postfix/smtp[1334]: 94A56C53F6: to=<johan(a)sppn.nl>, relay=smtp.xs4all.nl[194.109.6.51]:25, delay=0.35, delays=0.06/0/0.11/0.18, dsn=2.0.0, status=sent (250 2.0.0 smtp-vbr2.xs4all.nl accepted message o6E9PfiS042972)

In the sendmail case postfix considers this a relay so it doesn't
fiddle with the addresses.

Kudos to Victor who first suggested to look at the frontend programs.

Thanks all for helping me solve this, correctly and permanently.

-- Johan

From: Noel Jones on
On 7/14/2010 5:01 AM, Johan Vromans wrote:
> Noel Jones<njones(a)megan.vbhcs.org> writes:
>
>> It might be helpful if you shared the logs of mail entering postfix
>> when you run your test command.
>
> As basic as possible:
>
> $ cat test.msg
> To: johan(a)sppn.nl
>
> test message
> $ /usr/sbin/sendmail -v -t< test.msg
>
> While figuring this out I ran severeal tests and it occurred to me
> that it was rather strange for sendmail to pass the message to postfix
> using SMTP. Further investigation revealed the real cause of my
> problems: for some reasons /usr/sbin/sendmail had not been replaced by
> its postfix variant.
>
> With the following (relevant) entries in main,cf:
>
> myorigin = $mydomain
> #masquerade_domains = $mydomain
>
> This is what happens when I pass the message to the sendmail variant:
>
> postfix/smtpd[1331]: connect from localhost.localdomain[127.0.0.1]
> postfix/smtpd[1331]: BC22AC53F7: client=localhost.localdomain[127.0.0.1]
> postfix/cleanup[1333]: BC22AC53F7: message-id=<201007140925.o6E9POvn001329(a)phoenix.squirrel.nl>
> postfix/qmgr[4845]: BC22AC53F7: from=<jv(a)phoenix.squirrel.nl>, size=509, nrcpt=1 (queue active)

I suspected as much; sendmail has already added the offending
hostname. Uninstalling sendmail will fix this and possibly
other problems.

You could fix this in postfix with the masquerade_domains
parameter, but the proper fix is to remove sendmail.

>
....
> In the sendmail case postfix considers this a relay so it doesn't
> fiddle with the addresses.

No, postfix doesn't fiddle with it because it already has a
domain name. Postfix doesn't alter FQDN addresses unless
you've specified some rewriting as detailed in
http://www.postfix.org/ADDRESS_REWRITING_README.html


-- Noel Jones