On 05/15/2013 07:06 PM, nik600 wrote:
dear all
i'm using a content_filter param in master.cf <http://master.cf> to
make some custom checks on mail content and recently also on mailbox
quota size.
In know that exists some patch to handle that (vda or others) but i
need to handler this feature without any impact to the
postfix-standard installation, so i've only added a check into my
script and all works correctly.
To make a test i've made a very simple filter script that refuses all
messages:
#!/bin/bash
EX_TEMPFAIL=75
EX_UNAVAILABLE=69
echo Mailbox is over size limit; exit $EX_UNAVAILABLE;
The message is correctly rejected and the original sender receives an
error reporting the reason:
Final-Recipient: rfc822; [email protected] <mailto:[email protected]>
Original-Recipient: rfc822; [email protected] <mailto:[email protected]>
Action: failed
Status: 5.3.0
Diagnostic-Code: x-unix; Mailbox is over size limit
I only want to change the error-code to 552 5.2.2 (this should be the
correct error code, wright?), is possible to do that?
Not from within a content_filter, no.
That merely reports success or failure back to the invoker (postfix),
which then sends the appropriate SMTP status code back to the client.
Postfix has (as yet) no "mapping" for $arbitrary_scenario ->
$smtp_statuscode.
You'd have to insert an SMTP pre-queue (or proxy) filter in the mail
chain to influence SMTP status codes:
http://www.postfix.org/FILTER_README.html
--
J.