Hello All,

I originally posted this on the xmail homelinux forums where it was suggested I 
ask here. The issue I have is that I wanted to change the rcpt of an email 
during the filtering process, for instance to direct a virus infected message 
to a special "virii-locker" account.

Here's a cut and paste of my post last night I made while debugging.


I spent a bit tonight with this and found that using filters.in.tab does not 
allow me to change the rcpt, however using filters.post-data.tab it *does* work 
(which is fine by me since that is what i'm using now)
Just for sanity's sake, I went back and retested this. The test.pl script is 
copied here:
http://xmail.n3t.net/test.txt

: cat filters.in.tab 
"*" "*" "0.0.0.0/0" "0.0.0.0/0" "testfilter.tab"

: cat filters/testfilter.tab 
"/var/email/bin/test.pl" "@@FILE" "@@REMOTEADDR" "@@FROM" "@@RCPT"

neither account has any mail in it (to make this easier)

: find domains/n3t.net/tmp/Maildir/
domains/n3t.net/tmp/Maildir/
domains/n3t.net/tmp/Maildir/tmp
domains/n3t.net/tmp/Maildir/new
domains/n3t.net/tmp/Maildir/cur

: find domains/n3t.net/virii/Maildir/
domains/n3t.net/virii/Maildir/
domains/n3t.net/virii/Maildir/tmp
domains/n3t.net/virii/Maildir/new
domains/n3t.net/virii/Maildir/cur

I send an email from [EMAIL PROTECTED] to [EMAIL PROTECTED] . The filter script 
knows to substitute all [EMAIL PROTECTED] addys with [EMAIL PROTECTED] in both 
xmail headers and the normal mail. The final message is saved in /tmp/lastemail 
(after all subs and such).

Afterwards:

: find domains/n3t.net/tmp/Maildir/
domains/n3t.net/tmp/Maildir/
domains/n3t.net/tmp/Maildir/tmp
domains/n3t.net/tmp/Maildir/new
domains/n3t.net/tmp/Maildir/new/1111288327616.135246848.6d.krondor.network3.net
domains/n3t.net/tmp/Maildir/cur

: find domains/n3t.net/virii/Maildir/
domains/n3t.net/virii/Maildir/
domains/n3t.net/virii/Maildir/tmp
domains/n3t.net/virii/Maildir/new
domains/n3t.net/virii/Maildir/cur

We can see it was physically delivered to [EMAIL PROTECTED]

: tail -n 1 logs/smtp-200503170000 
"network3.net" "network3.net" "68.51.163.219" "2005-03-20 03:12:07" 
"noir.n3t.net" "n3t.net" "[EMAIL PROTECTED]" "[EMAIL PROTECTED]" "SBA5" 
"RECV=OK" "[EMAIL PROTECTED]" "366" ""

Eventhough the smail log suggests [EMAIL PROTECTED] ..

: tail -n 1 logs/smail-200503170000 
"network3.net" "1111288327616.135246848.6d.krondor.network3.net" "SBA5" "[EMAIL 
PROTECTED]" "[EMAIL PROTECTED]" "LOCAL" "[EMAIL PROTECTED]" "2005-03-20 
03:12:07"

Checking the final version of $file :

: cat /tmp/lastemail 
[68.51.163.219]:38790;[64.92.164.60]:25;Sun, 20 Mar 2005 03:12:07 -0000
network3.net
SBA5
MAIL FROM:<[EMAIL PROTECTED]>
RCPT TO:<[EMAIL PROTECTED]>
<<MAIL-DATA>>
X-AuthUser: [EMAIL PROTECTED]
Received: from noir.n3t.net ([68.51.163.219]:38790)
by network3.net with [XMail 1.21 ESMTP Server]
id <SBA5> for <[EMAIL PROTECTED]> from <[EMAIL PROTECTED]>;
Sun, 20 Mar 2005 03:12:07 -0000
Date: Sun, 20 Mar 2005 03:04:34 -0500
From: decker <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: test email
Message-ID: <[EMAIL PROTECTED]>
X-Mailer: Sylpheed-Claws 0.9.12a (GTK+ 1.2.10; i686-pc-linux-gnu)
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit

this is a test email to [EMAIL PROTECTED] ...

(end)

Note that the above email never mentioned [EMAIL PROTECTED], it was all [EMAIL 
PROTECTED]

When I move test.pl from the filters.in.tab over to filters.post-data.tab , i 
get:

: find domains/n3t.net/tmp/Maildir/
domains/n3t.net/tmp/Maildir/
domains/n3t.net/tmp/Maildir/tmp
domains/n3t.net/tmp/Maildir/new
domains/n3t.net/tmp/Maildir/cur

: find domains/n3t.net/virii/Maildir/
domains/n3t.net/virii/Maildir/
domains/n3t.net/virii/Maildir/tmp
domains/n3t.net/virii/Maildir/new
domains/n3t.net/virii/Maildir/new/1111288569545.135246848.6e.krondor.network3.net
domains/n3t.net/virii/Maildir/cur

: tail -n 1 logs/smtp-200503170000 
"network3.net" "network3.net" "68.51.163.219" "2005-03-20 03:16:09" 
"noir.n3t.net" "n3t.net" "[EMAIL PROTECTED]" "[EMAIL PROTECTED]" "SBA6" 
"RECV=OK" "[EMAIL PROTECTED]" "366" ""

: tail -n 1 logs/smail-200503170000 
"network3.net" "1111288569545.135246848.6e.krondor.network3.net" "SBA6" "[EMAIL 
PROTECTED]" "[EMAIL PROTECTED]" "LOCAL" "[EMAIL PROTECTED]" "2005-03-20 
03:16:09"

: cat /tmp/lastemail 
noir.n3t.net;[68.51.163.219]:45994;network3.net;[64.92.164.60]:25;Sun, 20 Mar 
2005 03:16:09 -0000;[XMail 1.21 ESMTP Server]
network3.net
SBA6
MAIL FROM:<[EMAIL PROTECTED]>
RCPT TO:<[EMAIL PROTECTED]> [EMAIL PROTECTED]
<<MAIL-DATA>>
Date: Sun, 20 Mar 2005 03:08:39 -0500
From: decker <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: test email
Message-ID: <[EMAIL PROTECTED]>
X-Mailer: Sylpheed-Claws 0.9.12a (GTK+ 1.2.10; i686-pc-linux-gnu)
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit

this is a test email to [EMAIL PROTECTED] ...

(end)


I also found that one can just make the address substitutions in the xmail 
headers and leave the actual email message intact and it works the same way.

So, I guess the question is, is it normal that filters.in.tab does not allow 
the rcpt to be changed while the filters.post-data.tab does ? Am I perhaps 
doing something incorrectly ?

Thanks :)
-d
-
To unsubscribe from this list: send the line "unsubscribe xmail" in
the body of a message to [EMAIL PROTECTED]
For general help: send the line "help" in the body of a message to
[EMAIL PROTECTED]

Reply via email to