Unfortunately it seems that Wietse's suggestion was not sufficient for
the smtp server. I now get a different (but similar) error:
Jun  6 17:14:53 localhostname postfix/smtp[76133]: D7ED9A18A05:
to=<user1.h...@work.com>,
relay=smtp.work.com[192.168.1.89]:587, delay=1.7, delays=0/0/1.4/0.35,
dsn=5.7.1,
status=bounced (host smtp.work.com[192.168.1.89] said: 550 5.7.1
Client does not have permissions to send as this sender (in reply to
end of DATA command))

The logs were going crazy until I took out the
sender_canonical_maps related lines in main.cf and did a postfix reload.
I think it kept trying to send.

I also need to make sure that the if statement will replace a MAIL
FROM sender who is not me rather than not only in my domain. So
perhaps
it would be?:
if !/[[:<:]]user1\.home@work\.com$/
/./ user1\.home@work\.com
endif

But the mail.log says this is incorrect:
Jun  6 17:25:19 gs611-hardradi postfix/cleanup[76238]: warning: pcre
map /etc/postfix/sender_canonical, line 1: error in regex at offset 3:
unknown POSIX class name
Jun  6 17:25:19 gs611-hardradi postfix/cleanup[76238]: warning: pcre
map /etc/postfix/sender_canonical, line 3: ignoring ENDIF without
matching IF

I've tried digging around to better understand the pcre syntax, but
I haven't had much luck. I hope I've provided enough info...

cheers,
mike



On Mon, Jun 6, 2011 at 4:22 PM, Wietse Venema <wie...@porcupine.org> wrote:
> Wietse Venema:
>> Wietse:
>> > Why do you believe that it complains about the "From" address in
>> > the email header, instead of the SMTP "MAIL FROM" address?
>>
>> Michael Way:
>> > Sorry Wietse, my bad you are correct. It is the MAIL FROM:  I
>> > should have included the full line:  550 5.7.1 Client does not
>> > have permissions to send as this sender (in reply to MAIL FROM
>> > command))
>>
>> sender_canonical_maps should take care of this.
>>
>> In /etc/postfix/main.cf:
>>
>>     sender_canonical_maps = pcre:/etc/postfix/sender_canonical
>>     sender_canonical_classes = envelope_sender
>>
>> Note: no whitespace before those lines.
>>
>> In /etc/postfix/sender_canonical:
>>
>>     if /[[:<:]]example\.com$/
>>     /./       y...@example.com
>>     endif
>
> Make that:
>
>        if !/[[:<:]]example\.com$/
>
> That is, execute the action inside if/endif only when the
> sender does not match your local domain.
>
>> Note: no whitespace before those lines.
>>
>> That will replace a MAIL FROM sender not in your domain by your
>> own address.
>>
>>       Wietse
>>
>>
>
>

Reply via email to