Roman Medina-Heigl Hernandez a écrit :
> The (real) problem is the following: my Amavis/Spamasssin setup analyzes
> mail and adds X-Spam-* headers accordingly but it does NOT block/drop any
> mail. Filtering is done at the MDA level via sieve, which analyzes headers
> and decides what to do with certain mails based on those headers (the
> advantage is that the user has the last choice, so he/she can decide
> whether the spam threshold would be, etc).
> 

that's how I do it. all mail is delivered except:
- if rejected at postfix level
- if blocked because of a virus check (even this I used to deliver to a
specific folder. but I stopped it...).

dest folder depends on rules implemented in dovecot sieve. default for
spam is the "Junk" folder.

> Now, I need my MTA to perform additional functionality: to act as relay for
> CERTAIN domains (keeping, of course, the *other* domains which my server
> owns mailboxes for). I do NOT control the final delivery for these "relayed
> domains" (I do NOT own final MTA with mailboxes), so I'd like to make some
> blocking based on headers but ONLY for my relayed domains.
> 
> Postfix supports filtering based on headers but all mail (relayed and not
> relayed) would be filtered in this case (which is not what I want), I don't
> know how could I add the "conditional" behaviour: "if mail destination is
> one of my relayed domains, check headers and drop spam mail; if not, don't
> check headers". I think Postfix supports the concept of "classes", but I
> never used them and I don't know if what I need could be done with that
> feature.
> 

you need to pass relayed mail via a specific smtp which has its own
cleanup, in which case you can associate specific header_checks.

The difficulty in your case is that transport_maps are common to all
smtpd listeners. so you can't do it with just "ok, move'em first to this
smtp, then relay after that".

you could use FILTER as an access check result, but you'll have a
problem for multi-recipient mail (only one filter is used however is the
number of recipients).

now, things may be easier if yoy tell us more about your setup. which
content filter do you use? do you use amavisd-new? (with amavisd-new,
you have more flexibility). also, what exactly do you want to do with
header_checks. maybe it's ok to apply them to all inbound mail?

> Hope it is clear now, and sorry for the long email. You're making a great
> work here in this list, mouss. Thank you in advance.

thanks for the compliment. but most of all, thanks to the great guys
here with whom I learned...

Reply via email to