I sent this to the postfix-users list, but didn't get any responses so
I'll repost it here.  I just wanted to know if there was any way around
this issue besides doing address rewriting after the amavisd-new.  Is
there even a way for amavisd-new to manually insert an X-Original-To
header since it seems to know the orig_to during the reinjection?  I could
then disable the x-original-to header addition by Postfix by setting up a
separate cleanup filter like so:

post-cleanup unix    n       -       n       -       0       cleanup
    -o enable_original_recipient=no

And, then:

127.0.0.1:10025 inet n    -    n    -    -    smtpd
.
.
.
    -o cleanup_service_name=post-cleanup

Thanks,
Zivago

--
Hello All,

I have another x-original-to question.  I've been searching thru this
and the amavisd-new list but I just wanted to make sure there was no
other way around on this...

Premise:
1. This server uses unix accounts as their mailboxes
2. This server uses virtual aliases for their unix accounts
3. This server has it setup to do alias rewriting *before* the content
filter (amavisd-new)

Reasons for #3:

1. White/Blacklist functionality with the local unix accounts
2. MailZu login with imap (local unix accounts)
3. amavisnewsql squirrelmail plugin with imap (local unix accoutns)

All email users on this server logs in with their unix accounts.  They
also login to webmail (Squirrelmail).

Notes:
If I set the address rewrite to happen *after* the content filter, the
aliases for those unix accounts (unless the alias is specifically
specified), none of the user specific filters (W/B list, specific user
settings) will be recognized.

Example:

unix account: foo
virtual domains: domain.com, anotherdomain.com
aliases: [EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED]


The user logs in with imap and webmail with user foo.  Amavisnewsql's
and MailZu's default domain is domain.com.

#1

If any email that comes in for [EMAIL PROTECTED], any specific W/B lists
will be processed correctly since that is what is setup for amavisnewsql
(Email column in users table).  It will also properly quarantine emails
properly depending on the user prefs as well.

#2

If any email that comes in for [EMAIL PROTECTED] (or
[EMAIL PROTECTED]), the W/B lists will be ignored since there is
user specific settings for these email addresses.  They will all go thru
the default system filters setup in amavisd-new (no user prefs).

Now, I set it to do address rewriting *before* the content filter:

#3

If any email that comes in for [EMAIL PROTECTED], [EMAIL PROTECTED], or
[EMAIL PROTECTED], since the address rewriting happens before the
content filters, they all rewrite to [EMAIL PROTECTED]  This makes sure
that all email coming in that is aliased to [EMAIL PROTECTED] will all hit
the correct prefs setup by the user foo.

However, this also rewrites the X-Original-To header.  So, I was
wondering, if there was a way to do #3, but also keep the original
header.  Here is a clip of a logfile of #3:

--
Aug 27 16:23:21 www postfix/smtpd[26702]: NOQUEUE: filter: RCPT from
cpe-76-170-237-134.socal.res.rr.com[76.170.237.134]: <[EMAIL PROTECTED]>:
Recipient address triggers FILTER smtp-amavis:[127.0.0.1]:10024;
from=<[EMAIL PROTECTED]> to=<[EMAIL PROTECTED]> proto=SMTP helo=<localhost>
Aug 27 16:23:21 www postgrey: action=pass, reason=client whitelist,
client_name=cpe-76-170-237-134.socal.res.rr.com,
client_address=76.170.237.134, [EMAIL PROTECTED],
[EMAIL PROTECTED]
Aug 27 16:23:21 www postfix/smtpd[26702]: 8BC09187832:
client=cpe-76-170-237-134.socal.res.rr.com[76.170.237.134]
Aug 27 16:23:25 www postfix/cleanup[26705]: 8BC09187832:
message-id=<[EMAIL PROTECTED]>
Aug 27 16:23:25 www postfix/qmgr[26701]: 8BC09187832:
from=<[EMAIL PROTECTED]>, size=382, nrcpt=1 (queue active)
Aug 27 16:23:26 www postfix/smtpd[26702]: disconnect from
cpe-76-170-237-134.socal.res.rr.com[76.170.237.134]
Aug 27 16:23:33 www postfix/smtpd[26713]: connect from
localhost[127.0.0.1]
Aug 27 16:23:33 www postfix/smtpd[26713]: F16B9187833:
client=localhost[127.0.0.1]
Aug 27 16:23:34 www postfix/cleanup[26705]: F16B9187833:
message-id=<[EMAIL PROTECTED]>
Aug 27 16:23:34 www postfix/smtpd[26713]: disconnect from
localhost[127.0.0.1]
Aug 27 16:23:34 www amavis[26464]: (26464-01) Passed SPAMMY,
[76.170.237.134] [76.170.237.134] <[EMAIL PROTECTED]> -> <[EMAIL PROTECTED]>,
Message-ID: <[EMAIL PROTECTED]>, mail_id:
6BCxB4jnWyPJ, Hits: 11.963, queued_as: F16B9187833, 8192 ms
Aug 27 16:23:34 www postfix/qmgr[26701]: F16B9187833:
from=<[EMAIL PROTECTED]>, size=1187, nrcpt=1 (queue active)
Aug 27 16:23:34 www postfix/lmtp[26706]: 8BC09187832:
to=<[EMAIL PROTECTED]>, orig_to=<[EMAIL PROTECTED]>,
relay=127.0.0.1[127.0.0.1]:10024, delay=16, delays=7.6/0.01/0.01/8.2,
dsn=2.6.0, status=sent (250 2.6.0 Ok, id=26464-01, from
MTA([127.0.0.1]:10025): 250 2.0.0 Ok: queued as F16B9187833)
Aug 27 16:23:34 www postfix/qmgr[26701]: 8BC09187832: removed
Aug 27 16:23:34 www postfix/local[26715]: F16B9187833:
to=<[EMAIL PROTECTED]>, relay=local, delay=0.15, delays=0.09/0.01/0/0.06,
dsn=2.0.0, status=sent (delivered to command: procmail -a "$EXTENSION"
DEFAULT=$HOME/Maildir/ MAILDIR=$HOME/Maildir)
--

On this line:

Aug 27 16:23:34 www postfix/lmtp[26706]: 8BC09187832:
to=<[EMAIL PROTECTED]>, orig_to=<[EMAIL PROTECTED]>,
relay=127.0.0.1[127.0.0.1]:10024, delay=16, delays=7.6/0.01/0.01/8.2,
dsn=2.6.0, status=sent (250 2.6.0 Ok, id=26464-01, from
MTA([127.0.0.1]:10025): 250 2.0.0 Ok: queued as F16B9187833)

I can see amavisd-new reinjecting the mail back to postfix and it shows
the proper orig_to but why does Postfix rewrite the X-Original-To
header?  Am I missing some variable to disable rewrites?  I already have
this in the reinjection service:

--
127.0.0.1:10025 inet n    -    n    -    -    smtpd
.
.
.
    -o
receive_override_optionso_address_mappings,no_header_body_checks,no_unknown_recipient_checks
    -o local_header_rewrite_clients=
--

-- 
Zivago Lee
[EMAIL PROTECTED]

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
AMaViS-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/amavis-user
AMaViS-FAQ:http://www.amavis.org/amavis-faq.php3
AMaViS-HowTos:http://www.amavis.org/howto/

Reply via email to