XMailforum is a readonly knowledge archive now.

Registering as a new user or answering posts is not possible anymore.

Might the force be with you, to find here what you are looking for.

2019-09-20 - hschneider, Admin

Cookie Disclaimer: This forum uses only essential, anonymous session cookies (xmailforum*), nothing to be scared of.

XMail Forum -> Script Return Codes

Reply to this topicStart new topicStart Poll

> Script Return Codes, Return code for modified messages
BizOdd
Posted: Aug 15 2006, 10:09 PM
Quote Post


Member
***

Group: Members
Posts: 58
Member No.: 1386
Joined: 1-November 04



Hi
I wrote my own spamassassin script in PHP,
and set the return code to 5 if the message is spam,
this seemed to work, until i checked the Frozen queues and noticed
all the spam hanging out in there.

Can someone guide me on the return codes? the Docs are a bit confusing:
QUOTE

If this filters returns '4, 5 or 6' the message is rejected and is stopped in its travel. If the filter modifies the message it must return '7'.

Additional flags are allowed to be returned to XMail as a result of filter processing by adding the flags value to the exits code above listed. The currently defined flags are :

'16'
    Stop selected filter list processing.

Filter flags are additive and if more than one flag need to be specified, their values must be added together. If a filter ``raw'' exit code is RC and the filter needs to return extra flags FILTER-SUM, the final return code FRC must be :

FRC = RC + FILTER-SUM

Example. Suppose a filter modified the message and hence needs to return 7 as return code. Suppose also that a filter wants to block the filter selection list processing by specifying a flags value of 16, the value to be returned will be :

FRC = 7 + 16 = 23



if I modify the message it says I must return 7, but what if I want to reject
the message without freezing it, would the return code be 4 or 11 ?

What do return codes 1 - 3 do ? anything?

-BizOdd
PMEmail Poster
Top
hschneider
Posted: Aug 15 2006, 10:42 PM
Quote Post


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

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



>reject the message without freezing it, would the return code be 4 or 11 ?
This requires code 4, because rejecting is not a modification. The file is not saved and picked up by the queue scheduler again. It is just thrown away.

>What do return codes 1 - 3 do ? anything?
Only 0,4,5,6,7 and 16 are currently relevant. You should not return 1,2 or 3 because they might become relevant in future.



--------------------
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
BizOdd
Posted: Aug 15 2006, 11:44 PM
Quote Post


Member
***

Group: Members
Posts: 58
Member No.: 1386
Joined: 1-November 04



Thanks Harald, 4 seems to have done the trick.

FYI: the file was infact modified by spamassassin but i guess thats irrelevant
if it just deletes it.

Do you happen to have a list of what the relevant return codes do?

this is what ive worked out from the manual:
0 = ?
4 = reject and do not freeze
5 = reject but freeze
6 = reject (?)
7 = file was modified,deliver it.
16 = Stop filtering this email.

and, if i understand the manual, your supposed to combine return codes
but i dont see when that might apply.

thanks for your insight
-BizOdd
PMEmail Poster
Top
hschneider
Posted: Aug 16 2006, 06:14 AM
Quote Post


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

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



>FYI: the file was infact modified by spamassassin but i guess thats irrelevant if it just deletes it.
Exactly!

Returncodes:
0 = Let the message pass the filter unmodified
4 = Reject and do not freeze
5 = Reject and freeze
6 = Reject and freeze with sender notification
7 = Deliver the modified file

Additional Filter Flags:
16 = Stop all other filters after this one.

It only makes sense to add 16 to other return codes in order to signal that other filters should be stopped after this one has finished. That's why they are called filter flags in the manual. Currently there is only one single flag defined.

Keep in mind that code 0 or 7 submit the file to the next filter if not stopped by setting the stop flag (+16).


--------------------
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
0 User(s) are reading this topic (0 Guests and 0 Anonymous Users)
0 Members:
« Next Oldest | Scripting Corner | Next Newest »

Reply to this topicStart new topicStart Poll