|Printable Version of Topic
Click here to view this topic in its original format
|XMail Forum > Documentation and Knowledge Base > Filters.in.tab Ran Twice?|
|Posted by: sc4vengr Dec 18 2007, 07:34 PM|
| Hey guys,
I have a question regarding the execution of a filter that I have inside filters.in.tab.
I have 3 filters installed:
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:
Content of filters.in.tab
Content of filters.out.tab (empty)
Content of filters.post-data.tab
Content of the rcpt mailproc.tab file
Please let me know if I have missed something because I really have no clue why the php script is ran twice.
|Posted by: hschneider Dec 18 2007, 09:07 PM|
|Never tested it, but maybe the "mailbox" command pushes the mail thru filters.in.tab again ... run a test without "mailbox".|
|Posted by: sc4vengr Dec 18 2007, 09:31 PM|
| 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.
|Posted by: 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.
|Posted by: Paddy78 Dec 19 2007, 10:08 AM|
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
|Posted by: hschneider Dec 19 2007, 02:09 PM|
| Yes, add an additional X-Headerline, e.g.
I reported this already to Davide ... let's wait ...
|Posted by: sc4vengr Dec 19 2007, 10:30 PM|
| It works!
filter #1 xspampcd exit code 0
filter #2 clamav exit code 7 (added header)
filter #3 webmail exit code 7 (added header)
filter #2 clamav exit code 0 (already scanned)
filter #3 webmail exit code 0 (already webmailed)
Thanks for your help again.
|Posted by: hschneider Dec 20 2007, 07:36 AM|
|OK ... then have some nice X-Mas|
|Posted by: sc4vengr Dec 20 2007, 03:26 PM|
|Thanks !!!!!! you too!!|