|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
Re: mysql maps+address rewirting problem
From: John Fawcett (johnml
michaweb.net)
Date: Fri Jul 02 2004 - 05:37:42 CDT
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
From: "Andri Piik" <apiik
tmk.ee>
> Hi some days ago I wrote here about the problem that postfix rewrites the
> outgoing adress wrong under certain circumstances. I use cyrus,mysql
> address maps and postfix. The problem occurs when I have a user whose
> username is bogus and e-mail address bogus
test1.com and another user
> bogus
test2.com with username bogg. When I send teh e-mail from
> bogus
test2.com it's sender address gets written to bogus
test1.com. I got
> advice to put teh -v flag to cleanup. I understand that adress rewriting
> runs for several times but why? Can anyone help me?
The following log entry shows that the mail is being sent from
bogg
tln.edu.ee
not from bogus
test2.com.
> Jul 2 08:55:47 alpha postfix/pickup[13499]: 64EFD179560: uid=99
> from=<bogg
tln.edu.ee>
The requests to rewrite the addresses are done for both the envelope sender
and the From header (if I'm reading this correctly) and in both cases the
user
that sent the mail is not the one you think it is:
> Jul 2 08:55:47 alpha postfix/cleanup[13511]: initial envelope S
> bogg
tln.edu.ee
> Jul 2 08:55:47 alpha postfix/cleanup[13511]: send attr request = rewrite
> Jul 2 08:55:47 alpha postfix/cleanup[13511]: send attr rule =
canonicalize
> Jul 2 08:55:47 alpha postfix/cleanup[13511]: send attr address =
> bogg
tln.edu.ee
> Jul 2 08:55:47 alpha postfix/cleanup[13511]: rewrite_sender: From
> Jul 2 08:55:47 alpha postfix/cleanup[13511]: send attr request = rewrite
> Jul 2 08:55:47 alpha postfix/cleanup[13511]: send attr rule =
canonicalize
> Jul 2 08:55:47 alpha postfix/cleanup[13511]: send attr address =
> bogg
tln.edu.ee
From the queries executed (below), you can see that first of all cleanup
checks
whether bogg
tln.edu.ee should be rewritten, then as that isn't found
postfix checks the bear user name bogg. That is found.
So your canonical maps are set up to user bear user names without domains.
You are mapping bogg to bogus
test2.com via canoncial maps.
> select alias from virtual where username = 'bogg
tln.edu.ee' and status =
'1' limit 1
> sender_canonical_maps: bogg
tln.edu.ee: not found
> select alias from virtual where username = 'bogg' and status = '1' limit 1
> sender_canonical_maps: mysql:/etc/postfix/mysql-canonical.cf(0,100): bogg
> = bogus
test2.com
You have also set up your canonical maps so that they map the user
bogus to bogus
test1.com.
> select alias from virtual where username = 'bogus
test2.com' and status =
'1' limit 1
> sender_canonical_maps: bogus
test2.com: not found
> select alias from virtual where username = 'bogus' and status = '1' limit
1
> sender_canonical_maps: mysql:/etc/postfix/mysql-canonical.cf(0,100): bogus
= bogus
test1.com
> select alias from virtual where username = 'bogus
test1.com' and status =
'1' limit 1
> sender_canonical_maps: bogus
test1.com: not found
> select alias from virtual where username = 'bogus' and status = '1' limit
1
> sender_canonical_maps: mysql:/etc/postfix/mysql-canonical.cf(0,100): bogus
> = bogus
test1.com
You may have to look at what you're trying to achieve with this
address rewriting. Instead of doing rewriting, why not set up your mail
client to give the correct information on outgoing mail? (or am I
missing something obvious?)
John
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]