Reply to this topicStart new topicStart Poll

> Filters.in.tab Ran Twice?
sc4vengr
Posted: Dec 18 2007, 07:34 PM
Quote Post


Professional
*****

Group: Members
Posts: 206
Member No.: 461
Joined: 12-February 03



Hey guys,

I have a question regarding the execution of a filter that I have inside filters.in.tab.

I have 3 filters installed:

xspamcpd (filters.post-data.tab)
clamav fitler by Linderman (filters.in.tab)
custom php script that updates a database (filters.in.tab)

Also, the rcpt email has a mailproc.tab that runs a small "autoreply" script that sends an automatic message, it works very well.

The problem is that when I send an email to the rcpt it is run through xspamcpd, AV scanned, php script updates its stuff and the autoreply script sends his mail BUT it looks like the php script is ran twice WHEN I have the mailproc.tab autoreply activated. Like if there was an entry inside filters.out.tab that run the php script when sending mail (automatic message from autoreply script).

If I remove the mailproc.tab file inside the rcpt folder, it solve the problem.

Here is the debug log:

CODE

Filter run: Sender = "sender@domain.net" Recipient = "rcpt@mydomain.net" Filter = "/mailsrv/MailRoot/filters/webmail/webmail_update.php" Retcode = 0
Filter run: Sender = "sender@domain.net" Recipient = "rcpt@mydomain.net" Filter = "/mailsrv/MailRoot/filters/avfilter/checkvirus.pl" Retcode = 7
Filter run: Sender = "sender@domain.net" Recipient = "rcpt@mydomain.net" Filter = "/mailsrv/MailRoot/filters/webmail/webmail_update.php" Retcode = 0
Mail was allready scanned.
Filter run: Sender = "sender@domain.net" Recipient = "rcpt@mydomain.net" Filter = "/mailsrv/MailRoot/filters/avfilter/checkvirus.pl" Retcode = 0


Content of filters.in.tab

CODE

"*"     "*"     "0.0.0.0/0"     "0.0.0.0/0"     "webmail.tab"
"*"     "*"     "0.0.0.0/0"     "0.0.0.0/0"     "av-filter.tab"


Content of filters.out.tab (empty)

CODE




Content of filters.post-data.tab

CODE

"!aex"  "/mailsrv/xspamcpd/xspamc"      "/mailsrv/xspamcpd/xspamcpd.ini"        "@@FILE"        "@@REMOTEADDR"


Content of the rcpt mailproc.tab file

CODE

"mailbox"
"external"      "0"     "0"     "/mailsrv/MailRoot/bin/autoreply"       "message@domain.net"     "@@FROM"        "Automatic reply!"      "/mailsrv/MailRoot/domains/domain.net/rcpt/autoreply.txt"     "@@TMPFILE"


Please let me know if I have missed something because I really have no clue why the php script is ran twice.

Thanks

-fred


--------------------
You + webcam - clothes - dignity = $
PMEmail Poster
Top
hschneider
Posted: Dec 18 2007, 09:07 PM
Quote Post


No - I'm not an answering script ...
Group Icon

Group: Admin
Posts: 6631
Member No.: 195
Joined: 19-June 02



Never tested it, but maybe the "mailbox" command pushes the mail thru filters.in.tab again ... run a test without "mailbox".


--------------------
Bye,
Harald


-- Download XMail Queue Manager 1.46 NOW: XMail Server Tools
-- Cross platform remote queue management!
-- Message analyzing on the fly!
-- Builtin diagnostics knowledge base!
-- Manages multiple mail queues!

Sponsored by
CD-Produktion und DVD-Produktion and Homestaging Saarland - Immobilien schneller verkaufen in der Region Saarland, Rheinland-Pfalz und Luxembourg
PMEmail PosterUsers Website
Top
sc4vengr
Posted: Dec 18 2007, 09:31 PM
Quote Post


Professional
*****

Group: Members
Posts: 206
Member No.: 461
Joined: 12-February 03



I did the test and without the "mailbox" line within mailproc.tab it works correctly.

Is this a bug or it's working as intended? because without the mailbox line in the mailproc file the rcpt user mailbox becomes empty.

Thanks for your help Harald.


--------------------
You + webcam - clothes - dignity = $
PMEmail Poster
Top
hschneider
Posted: Dec 19 2007, 07:39 AM
Quote Post


No - I'm not an answering script ...
Group Icon

Group: Admin
Posts: 6631
Member No.: 195
Joined: 19-June 02



