Re: smtpd.conf and junk

2018-11-25 Thread Thuban
* Gilles Chehade  le [25-11-2018 15:30:20 +0100]:
> On Wed, Nov 21, 2018 at 09:21:46PM +0100, Thuban wrote:
> > * Gilles Chehade  le [21-11-2018 21:06:39 +0100]:
> > > On Wed, Nov 21, 2018 at 06:38:43PM +0100, Thuban wrote:
> > > > * Edgar Pettijohn  le [21-11-2018 11:32:43 
> > > > -0600]:
> > > > > 
> > > > > On Nov 21, 2018 8:22 AM, Thuban  wrote:
> > > > > >
> > > > > > Hi,
> > > > > > I can't figure how to make this "junk" argument to work as 
> > > > > > mentioned in The smtpd.conf manpages :
> > > > > >
> > > > > > If the junk argument is provided, the message will be
> > > > > > moved to the Junk folder if it contains a positive X-Spam
> > > > > > header.
> > > > > >
> > > > > >
> > > > > > spams detected by spamassassin have multiple X-Spam-* headers, but 
> > > > > > aren't placed
> > > > > > into Junk folder.
> > > > > >
> > > > > > Any advice ?
> > > > > >
> > > > > >
> > > > > >
> > > > > > -- 
> > > > > > ?? thuban
> > > > > >
> > > > > It looks for a header matching:
> > > > > 
> > > > > X-Spam: Yes
> > > > > 
> > > > > You may need to configure spamassassin to write it that way. I 
> > > > > believe that the default is different, but I can't check right now.
> > > > > 
> > > > 
> > > > I tried to add this in spamassassin.conf [0] :
> > > > 
> > > > add_header spam X-Spam
> > > > 
> > > > But if you read the link [0] closely, it can't work because 
> > > > spamassassin add
> > > > headers "X-Spam-someting", never "X-Spam" : 
> > > > 
> > > > All headers begin with X-Spam- (so a header_name Foo will 
> > > > generate a header called X-Spam-Foo)
> > > > 
> > > > I guess the "junk" keyword in smtpd.conf was written to be handy, so I 
> > > > miss
> > > > something. Where ?
> > > > 
> > > 
> > > You didn't miss anything, the maildir agent only supports X-Spam headers
> > > as of today so this will need a diff to support SpamAssassin if it can't
> > > generate a X-Spam header.
> > > 
> > 
> > Okay, thanks, I doubt since english is not my main language.
> > 
> > > SpamAssassin wasn't a target when I wrote that feature but it's just one
> > > diff away ;-)
> > > 
> > 
> > Just need to check "X-Spam-Flag: YES" or "X-Spam-Status: Yes,.*" then.
> > 
> > Just curious, what was the target of that 'junk' feature ? rspamd ? Another 
> > ?
> > 
> > Regards.
> > 
> 
> in -current, maildir junk now recognizes X-Spam-Flag: YES

Thank you, I'll give it a try.
For now, I  use dovecot + lmtp and sieve for this (a bit too much...)



Re: smtpd.conf and junk

2018-11-25 Thread Gilles Chehade
On Wed, Nov 21, 2018 at 09:21:46PM +0100, Thuban wrote:
> * Gilles Chehade  le [21-11-2018 21:06:39 +0100]:
> > On Wed, Nov 21, 2018 at 06:38:43PM +0100, Thuban wrote:
> > > * Edgar Pettijohn  le [21-11-2018 11:32:43 
> > > -0600]:
> > > > 
> > > > On Nov 21, 2018 8:22 AM, Thuban  wrote:
> > > > >
> > > > > Hi,
> > > > > I can't figure how to make this "junk" argument to work as 
> > > > > mentioned in The smtpd.conf manpages :
> > > > >
> > > > > If the junk argument is provided, the message will be
> > > > > moved to the Junk folder if it contains a positive X-Spam
> > > > > header.
> > > > >
> > > > >
> > > > > spams detected by spamassassin have multiple X-Spam-* headers, but 
> > > > > aren't placed
> > > > > into Junk folder.
> > > > >
> > > > > Any advice ?
> > > > >
> > > > >
> > > > >
> > > > > -- 
> > > > > ?? thuban
> > > > >
> > > > It looks for a header matching:
> > > > 
> > > > X-Spam: Yes
> > > > 
> > > > You may need to configure spamassassin to write it that way. I believe 
> > > > that the default is different, but I can't check right now.
> > > > 
> > > 
> > > I tried to add this in spamassassin.conf [0] :
> > > 
> > >   add_header spam X-Spam
> > > 
> > > But if you read the link [0] closely, it can't work because spamassassin 
> > > add
> > > headers "X-Spam-someting", never "X-Spam" : 
> > > 
> > >   All headers begin with X-Spam- (so a header_name Foo will generate a 
> > > header called X-Spam-Foo)
> > > 
> > > I guess the "junk" keyword in smtpd.conf was written to be handy, so I 
> > > miss
> > > something. Where ?
> > > 
> > 
> > You didn't miss anything, the maildir agent only supports X-Spam headers
> > as of today so this will need a diff to support SpamAssassin if it can't
> > generate a X-Spam header.
> > 
> 
> Okay, thanks, I doubt since english is not my main language.
> 
> > SpamAssassin wasn't a target when I wrote that feature but it's just one
> > diff away ;-)
> > 
> 
> Just need to check "X-Spam-Flag: YES" or "X-Spam-Status: Yes,.*" then.
> 
> Just curious, what was the target of that 'junk' feature ? rspamd ? Another ?
> 
> Regards.
> 

