New: mail/opensmtpd-filter-rspamd

classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

New: mail/opensmtpd-filter-rspamd

Gilles Chehade-7
Hello ports,

Attached is a new port, mail/opensmtpd-filter-rspamd

It is a mail filter for opensmtpd (-current and upcoming 6.6.x) which allows it to work with mail/rspamd.

It supports greylisting, rewriting subject, adding headers, rejecting as well as DKIM-signing messages.


$ cat DESCR
filter-rspamd is an opensmtpd filter that passes mail through
rspamd to flag or reject spam messages at session time.
$


This is my very very first port so let me know if I did something wrong.
Thanks to landry@ and semarie@ for providing feedback already and patrick@ for having tested this filter ;-)

opensmtpd-filter-rspamd.tar.gz (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: New: mail/opensmtpd-filter-rspamd

Klemens Nanni-2
On Mon, Aug 12, 2019 at 11:37:48PM +0000, Gilles Chehade wrote:
> This is my very very first port so let me know if I did something wrong.
Looks OK to me;  haven't run tested it yet, though.

Since DESCR is quite short and there is no README, do you plan writing
a manual page for it or can everything needed to set this up be found in
existing smtpd documentation?

Reply | Threaded
Open this post in threaded view
|

Re: New: mail/opensmtpd-filter-rspamd

Gilles Chehade-7
13 août 2019 09:36 "Klemens Nanni" <[hidden email]> a écrit:

> On Mon, Aug 12, 2019 at 11:37:48PM +0000, Gilles Chehade wrote:
>
>> This is my very very first port so let me know if I did something wrong.
>
> Looks OK to me; haven't run tested it yet, though.
>
> Since DESCR is quite short and there is no README, do you plan writing
> a manual page for it or can everything needed to set this up be found in
> existing smtpd documentation?

filter-rspamd doesn't have any configuration itself, all it needs is for smtpd.conf to reference it:

    filter "rspamd" proc-exec "/usr/local/bin/filter-rspamd"
    listen on all filter "rspamd"

I thought I'd add this as an example to the smtpd.conf(5) man page itself.

Should I add a README in the port too ?

Reply | Threaded
Open this post in threaded view
|

Re: New: mail/opensmtpd-filter-rspamd

Klemens Nanni-2
On Tue, Aug 13, 2019 at 08:37:18AM +0000, Gilles Chehade wrote:
> filter-rspamd doesn't have any configuration itself, all it needs is for smtpd.conf to reference it:
>
>     filter "rspamd" proc-exec "/usr/local/bin/filter-rspamd"
>     listen on all filter "rspamd"
>
> I thought I'd add this as an example to the smtpd.conf(5) man page itself.
Sounds good.

> Should I add a README in the port too ?
Yes please, either reference smtpd.conf(5) or just include the same
example here.  Adding a pkg/README to the port should do it; this way
pkg_add would tell you

        opensmtpd-filter-rspamd-X.Y: ok
        New and changed readme(s):
                /usr/local/share/doc/pkg-readmes/opensmtpd-filter-rspamd

so users know immediately how to set things up.

Reply | Threaded
Open this post in threaded view
|

Re: New: mail/opensmtpd-filter-rspamd

Landry Breuil-5
On Tue, Aug 13, 2019 at 11:18:33AM +0200, Klemens Nanni wrote:

> On Tue, Aug 13, 2019 at 08:37:18AM +0000, Gilles Chehade wrote:
> > filter-rspamd doesn't have any configuration itself, all it needs is for smtpd.conf to reference it:
> >
> >     filter "rspamd" proc-exec "/usr/local/bin/filter-rspamd"
> >     listen on all filter "rspamd"
> >
> > I thought I'd add this as an example to the smtpd.conf(5) man page itself.
> Sounds good.
>
> > Should I add a README in the port too ?
> Yes please, either reference smtpd.conf(5) or just include the same
> example here.  Adding a pkg/README to the port should do it; this way
> pkg_add would tell you
>
> opensmtpd-filter-rspamd-X.Y: ok
> New and changed readme(s):
>        /usr/local/share/doc/pkg-readmes/opensmtpd-filter-rspamd
>
> so users know immediately how to set things up.

Sorry, but i dont think this makes sense. With your reasoning, 2 extra
lines will be displayed at the end of pkg_add, for a 2-lines README.
lots of indirections for not much information... and we already know
users dont read them anyway.

I doubt ppl will come to filter-rspamd directly (and then wonder how to
set it up, in that case they will lookup HOMEPAGE), they might be more
'directed' at it by a mention of this same example in smtpd.conf(5) or a
commented out entry in the default smtpd.conf.

Adding a README for 2 lines is abusing the README mechanism imo.

Landry

Reply | Threaded
Open this post in threaded view
|

Re: New: mail/opensmtpd-filter-rspamd

Gonzalo L. Rodriguez-2
In reply to this post by Klemens Nanni-2
On Tue, 13 Aug 2019 at 11:18:33 +0200, Klemens Nanni wrote:

> On Tue, Aug 13, 2019 at 08:37:18AM +0000, Gilles Chehade wrote:
> > filter-rspamd doesn't have any configuration itself, all it needs is for smtpd.conf to reference it:
> >
> >     filter "rspamd" proc-exec "/usr/local/bin/filter-rspamd"
> >     listen on all filter "rspamd"
> >
> > I thought I'd add this as an example to the smtpd.conf(5) man page itself.
> Sounds good.
>
> > Should I add a README in the port too ?
> Yes please, either reference smtpd.conf(5) or just include the same
> example here.  Adding a pkg/README to the port should do it; this way
> pkg_add would tell you
>
> opensmtpd-filter-rspamd-X.Y: ok
> New and changed readme(s):
>        /usr/local/share/doc/pkg-readmes/opensmtpd-filter-rspamd
>
> so users know immediately how to set things up.
>

That would be nice.

--

                - gonzalo

Reply | Threaded
Open this post in threaded view
|

Re: New: mail/opensmtpd-filter-rspamd

Gonzalo L. Rodriguez-2
On Tue, 13 Aug 2019 at 11:43:23 +0200, Gonzalo L. Rodriguez wrote:

> On Tue, 13 Aug 2019 at 11:18:33 +0200, Klemens Nanni wrote:
> > On Tue, Aug 13, 2019 at 08:37:18AM +0000, Gilles Chehade wrote:
> > > filter-rspamd doesn't have any configuration itself, all it needs is for smtpd.conf to reference it:
> > >
> > >     filter "rspamd" proc-exec "/usr/local/bin/filter-rspamd"
> > >     listen on all filter "rspamd"
> > >
> > > I thought I'd add this as an example to the smtpd.conf(5) man page itself.
> > Sounds good.
> >
> > > Should I add a README in the port too ?
> > Yes please, either reference smtpd.conf(5) or just include the same
> > example here.  Adding a pkg/README to the port should do it; this way
> > pkg_add would tell you
> >
> > opensmtpd-filter-rspamd-X.Y: ok
> > New and changed readme(s):
> >        /usr/local/share/doc/pkg-readmes/opensmtpd-filter-rspamd
> >
> > so users know immediately how to set things up.
> >
>
> That would be nice.
>
> --
>
> - gonzalo
>

BTW, are you planning to merge this port with opensmtpd-extras? Or are
different stuff?

--

                - gonzalo

Reply | Threaded
Open this post in threaded view
|

Re: New: mail/opensmtpd-filter-rspamd

Klemens Nanni-2
In reply to this post by Landry Breuil-5
On Tue, Aug 13, 2019 at 11:32:37AM +0200, Landry Breuil wrote:
> Sorry, but i dont think this makes sense. With your reasoning, 2 extra
> lines will be displayed at the end of pkg_add, for a 2-lines README.
> lots of indirections for not much information... and we already know
> users dont read them anyway.
I agree that the indirection could be avoided, but people *do* read
these readmes.

> I doubt ppl will come to filter-rspamd directly (and then wonder how to
> set it up, in that case they will lookup HOMEPAGE), they might be more
> 'directed' at it by a mention of this same example in smtpd.conf(5) or a
> commented out entry in the default smtpd.conf.
Well, I know smtpd and we have packages for it, so I search the packages
to see what I can do.  I hate having to open some HOMEPAGE only to find
out how to use a port: that is was README and/or MESSAGE is for.

My goal is to provide packages which include all neccessary information
if possible, without forcing users through web browsers.

> Adding a README for 2 lines is abusing the README mechanism imo.
I'm also fine with amending DESCR or putting it in MESSAGE, as long as
I don't have to guess where to start after installing the package,
because I personally would be one of those users that would install it
only to find no manual or documentation whatsoever, angrily going though
smtpd(8) and smtpd.conf(5) first hoping for examples, then falling back
to the web.

Reply | Threaded
Open this post in threaded view
|

Re: New: mail/opensmtpd-filter-rspamd

Gilles Chehade-7
13 août 2019 13:27 "Klemens Nanni" <[hidden email]> a écrit:

> On Tue, Aug 13, 2019 at 11:32:37AM +0200, Landry Breuil wrote:
>
>> Sorry, but i dont think this makes sense. With your reasoning, 2 extra
>> lines will be displayed at the end of pkg_add, for a 2-lines README.
>> lots of indirections for not much information... and we already know
>> users dont read them anyway.
>
> I agree that the indirection could be avoided, but people *do* read
> these readmes.
>
>> I doubt ppl will come to filter-rspamd directly (and then wonder how to
>> set it up, in that case they will lookup HOMEPAGE), they might be more
>> 'directed' at it by a mention of this same example in smtpd.conf(5) or a
>> commented out entry in the default smtpd.conf.
>
> Well, I know smtpd and we have packages for it, so I search the packages
> to see what I can do. I hate having to open some HOMEPAGE only to find
> out how to use a port: that is was README and/or MESSAGE is for.
>
> My goal is to provide packages which include all neccessary information
> if possible, without forcing users through web browsers.
>
>> Adding a README for 2 lines is abusing the README mechanism imo.
>
> I'm also fine with amending DESCR or putting it in MESSAGE, as long as
> I don't have to guess where to start after installing the package,
> because I personally would be one of those users that would install it
> only to find no manual or documentation whatsoever, angrily going though
> smtpd(8) and smtpd.conf(5) first hoping for examples, then falling back
> to the web.
I have added a README

ok ?

opensmtpd-filter-rspamd.tar.gz (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: New: mail/opensmtpd-filter-rspamd

Gilles Chehade-7
In reply to this post by Gonzalo L. Rodriguez-2
13 août 2019 12:38 "Gonzalo L. Rodriguez" <[hidden email]> a écrit:

> On Tue, 13 Aug 2019 at 11:43:23 +0200, Gonzalo L. Rodriguez wrote:
>
>> On Tue, 13 Aug 2019 at 11:18:33 +0200, Klemens Nanni wrote:
>> On Tue, Aug 13, 2019 at 08:37:18AM +0000, Gilles Chehade wrote:
>>> filter-rspamd doesn't have any configuration itself, all it needs is for smtpd.conf to reference
>> it:
>>>
>>> filter "rspamd" proc-exec "/usr/local/bin/filter-rspamd"
>>> listen on all filter "rspamd"
>>>
>>> I thought I'd add this as an example to the smtpd.conf(5) man page itself.
>> Sounds good.
>>
>>> Should I add a README in the port too ?
>> Yes please, either reference smtpd.conf(5) or just include the same
>> example here. Adding a pkg/README to the port should do it; this way
>> pkg_add would tell you
>>
>> opensmtpd-filter-rspamd-X.Y: ok
>> New and changed readme(s):
>> /usr/local/share/doc/pkg-readmes/opensmtpd-filter-rspamd
>>
>> so users know immediately how to set things up.
>>
>> That would be nice.
>>
>> --
>>
>> - gonzalo
>
> BTW, are you planning to merge this port with opensmtpd-extras? Or are
> different stuff?
>

No I don't plan to merge this port with opensmtpd-extras because they're different stuff.

Reply | Threaded
Open this post in threaded view
|

Re: New: mail/opensmtpd-filter-rspamd

Stuart Henderson
In reply to this post by Gilles Chehade-7
On 2019/08/13 16:23, [hidden email] wrote:

> 13 août 2019 13:27 "Klemens Nanni" <[hidden email]> a écrit:
>
> > On Tue, Aug 13, 2019 at 11:32:37AM +0200, Landry Breuil wrote:
> >
> >> Sorry, but i dont think this makes sense. With your reasoning, 2 extra
> >> lines will be displayed at the end of pkg_add, for a 2-lines README.
> >> lots of indirections for not much information... and we already know
> >> users dont read them anyway.
> >
> > I agree that the indirection could be avoided, but people *do* read
> > these readmes.
> >
> >> I doubt ppl will come to filter-rspamd directly (and then wonder how to
> >> set it up, in that case they will lookup HOMEPAGE), they might be more
> >> 'directed' at it by a mention of this same example in smtpd.conf(5) or a
> >> commented out entry in the default smtpd.conf.
> >
> > Well, I know smtpd and we have packages for it, so I search the packages
> > to see what I can do. I hate having to open some HOMEPAGE only to find
> > out how to use a port: that is was README and/or MESSAGE is for.
> >
> > My goal is to provide packages which include all neccessary information
> > if possible, without forcing users through web browsers.
> >
> >> Adding a README for 2 lines is abusing the README mechanism imo.
> >
> > I'm also fine with amending DESCR or putting it in MESSAGE, as long as
> > I don't have to guess where to start after installing the package,
> > because I personally would be one of those users that would install it
> > only to find no manual or documentation whatsoever, angrily going though
> > smtpd(8) and smtpd.conf(5) first hoping for examples, then falling back
> > to the web.
>
> I have added a README
>
> ok ?

In the unlikely event anyone is actually resetting SYSCONFDIR, it only applies
to ports not things from base like smtpd.conf. but the bin path should use a
ports variable. So README needs this diff.

Rest looks good to me but I haven't tested the port.


--- README- Tue Aug 13 18:25:03 2019
+++ README Tue Aug 13 18:25:56 2019
@@ -6,9 +6,9 @@ $OpenBSD$
 
 To use filter-rspamd, you must declare it in smtpd.
 
-Edit the ${SYSCONFDIR}/mail/smtpd.conf file to declare the filter:
+Edit the /etc/mail/smtpd.conf file to declare the filter:
 
-  filter "rspamd" proc-exec "/usr/local/bin/filter-rspamd"
+  filter "rspamd" proc-exec "${PREFIX}/bin/filter-rspamd"
 
 Then add the filter to each listener that should be filtered:
 

Reply | Threaded
Open this post in threaded view
|

Re: New: mail/opensmtpd-filter-rspamd

Klemens Nanni-2
On Tue, Aug 13, 2019 at 06:28:47PM +0100, Stuart Henderson wrote:
> In the unlikely event anyone is actually resetting SYSCONFDIR, it only applies
> to ports not things from base like smtpd.conf. but the bin path should use a
> ports variable. So README needs this diff.
OK with that, thanks.