postfix rewrite process problem

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

postfix rewrite process problem

Jittinan Suwanrueangsri

I test canonical rewrite process in postfix by following process

1.configure main.cf which I execute "postconf -n" it yield (mynetworks values are replaced by x.x.x.x,Our domain parts are replace by ourdomain)

command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
debug_peer_level = 2
html_directory = no
local_header_rewrite_clients = static:all
mail_owner = postfix
mailq_path = /usr/bin/mailq
manpage_directory = /usr/local/man
myhostname = mail.postfix.ourdomain.com
mynetworks = x.x.x.x
newaliases_path = /usr/bin/newaliases
queue_directory = /var/spool/postfix
readme_directory = no
sample_directory = /etc/postfix
sender_canonical_maps = hash:/etc/postfix/sender_canonical
sendmail_path = /usr/sbin/sendmail
setgid_group = postdrop
unknown_local_recipient_reject_code = 550

2. I create /etc/postfix/sender_canonical

[hidden email] [hidden email]
jittinans
[hidden email]
@postfix.ourdomain.com
[hidden email]

3.execute "postmap hash:/etc/postfix/sender_canonical"

4.execute "postmap -q [hidden email] hash:/etc/postfix/sender_canonial" .Output is
[hidden email]

5.execute "postmap -q [hidden email] hash:/etc/postfix/sender_canonial" .Output is
[hidden email]

6.execute "postmap -q [hidden email] hash:/etc/postfix/sender_canonial" .Output is
[hidden email]

7.I send mail from [hidden email] to [hidden email] but when I recieve email in gmail inbox.It show message come from [hidden email]

8.According to /etc/postfix/sender_canonical It should be [hidden email] but it is [hidden email] WHY?

9.I debug it process by add -v to /etc/postfix/master.cf .After that reload postfix.

10.this is some part of logfile which I think it may help to diagnose problems.I also attach full version of maillog.If you want additional information please inform me.

Jun 21 09:36:29 mail postfix/cleanup[21216]: private/rewrite socket: wanted attribute: flags
Jun 21 09:36:29 mail postfix/cleanup[21216]: input attribute name: flags
Jun 21 09:36:29 mail postfix/cleanup[21216]: input attribute value: 0
Jun 21 09:36:29 mail postfix/cleanup[21216]: private/rewrite socket: wanted attribute: address
Jun 21 09:36:29 mail postfix/cleanup[21216]: input attribute name: address
Jun 21 09:36:29 mail postfix/cleanup[21216]: input attribute value:
[hidden email]
Jun 21 09:36:29 mail postfix/cleanup[21216]: private/rewrite socket: wanted attribute: (list terminator)
Jun 21 09:36:29 mail postfix/cleanup[21216]: input attribute name: (end)
Jun 21 09:36:29 mail postfix/cleanup[21216]: rewrite_clnt: local:
[hidden email] -> [hidden email]
Jun 21 09:36:29 mail postfix/cleanup[21216]: mail_addr_map:
[hidden email] -> 0: [hidden email]
Jun 21 09:36:29 mail postfix/cleanup[21216]: maps_find: sender_canonical_maps:
[hidden email]: not found
Jun 21 09:36:29 mail postfix/cleanup[21216]: match_string: postfix.ourdomain.com ~? mail.postfix.ourdomain.com
Jun 21 09:36:29 mail postfix/cleanup[21216]: match_string: postfix.ourdomain.com ~? localhost.postfix.ourdomain.com
Jun 21 09:36:29 mail postfix/cleanup[21216]: match_string: postfix.ourdomain.com ~? localhost
Jun 21 09:36:29 mail postfix/cleanup[21216]: match_list_match: postfix.ourdomain.com: no match
Jun 21 09:36:29 mail postfix/cleanup[21216]: maps_find: sender_canonical_maps: hash:/etc/postfix/sender_canonical(0,lock|fold_fix): @postfix.ourdomain.com =
[hidden email]
Jun 21 09:36:29 mail postfix/cleanup[21216]: mail_addr_find:
[hidden email] -> [hidden email]
Jun 21 09:36:29 mail postfix/cleanup[21216]: send attr request = rewrite
Jun 21 09:36:29 mail postfix/cleanup[21216]: send attr rule = local
Jun 21 09:36:29 mail postfix/cleanup[21216]: send attr address =
[hidden email]

 

 


maillog-modified.zip (10K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: postfix rewrite process problem

mouss-2
Jittinan Suwanrueangsri wrote:
> I test canonical rewrite process in postfix by following process
> [snip]
>
> 2. I create /etc/postfix/sender_canonical
>
> [hidden email] [hidden email]
> jittinans [hidden email]
> @postfix.ourdomain.com [hidden email]
>  

$ man canonical
...
     The address mapping is recursive.



so sending [hidden email] becomes fulladdress@example, which in
turn mattches the wildcard (@example.com) and becomes
[hidden email].

To prevent this, add a "identity mapping":

[hidden email]      
[hidden email]

PS. Note that the wildcard canonical (@example.com ...) breaks recipient
validation, so that all addresses in this domain will be accepted by
postfix. make sure you don't bounce them after they have been accepted.
see the BACKSCATTER README for more infos.
> [snip]
>
>
>  

Reply | Threaded
Open this post in threaded view
|

Re: postfix rewrite process problem

Victor Duchovni
In reply to this post by Jittinan Suwanrueangsri
On Sat, Jun 21, 2008 at 12:10:39PM +0700, Jittinan Suwanrueangsri wrote:

> I test canonical rewrite process in postfix by following process
>
> 1.configure main.cf which I execute "postconf -n" it yield (mynetworks values are replaced by x.x.x.x,Our domain parts are replace by ourdomain)
>
> sample_directory = /etc/postfix
> sender_canonical_maps = hash:/etc/postfix/sender_canonical

Don't use sender_canonical_maps. Use smtp_generic_maps instead (requires
Postfix 2.2 or later). This does not:

        - Break recipient validation

        - Work recursively leading to surprises in your use case

        - Have dubiuos semantics with "To/Cc" headers containing
          recipients in your domain.

The "sender_canonical_maps" feature is obsolete, and though it always
worked as documented, it is not really possible to use it correctly,
because the notion of "sender" headers is context dependent. The context
(locally composed mail going out vs remotely composed mail coming in)
is available with smtp_generic_maps which acts only on outgoing mail
(if necessary specify via "-o smtp_generic_maps=$transportname_generic_maps"
in master.cf with a corresponing setting in main.cf).

--
        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.