in -current, maildir junk now recognizes X-Spam-Flag: YES

cheers,

-- 
Gilles Chehade @poolpOrg

https://www.poolp.org tip me: https://paypal.me/poolpOrg



Re: smtpd.conf and junk

2018-11-21 Thread Gilles Chehade
On Wed, Nov 21, 2018 at 09:21:46PM +0100, Thuban wrote:
> * Gilles Chehade  le [21-11-2018 21:06:39 +0100]:
> > On Wed, Nov 21, 2018 at 06:38:43PM +0100, Thuban wrote:
> > > * Edgar Pettijohn  le [21-11-2018 11:32:43 
> > > -0600]:
> > > > 
> > > > On Nov 21, 2018 8:22 AM, Thuban  wrote:
> > > > >
> > > > > Hi,
> > > > > I can't figure how to make this "junk" argument to work as 
> > > > > mentioned in The smtpd.conf manpages :
> > > > >
> > > > > If the junk argument is provided, the message will be
> > > > > moved to the Junk folder if it contains a positive X-Spam
> > > > > header.
> > > > >
> > > > >
> > > > > spams detected by spamassassin have multiple X-Spam-* headers, but 
> > > > > aren't placed
> > > > > into Junk folder.
> > > > >
> > > > > Any advice ?
> > > > >
> > > > >
> > > > >
> > > > > -- 
> > > > > ?? thuban
> > > > >
> > > > It looks for a header matching:
> > > > 
> > > > X-Spam: Yes
> > > > 
> > > > You may need to configure spamassassin to write it that way. I believe 
> > > > that the default is different, but I can't check right now.
> > > > 
> > > 
> > > I tried to add this in spamassassin.conf [0] :
> > > 
> > >   add_header spam X-Spam
> > > 
> > > But if you read the link [0] closely, it can't work because spamassassin 
> > > add
> > > headers "X-Spam-someting", never "X-Spam" : 
> > > 
> > >   All headers begin with X-Spam- (so a header_name Foo will generate a 
> > > header called X-Spam-Foo)
> > > 
> > > I guess the "junk" keyword in smtpd.conf was written to be handy, so I 
> > > miss
> > > something. Where ?
> > > 
> > 
> > You didn't miss anything, the maildir agent only supports X-Spam headers
> > as of today so this will need a diff to support SpamAssassin if it can't
> > generate a X-Spam header.
> > 
> 
> Okay, thanks, I doubt since english is not my main language.
> 
> > SpamAssassin wasn't a target when I wrote that feature but it's just one
> > diff away ;-)
> > 
> 
> Just need to check "X-Spam-Flag: YES" or "X-Spam-Status: Yes,.*" then.
> 

indeed, I think X-Spam-Flag is the right candidate.


> Just curious, what was the target of that 'junk' feature ? rspamd ? Another ?
> 

rspamd was my target yes

-- 
Gilles Chehade @poolpOrg

https://www.poolp.org tip me: https://paypal.me/poolpOrg



Re: smtpd.conf and junk

