regexp table for sender_canonical changed, but postfix still use old one even reload

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

regexp table for sender_canonical changed, but postfix still use old one even reload

xm niu
My postfix version:2.3.8. I use a regex table for sender_canonical.

In the main.cf, I set:
 local_header_rewrite_clients = permit_inet_interfaces,permit_mynetworks
 sender_canonical_maps = regexp:/etc/postfix/sender_canonical

In the file sender_canonical, I set:
/^test/ [hidden email]

This changes the Return-Path of mail from user test ( This is what we say address in the message envelope, right?) to [hidden email].

Recently, I had to change the sender_canonical file to:
/^test/ [hidden email]

(I didn't show the real email address in the above example)

Then I tried to reload, stop , start postfix, but postfix kept using the old regex setting, user test always gets [hidden email] as return address.

The mail.log shows "from [hidden email]" when user test sends mail out, and when I check the mail, the return-path also shows [hidden email].

I read that the changes in regexp table should be picked up by reload command. But now I even tried stop and restart, it is still not working. It seems save in the memory for ever? Don't know why, what to try. Reboot the machine?

Thanks for any help in advance


Get 5GB of online storage for free! Get it Now!
Reply | Threaded
Open this post in threaded view
|

Re: regexp table for sender_canonical changed, but postfix still use old one even reload

Victor Duchovni
On Mon, Jun 09, 2008 at 09:03:40AM +0000, xm niu wrote:

>
> My postfix version:2.3.8. I use a regex table for sender_canonical.
>
> In the main.cf, I set:
>  local_header_rewrite_clients = permit_inet_interfaces,permit_mynetworks
>  sender_canonical_maps = regexp:/etc/postfix/sender_canonical
>
> In the file sender_canonical, I set:
> /^test/ [hidden email]

This applies to all domains, not just yours, and is a very bad idea. In
fact sender_canonical_maps has poor semantics, because the meaning of
"To:" and "Cc:" headers is context dependent, so they are recipient headers
when submitting mail, and "sender" headers when using "Reply-All".

Do not use sender_canonical_maps, use "generic_maps" if you need to map
internal names to external names.

    http://www.postfix.org/STANDARD_CONFIGURATION_README.html#fantasy

> This changes the Return-Path of mail from user test ( This is what we say address in the message envelope, right?) to [hidden email].

No, it also changes headers unless you change sender_canonical_classes
from its default value.

> Then I tried to reload, stop , start postfix, but postfix kept using the old regex setting, user test always gets [hidden email] as return address.

Test your regexp table with "postmap -q" and report the results. Also:

        http://www.postfix.org/DEBUG_README.html#mail

--
        Viktor.

Disclaimer: off-list followups get on-list replies or get ignored.
Please do not ignore the "Reply-To" header.

To unsubscribe from the postfix-users list, visit
http://www.postfix.org/lists.html or click the link below:
<mailto:[hidden email]?body=unsubscribe%20postfix-users>

If my response solves your problem, the best way to thank me is to not
send an "it worked, thanks" follow-up. If you must respond, please put
"It worked, thanks" in the "Subject" so I can delete these quickly.
Reply | Threaded
Open this post in threaded view
|

RE: regexp table for sender_canonical changed, but postfix still use old one even reload

xm niu
First, thanks for the reply.

I know the sender_canonical_maps changes both the envelop sender address and header sender address according to the sender_canonical_classes.

postmap -q "test" regexp:/etc/postfix/sender_canonical shows the changed valid email address. eg.
[hidden email]. But postfix still uses the old address.  It is just so strange, and don't understand why, I will also try some more detailed debug tools maybe.

I will try generic map and report the result.


> > My postfix version:2.3.8. I use a regex table for sender_canonical.
> >
> > In the main.cf, I set:
> > local_header_rewrite_clients = permit_inet_interfaces,permit_mynetworks
> > sender_canonical_maps = regexp:/etc/postfix/sender_canonical
> >
> > In the file sender_canonical, I set:
> > /^test/ [hidden email]
>
> This applies to all domains, not just yours, and is a very bad idea. In
> fact sender_canonical_maps has poor semantics, because the meaning of
> "To:" and "Cc:" headers is context dependent, so they are recipient headers
> when submitting mail, and "sender" headers when using "Reply-All".
>
> Do not use sender_canonical_maps, use "generic_maps" if you need to map
> internal names to external names.
>
> http://www.postfix.org/STANDARD_CONFIGURATION_README.html#fantasy

>
> > This changes the Return-Path of mail from user test ( This is what we say address in the message envelope, right?) to [hidden email].
>
> No, it also changes headers unless you change sender_canonical_classes
> from its default value.
>
> > Then I tried to reload, stop , start postfix, but postfix kept using the old regex setting, user test always gets [hidden email] as return address.
>
> Test your regexp table with "postmap -q" and report the results. Also:
>
> http://www.postfix.org/DEBUG_README.html#mail
>
> --
> Viktor.
>
> Disclaimer: off-list followups get on-list replies or get ignored.
> Please do not ignore the "Reply-To" header.
>
> To unsubscribe from the postfix-users list, visit
> http://www.postfix.org/lists.html or click the link below:
> <mailto:[hidden email]?body=unsubscribe%20postfix-users>
>
> If my response solves your problem, the best way to thank me is to not
> send an "it worked, thanks" follow-up. If you must respond, please put
> "It worked, thanks" in the "Subject" so I can delete these quickly.


Get fish-slapping on Messenger! Play Now
Reply | Threaded
Open this post in threaded view
|

RE: regexp table for sender_canonical changed, but postfix still use old one even reload

xm niu
In reply to this post by Victor Duchovni
I have changed to generic_maps, it is working fine.

Thanks for the help.


Miss your Messenger buddies when on-the-go? Get Messenger on your Mobile!