spam check only local destinations

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

spam check only local destinations

Georgy Goshin
Hi,

I'm checking mail with spamassassin with this conf:

smtp      inet  n       -       n       -       -       smtpd
  -o content_filter=spamfilter:dummy


How to check only local destination?


Thanks,
G.
Reply | Threaded
Open this post in threaded view
|

Re: spam check only local destinations

mouss-4
Georgy Goshin a écrit :
> Hi,
>
> I'm checking mail with spamassassin with this conf:
>
> smtp      inet  n       -       n       -       -       smtpd
>  -o content_filter=spamfilter:dummy
>

consider using amavisd-new instead of a wrapper.

>
> How to check only local destination?
>

what do you really mean?

if you only want to filter "inbound mail", you can exclude mynetworks
and sasl authenticated mail from filtering. or do you want somlething else?

Reply | Threaded
Open this post in threaded view
|

Re: spam check only local destinations

Georgy Goshin


>
> what do you really mean?
>

I really mean that the server is a relay for some domains and a local
mailserver for one domain, so I need to check mails with spamassassin only
mails that came here and not to check relayed mails.


Thanks,
G

Reply | Threaded
Open this post in threaded view
|

Re: spam check only local destinations

mouss-4
Georgy Goshin a écrit :

>
>
>>
>> what do you really mean?
>>
>
> I really mean that the server is a relay for some domains and a local
> mailserver for one domain, so I need to check mails with spamassassin
> only mails that came here and not to check relayed mails.
>

so you want per recipient filtering. the problem here is when mail comes
in for multiple recipients.

1- if it's ok to filter mail if one of the recipient is local
(eventhough other recipients may belong to other domains), you can use
check_recipient_access:

content_filter =

smtpd_sender_restrictions =
        check_recipient_access hash:/etc/postfix/filter

== filter:
example.com FILTER spamfilter:nexthop

2- otherwise, you need multiple postfix instance (run postfix twice) and
use transport_maps instead of content_filter.

In (1), a multi-recipient message is not split into local and relay
copies. it's passed to the filter as soon as one of the recipients is
local (is *@example.com).

In (2), the message is split: one copy is sent to "local" users after
filtering. another copy is relayed without filtering.

Reply | Threaded
Open this post in threaded view
|

Re: spam check only local destinations

Georgy Goshin
I just thoght that there is a way to pass message to filter right before
passing it to mailbox_command, deliver in my case.

D.

> 1- if it's ok to filter mail if one of the recipient is local
> (eventhough other recipients may belong to other domains), you can use
> check_recipient_access:
>
> content_filter =
>
> smtpd_sender_restrictions =
> check_recipient_access hash:/etc/postfix/filter
>
> == filter:
> example.com FILTER spamfilter:nexthop
>
> 2- otherwise, you need multiple postfix instance (run postfix twice) and
> use transport_maps instead of content_filter.
>
> In (1), a multi-recipient message is not split into local and relay
> copies. it's passed to the filter as soon as one of the recipients is
> local (is *@example.com).
>
> In (2), the message is split: one copy is sent to "local" users after
> filtering. another copy is relayed without filtering.
>
>