Jevos, Peter a écrit :
>> -----Original Message-----
>> From: mouss [mailto:[EMAIL PROTECTED]
>> Sent: Thursday, October 23, 2008 3:01 PM
>> To: Jevos, Peter
>> Cc: Postfix users
>> Subject: Re: Postfix - altermime - amavis - Too many hops
>>
>> Jevos, Peter a écrit :
>>> Dear all
>>>
>>> I'd like to ask you a question.
>>>
>>> In my master.cf is:
>>>
>>> [snip]
>>> ##disclaimer
>>> disclaimer     unix    -       n       n       -       -       pipe
>>>     flags=Rq user=altermime argv=/etc/postfix/filter/disclaimer -f
>>> ${sender} -- ${recipient}
>>>
>>>
>>> It leads to error: Too many hops , in the log there is loop.
>> so your filter is passing mail back to an smtpd that passes it to the
>> same filter, and so on.
>>
>> if your filter resubmits mail via the sendmail command and if you don't
>> want to filter mail submitted via the sendmail command, then add
>>
>>      -o content_filter=
>>
>> to the pickup service (in master.cf).
>>
>>
>>
>>> [snip]
>>>
>>> So the question is where can I put the content_filter=disclaimer: to
>>> work only for outgoing emails , into which smtpd process?
>>>
>> you can use the FILTER statement in smtpd restrictions.
>>
> Thank you for your answer.  When I added o content_filter= into the pickup 
> line it works. No more loops.
> 
> But still I'm recieving the disclaimer also for incoming mail, which is clear 
> cause filter is located in the amavis filter:
> ...
> 127.0.0.1:10025 inet n  -       n     -       -  smtpd
>             -o content_filter=disclaimer:
>             -o local_recipient_maps=
> 
> ....
> 
> So I have to take it away and put somewhere else.
> Can you please describe more FILTER statement or better put some example for 
> me ?



smtpd_sender_restrictions =
        check_client_access pcre:/etc/postfix/filter_outbound
        permit_mynetworks
        permit_sasl_authenticated
        check_client_access pcre:/etc/postfix/filter_inbound

== filter_outbound
# filter for outbound mail
/./     FILTER yourfilter:[127.0.0.1]:10587

= filter_inbound
# filter for inbound mail
/./     FILTER yourfilter:[127.0.0.1]:10030


of course, you can't do this after amavisd-new, since at this time you
don't know if mail is inbound or outbound.

you need to think your mail path carefully.

Reply via email to