Re: filter question

2020-03-09 Thread Edgar Pettijohn

On Mar 9, 2020 1:34 AM, Martijn van Duren  wrote:
>
> On 3/6/20 5:00 PM, epektasis wrote:
> > Greetings.  I have my own blacklist file of email addresses
> > (some in the format microcen...@microcenter.com and some in 
> > the format *@squaredeals.com), one per line.  I would like to
> > filter each incoming email so that a mail-from address
> > that matches any line in the blacklist file will go to a
> > junk file.  In the smtpd.conf I have tried
> > 
> > table blksender file:/etc/blksender
> > filter mail-from  junk
> > match filter mail-from  junk
> > 
> > but get syntax errors on both of the last two lines when
> > checking the configuration.  There's something I'm not
> > understanding and am asking for advice.
> > epektasis
> > 
> Have another look at the manpage:
>  filter filter-name phase phase-name match conditions decision
>  Register a filter filter-name.  A decision about what to do
>  with the mail is taken at phase phase-name when matching
>  conditions.  Phases, matching conditions, and decisions are
>  described in MAIL FILTERING, below.
>
> So without testing (you should do that yourself anyway) I think what you
> want would be:
>
> table blksender file:/etc/blksender
> filter blksender phase mail-from match mail-from  junk
> listen on   filter blksender
>

Also look at table(5) '*' is only allowed on the domain side of the '@'.

Edgar

Re: filter question

2020-03-09 Thread Martijn van Duren
On 3/6/20 5:00 PM, epektasis wrote:
> Greetings.  I have my own blacklist file of email addresses
> (some in the format microcen...@microcenter.com and some in 
> the format *@squaredeals.com), one per line.  I would like to
> filter each incoming email so that a mail-from address
> that matches any line in the blacklist file will go to a
> junk file.  In the smtpd.conf I have tried
> 
> table blksender file:/etc/blksender
> filter mail-from  junk
> match filter mail-from  junk
> 
> but get syntax errors on both of the last two lines when
> checking the configuration.  There's something I'm not
> understanding and am asking for advice.
>   epektasis
> 
Have another look at the manpage:
 filter filter-name phase phase-name match conditions decision
 Register a filter filter-name.  A decision about what to do
 with the mail is taken at phase phase-name when matching
 conditions.  Phases, matching conditions, and decisions are
 described in MAIL FILTERING, below.

So without testing (you should do that yourself anyway) I think what you
want would be:

table blksender file:/etc/blksender
filter blksender phase mail-from match mail-from  junk
listen on   filter blksender



filter question

2020-03-06 Thread epektasis
Greetings.  I have my own blacklist file of email addresses
(some in the format microcen...@microcenter.com and some in 
the format *@squaredeals.com), one per line.  I would like to
filter each incoming email so that a mail-from address
that matches any line in the blacklist file will go to a
junk file.  In the smtpd.conf I have tried

table blksender file:/etc/blksender
filter mail-from  junk
match filter mail-from  junk

but get syntax errors on both of the last two lines when
checking the configuration.  There's something I'm not
understanding and am asking for advice.
epektasis

--