From: nik600 on
On Mon, Jan 4, 2010 at 11:26 PM, mouss <mouss(a)ml.netoyen.net> wrote:
> nik600 a écrit :
>> On Mon, Jan 4, 2010 at 12:52 PM, nik600 <nik600(a)gmail.com> wrote:
>>> Dear all
>>>
>>> i've installed a postfix server with mysql support.
>>>
>>> i've also set-up a custom filter script shell that calls spamc and
>>> some other custom utils, this script cannot handle multiple
>>> recipients, so i've set
>>>
>>> filter_destination_recipient_limit = 1
>>>
>>> The problem that i've experienced is that when i've got an entry like
>>> this in the alias table:
>>>
>>
>> I've also tried to change master.cf like:
>>
>> smtp      inet  n       -       n       -       -       smtpd
>>         -o content_filter=filter:dummy
>>        -o receive_override_options=no_address_mappings
>> 9009      inet  n       -       n       -       -       smtpd
>>         -o content_filter=filter:dummy
>>        -o receive_override_options=no_address_mappings
>>
>> This fix the problem for the forward, but stops to apply custom spam
>> settings, infact in that case the filter is called only for
>> forwarded(a)foo.com and obviosly it doesn't load any custom spam option
>> of
>>
>> info(a)foo.com
>> foo(a)yahoo.it
>> foo2(a)libero.it
>>
>> Is it possible to avoid that?
>>
>
> if you want your filter to see rewritten addresses, remove the
> no_address_mappins option from before-the-filter smtpd listeners and put
> it in the after-the-filter smtpd listener(s).
>
>
>
Sorry I've read the documentation at
http://www.postfix.org/FILTER_README.html but i can't figure it out.
In my configuration i'm using the "Simple content filter"
configuration, wich call an external script that - at the end of the
filter - send the mail using the sendmail command.

I don't have any smptd listener after the filter, or have i to create one?

You mean that my master.cf must be changed like this?


smtp inet n - n - - smtpd
-o content_filter=filter:dummy
filter unix - n n - 20 pipe
flags=Rq user=filter
argv=/var/programmi/script/filtra_spamc_1.6 -f ${sender} --
${recipient} ${sasl_username}
smtp inet n - n - - smtpd
-o content_filter=filter:dummy
-o receive_override_options=no_address_mappings


Thanks

--
/*************/
nik600
http://www.kumbe.it

From: mouss on
nik600 a �crit :
> On Mon, Jan 4, 2010 at 11:26 PM, mouss <mouss(a)ml.netoyen.net> wrote:
>> nik600 a �crit :
>>> On Mon, Jan 4, 2010 at 12:52 PM, nik600 <nik600(a)gmail.com> wrote:
>>>> Dear all
>>>>
>>>> i've installed a postfix server with mysql support.
>>>>
>>>> i've also set-up a custom filter script shell that calls spamc and
>>>> some other custom utils, this script cannot handle multiple
>>>> recipients, so i've set
>>>>
>>>> filter_destination_recipient_limit = 1
>>>>
>>>> The problem that i've experienced is that when i've got an entry like
>>>> this in the alias table:
>>>>
>>> I've also tried to change master.cf like:
>>>
>>> smtp inet n - n - - smtpd
>>> -o content_filter=filter:dummy
>>> -o receive_override_options=no_address_mappings
>>> 9009 inet n - n - - smtpd
>>> -o content_filter=filter:dummy
>>> -o receive_override_options=no_address_mappings
>>>
>>> This fix the problem for the forward, but stops to apply custom spam
>>> settings, infact in that case the filter is called only for
>>> forwarded(a)foo.com and obviosly it doesn't load any custom spam option
>>> of
>>>
>>> info(a)foo.com
>>> foo(a)yahoo.it
>>> foo2(a)libero.it
>>>
>>> Is it possible to avoid that?
>>>
>> if you want your filter to see rewritten addresses, remove the
>> no_address_mappins option from before-the-filter smtpd listeners and put
>> it in the after-the-filter smtpd listener(s).
>>
>>
>>
> Sorry I've read the documentation at
> http://www.postfix.org/FILTER_README.html but i can't figure it out.
> In my configuration i'm using the "Simple content filter"
> configuration, wich call an external script that - at the end of the
> filter - send the mail using the sendmail command.
>

Then forget about what I said.

you could do
pickup ....
-o receive_override_options=no_address_mappings
but this applies to all mail submitted via the sendmail command, so it
will break mail sent from the system (cron, ...) or from the console.

consider using an smtp content filter instead. if all you want is to use
spamassassin, then consider using amavisd-new or a milter.


> I don't have any smptd listener after the filter, or have i to create one?
>
> You mean that my master.cf must be changed like this?
>
>
> smtp inet n - n - - smtpd
> -o content_filter=filter:dummy
> filter unix - n n - 20 pipe
> flags=Rq user=filter
> argv=/var/programmi/script/filtra_spamc_1.6 -f ${sender} --
> ${recipient} ${sasl_username}
> smtp inet n - n - - smtpd
> -o content_filter=filter:dummy
> -o receive_override_options=no_address_mappings
>
>

No, you can't have two listeners listening on the same IP:port.

> Thanks
>

From: nik600 on
>
> Then forget about what I said.
>
> you could do
> pickup ....
>        -o receive_override_options=no_address_mappings
> but this applies to all mail submitted via the sendmail command, so it
> will break mail sent from the system (cron, ...) or from the console.
>
> consider using an smtp content filter instead. if all you want is to use
> spamassassin, then consider using amavisd-new or a milter.
>
>

Great!

i've tested the pickup option and now is working properly, thanks for your help.

Unfortunately i'm not using only spamassassin but also a set of custom
script and programs, now i'm planning some implementatio to move on a
custom smtp content filter but in the short time this is enough.

Thanks

--
/*************/
nik600
http://www.kumbe.it