2018-11-21 Thread Thuban
* Gilles Chehade  le [21-11-2018 21:06:39 +0100]:
> On Wed, Nov 21, 2018 at 06:38:43PM +0100, Thuban wrote:
> > * Edgar Pettijohn  le [21-11-2018 11:32:43 -0600]:
> > > 
> > > On Nov 21, 2018 8:22 AM, Thuban  wrote:
> > > >
> > > > Hi,
> > > > I can't figure how to make this "junk" argument to work as 
> > > > mentioned in The smtpd.conf manpages :
> > > >
> > > > If the junk argument is provided, the message will be
> > > > moved to the Junk folder if it contains a positive X-Spam
> > > > header.
> > > >
> > > >
> > > > spams detected by spamassassin have multiple X-Spam-* headers, but 
> > > > aren't placed
> > > > into Junk folder.
> > > >
> > > > Any advice ?
> > > >
> > > >
> > > >
> > > > -- 
> > > > ?? thuban
> > > >
> > > It looks for a header matching:
> > > 
> > > X-Spam: Yes
> > > 
> > > You may need to configure spamassassin to write it that way. I believe 
> > > that the default is different, but I can't check right now.
> > > 
> > 
> > I tried to add this in spamassassin.conf [0] :
> > 
> > add_header spam X-Spam
> > 
> > But if you read the link [0] closely, it can't work because spamassassin add
> > headers "X-Spam-someting", never "X-Spam" : 
> > 
> > All headers begin with X-Spam- (so a header_name Foo will generate a 
> > header called X-Spam-Foo)
> > 
> > I guess the "junk" keyword in smtpd.conf was written to be handy, so I miss
> > something. Where ?
> > 
> 
> You didn't miss anything, the maildir agent only supports X-Spam headers
> as of today so this will need a diff to support SpamAssassin if it can't
> generate a X-Spam header.
> 

Okay, thanks, I doubt since english is not my main language.

> SpamAssassin wasn't a target when I wrote that feature but it's just one
> diff away ;-)
> 

Just need to check "X-Spam-Flag: YES" or "X-Spam-Status: Yes,.*" then.

Just curious, what was the target of that 'junk' feature ? rspamd ? Another ?

Regards.

-- 
thuban



Re: smtpd.conf and junk

2018-11-21 Thread Gilles Chehade
On Wed, Nov 21, 2018 at 06:38:43PM +0100, Thuban wrote:
> * Edgar Pettijohn  le [21-11-2018 11:32:43 -0600]:
> > 
> > On Nov 21, 2018 8:22 AM, Thuban  wrote:
> > >
> > > Hi,
> > > I can't figure how to make this "junk" argument to work as 
> > > mentioned in The smtpd.conf manpages :
> > >
> > > If the junk argument is provided, the message will be
> > > moved to the Junk folder if it contains a positive X-Spam
> > > header.
> > >
> > >
> > > spams detected by spamassassin have multiple X-Spam-* headers, but aren't 
> > > placed
> > > into Junk folder.
> > >
> > > Any advice ?
> > >
> > >
> > >
> > > -- 
> > > ?? thuban
> > >
> > It looks for a header matching:
> > 
> > X-Spam: Yes
> > 
> > You may need to configure spamassassin to write it that way. I believe that 
> > the default is different, but I can't check right now.
> > 
> 
> I tried to add this in spamassassin.conf [0] :
> 
>   add_header spam X-Spam
> 
> But if you read the link [0] closely, it can't work because spamassassin add
> headers "X-Spam-someting", never "X-Spam" : 
> 
>   All headers begin with X-Spam- (so a header_name Foo will generate a 
> header called X-Spam-Foo)
> 
> I guess the "junk" keyword in smtpd.conf was written to be handy, so I miss
> something. Where ?
> 

You didn't miss anything, the maildir agent only supports X-Spam headers
as of today so this will need a diff to support SpamAssassin if it can't
generate a X-Spam header.

SpamAssassin wasn't a target when I wrote that feature but it's just one
diff away ;-)

-- 
Gilles Chehade @poolpOrg

https://www.poolp.org tip me: https://paypal.me/poolpOrg



Re: smtpd.conf and junk

2018-11-21 Thread Thuban
* Edgar Pettijohn  le [21-11-2018 11:32:43 -0600]:
> 
> On Nov 21, 2018 8:22 AM, Thuban  wrote:
> >
> > Hi,
> > I can't figure how to make this "junk" argument to work as 
> > mentioned in The smtpd.conf manpages :
> >
> > If the junk argument is provided, the message will be
> > moved to the Junk folder if it contains a positive X-Spam
> > header.
> >
> >
> > spams detected by spamassassin have multiple X-Spam-* headers, but aren't 
> > placed
> > into Junk folder.
> >
> > Any advice ?
> >
> >
> >
> > -- 
> >     thuban
> >
> It looks for a header matching:
> 
> X-Spam: Yes
> 
> You may need to configure spamassassin to write it that way. I believe that 
> the default is different, but I can't check right now.
> 

I tried to add this in spamassassin.conf [0] :

add_header spam X-Spam

But if you read the link [0] closely, it can't work because spamassassin add
headers "X-Spam-someting", never "X-Spam" : 

All headers begin with X-Spam- (so a header_name Foo will generate a 
header called X-Spam-Foo)

I guess the "junk" keyword in smtpd.conf was written to be handy, so I miss
something. Where ?