IMHO it's intended: filters.in.tab is defined as being triggered when a message is stored in a user's mailbox. It is stored first, then it runs thru mailproc.tab where it is stored another time with the "mailbox" command. So storing it triggers filters.in.tab again.

You can use "mailbox" anywhere in mailproc.tab, even behind your custom filter. Modify your filter to tag the message after processing. If it is seen again, the filter can pass it thru.


--------------------
Bye,
Harald


-- Download XMail Queue Manager 1.46 NOW: XMail Server Tools
-- Cross platform remote queue management!
-- Message analyzing on the fly!
-- Builtin diagnostics knowledge base!
-- Manages multiple mail queues!

Sponsored by
CD-Produktion und DVD-Produktion and Homestaging Saarland - Immobilien schneller verkaufen in der Region Saarland, Rheinland-Pfalz und Luxembourg
PMEmail PosterUsers Website
Top
Paddy78
Posted: Dec 19 2007, 10:08 AM
Quote Post


Member
***

Group: Members
Posts: 74
Member No.: 1373
Joined: 22-October 04



QUOTE (hschneider @ Dec 19 2007, 07:39 AM)
IMHO it's intended: filters.in.tab is defined as being triggered when a message is stored in a user's mailbox. It is stored first, then it runs thru mailproc.tab where it is stored another time with the "mailbox" command. So storing it triggers filters.in.tab again.

You can use "mailbox" anywhere in mailproc.tab, even behind your custom filter. Modify your filter to tag the message after processing. If it is seen again, the filter can pass it thru.

How is that done? With an own header line?
I suppose that behaviour with the mailbox-line and filters.in.tab could cause my problem with the spool-directory

http://xmailforum.homelinux.net/index.php?showtopic=4044

PMEmail Poster
Top
hschneider
Posted: Dec 19 2007, 02:09 PM
Quote Post


No - I'm not an answering script ...
Group Icon

Group: Admin
Posts: 6631
Member No.: 195
Joined: 19-June 02



Yes, add an additional X-Headerline, e.g.

X-AUTOREPLY_SENT: YES

I reported this already to Davide ... let's wait ... wink.gif


--------------------
Bye,
Harald


-- Download XMail Queue Manager 1.46 NOW: XMail Server Tools
-- Cross platform remote queue management!
-- Message analyzing on the fly!
-- Builtin diagnostics knowledge base!
-- Manages multiple mail queues!

Sponsored by
CD-Produktion und DVD-Produktion and Homestaging Saarland - Immobilien schneller verkaufen in der Region Saarland, Rheinland-Pfalz und Luxembourg
PMEmail PosterUsers Website
Top
sc4vengr
Posted: Dec 19 2007, 10:30 PM
Quote Post


Professional
*****

Group: Members
Posts: 206
Member No.: 461
Joined: 12-February 03



It works!

filter #1 xspampcd exit code 0
filter #2 clamav exit code 7 (added header)
filter #3 webmail exit code 7 (added header)
mailproc "mailbox"
filter #2 clamav exit code 0 (already scanned)
filter #3 webmail exit code 0 (already webmailed)
mailproc "autoreply"


Thanks for your help again.

fred


--------------------
You + webcam - clothes - dignity = $
PMEmail Poster
Top
hschneider
Posted: Dec 20 2007, 07:36 AM
Quote Post


No - I'm not an answering script ...
Group Icon

Group: Admin
Posts: 6631
Member No.: 195
Joined: 19-June 02



OK ... then have some nice X-Mas wink.gif


--------------------
Bye,
Harald


-- Download XMail Queue Manager 1.46 NOW: XMail Server Tools
-- Cross platform remote queue management!
-- Message analyzing on the fly!
-- Builtin diagnostics knowledge base!
-- Manages multiple mail queues!

Sponsored by
CD-Produktion und DVD-Produktion and Homestaging Saarland - Immobilien schneller verkaufen in der Region Saarland, Rheinland-Pfalz und Luxembourg
PMEmail PosterUsers Website
Top
sc4vengr
Posted: Dec 20 2007, 03:26 PM
Quote Post


Professional
*****

Group: Members
Posts: 206
Member No.: 461
Joined: 12-February 03



Thanks !!!!!! you too!! biggrin.gif


--------------------
You + webcam - clothes - dignity = $
PMEmail Poster
Top
0 User(s) are reading this topic (0 Guests and 0 Anonymous Users)
0 Members:
« Next Oldest | Documentation and Knowledge Base | Next Newest »

Reply to this topicStart new topicStart Poll