Regards.

[0] 
https://spamassassin.apache.org/full/3.1.x/doc/Mail_SpamAssassin_Conf.html#basic_message_tagging_options




Re: smtpd.conf and junk

2018-11-21 Thread Edgar Pettijohn


On Nov 21, 2018 8:22 AM, Thuban  wrote:
>
> Hi,
> I can't figure how to make this "junk" argument to work as 
> mentioned in The smtpd.conf manpages :
>
> If the junk argument is provided, the message will be
> moved to the Junk folder if it contains a positive X-Spam
> header.
>
>
> spams detected by spamassassin have multiple X-Spam-* headers, but aren't 
> placed
> into Junk folder.
>
> Any advice ?
>
>
>
> -- 
>     thuban
>
It looks for a header matching:

X-Spam: Yes

You may need to configure spamassassin to write it that way. I believe that the 
default is different, but I can't check right now.



Re: smtpd.conf and junk

2018-11-21 Thread Thuban
* Gilles Chehade  le [21-11-2018 16:31:31 +0100]:
> On Wed, Nov 21, 2018 at 03:22:45PM +0100, Thuban wrote:
> > Hi,
> > I can't figure how to make this "junk" argument to work as 
> > mentioned in The smtpd.conf manpages :
> > 
> > If the junk argument is provided, the message will be
> > moved to the Junk folder if it contains a positive X-Spam
> > header.
> > 
> > 
> > spams detected by spamassassin have multiple X-Spam-* headers, but aren't 
> > placed
> > into Junk folder.
> > 
> > Any advice ?
> > 
> 
> without seeing examples of these headers and your config, it's hard to
> understand what's incorrect ;-)
> 

Sorry, I thought this was quite common.

A spam has these headers when detected by spamassassin : 

X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on
ledzep.yeuxdelibad.net
X-Spam-Flag: YES
X-Spam-Level: ***
X-Spam-Status: Yes, score=19.0 required=5.0 tests=BAYES_99,BAYES_999,


Here is my smtpd.conf, incoming mails are analysed by spamassassin
(dafault configuration).

table aliases file:/etc/mail/aliases
table domains file:/etc/mail/domains
table passwd passwd:/etc/mail/passwd
table virtuals file:/etc/mail/virtuals

pki acmecert key "/etc/ssl/acme/private/yeuxdelibad.net.key"
pki acmecert cert "/etc/ssl/acme/yeuxdelibad.net-fullchain.pem"

## LISTEN ##
# envelopes signed by dkimproxy
listen on lo0 port 10028 tag DKIM
# envelopes checked by spamassassin
listen on lo0 port 10026 tag NOSPAM
# local
listen on lo0
# incoming
listen on egress tls pki acmecert tag INCOMING
# sending
listen on egress port submission tls-require pki acmecert auth  
tag OUTGOING

## ACTIONS ##
action "relay" relay
action dkimproxy relay host smtp://127.0.0.1:10027
action spamassassin relay host smtp://127.0.0.1:10025

action "local_mbox" mbox alias 
action virtual_maildir maildir 
"/var/_vmail/%{dest.domain}/%{dest.user}/Maildir" junk virtual 

## MATCH ##
match for local action local_mbox

match tag NOSPAM from any for domain  action virtual_maildir
match from any for domain  action spamassassin

match tag DKIM for any action "relay"
match auth tag DKIM from any for any action "relay"

match auth from any for any action dkimproxy
match for any action dkimproxy



Re: smtpd.conf and junk

2018-11-21 Thread Gilles Chehade
On Wed, Nov 21, 2018 at 03:22:45PM +0100, Thuban wrote:
> Hi,
> I can't figure how to make this "junk" argument to work as 
> mentioned in The smtpd.conf manpages :
> 
>   If the junk argument is provided, the message will be
>   moved to the Junk folder if it contains a positive X-Spam
>   header.
> 
> 
> spams detected by spamassassin have multiple X-Spam-* headers, but aren't 
> placed
> into Junk folder.
> 
> Any advice ?
> 

without seeing examples of these headers and your config, it's hard to
understand what's incorrect ;-)

-- 
Gilles Chehade @poolpOrg

https://www.poolp.org tip me: https://paypal.me/poolpOrg



smtpd.conf and junk

2018-11-21 Thread Thuban
Hi,
I can't figure how to make this "junk" argument to work as 
mentioned in The smtpd.conf manpages :

If the junk argument is provided, the message will be
moved to the Junk folder if it contains a positive X-Spam
header.


spams detected by spamassassin have multiple X-Spam-* headers, but aren't placed
into Junk folder.

Any advice ?



-- 
thuban