[pfx] Re: Integrating a new milter with Postfix

2023-03-12 Thread Benny Pedersen via Postfix-users

PGNet Dev via Postfix-users skrev den 2023-03-12 14:46:


systemctl list-units  | egrep "regex|clam|spam|dkim" |grep service
clamav-daemon.serviceloaded active running   clamd scanner
clamav-milter.serviceloaded active running   clamav milter
dkimpy-milter.serviceloaded active running   dkimpy milter
mregex.service   loaded active running   regex milter
spamassassin-milter.service  loaded active running   SA milter
spamd.serviceloaded active runningSA daemon

works great


except dkimpy-milter installed from pip3 install dkimpy-milter does not 
support pep517, with makes it impossible to make gentoo ebuilds for it


in the tarball it have dkimpy_milter dir, and the tarball in pypi is 
dkimpy-milter, details mater in gentoo portage

___
Postfix-users mailing list -- postfix-users@postfix.org
To unsubscribe send an email to postfix-users-le...@postfix.org


[pfx] Re: Integrating a new milter with Postfix

2023-03-12 Thread Wietse Venema via Postfix-users
Wietse Venema via Postfix-users:
> EML via Postfix-users:
> > I've written a before-queue milter that I'm trying to integrate with 
> > Postfix, but there doesn't seem to be any specific documentation on how 
> > to do this. During development, I ran the milter manually, listening on 
> > port 7950, with nothing in master.cf, and this in main.cf:
> > 
> > smtpd_milters = inet:localhost:7950
> > non_smtpd_milters = $smtpd_milters
> > 
> > This works. For production, I'd like to get Postfix to run the milter, 
> > so I've added this to master.cf:
> > 
> > 7950  inet  n  y  n  0  - samilter { -p inet:7950@localhost }
> > 
> 
> You can only run POSTFIX programs this way. 
> 
> Non-Postfix program can be run with the pipe(8) daemon (for transient
> programs) and spawn(8) daemon (for persistemt programs).

Actually, both are for running a transient command. This setup is
not suitable for Milters that want to create their own socket, it
is for programs that read from stdin and that write to stdout.

Wietse
___
Postfix-users mailing list -- postfix-users@postfix.org
To unsubscribe send an email to postfix-users-le...@postfix.org


[pfx] Re: Integrating a new milter with Postfix

2023-03-12 Thread Wietse Venema via Postfix-users
EML via Postfix-users:
> I've written a before-queue milter that I'm trying to integrate with 
> Postfix, but there doesn't seem to be any specific documentation on how 
> to do this. During development, I ran the milter manually, listening on 
> port 7950, with nothing in master.cf, and this in main.cf:
> 
> smtpd_milters = inet:localhost:7950
> non_smtpd_milters = $smtpd_milters
> 
> This works. For production, I'd like to get Postfix to run the milter, 
> so I've added this to master.cf:
> 
> 7950  inet  n  y  n  0  - samilter { -p inet:7950@localhost }
> 

You can only run POSTFIX programs this way. 

Non-Postfix program can be run with the pipe(8) daemon (for transient
programs) and spawn(8) daemon (for persistemt programs).

Wietse
___
Postfix-users mailing list -- postfix-users@postfix.org
To unsubscribe send an email to postfix-users-le...@postfix.org


[pfx] Re: Integrating a new milter with Postfix

2023-03-12 Thread Jaroslaw Rafa via Postfix-users
Dnia 12.03.2023 o godz. 12:43:00 EML via Postfix-users pisze:
> I can run the milter as a
> service, if necessary, instead of adding an entry in master.cf, but
> this feels like the wrong way to do this. Thanks.

It's actually the proper way to do this. Milters are separate services that
Postfix communicates with, and it is their job to care for their own
startup, not Postfix's.
-- 
Regards,
   Jaroslaw Rafa
   r...@rafa.eu.org
--
"In a million years, when kids go to school, they're gonna know: once there
was a Hushpuppy, and she lived with her daddy in the Bathtub."
___
Postfix-users mailing list -- postfix-users@postfix.org
To unsubscribe send an email to postfix-users-le...@postfix.org


[pfx] Re: Integrating a new milter with Postfix

2023-03-12 Thread PGNet Dev via Postfix-users

That's a surprise - thanks. I've just checked and seen that opendkim and 
opendmarc set up init-style services. I'll do a systemd service for this 
milter, but I'd be interested to hear if there's any policy or other advice 
about whether we should be using master.cf or a service.


ultimately up to you.

my $0.02, let postfix be postfix, not a 3rd-party service manager

here, e.g.

grep " smtpd_milters" master.cf
-o 
smtpd_milters=unix:/run/mregex/mregex.sock,unix:/run/clamav-milter/clamav-milter.sock,unix:/run/spamassassin-milter/spamassassin-milter.sock
-o smtpd_milters=unix:/run/dkimpy-milter/dkimpy-milter.sock

systemctl list-units  | egrep "regex|clam|spam|dkim" |grep service
clamav-daemon.serviceloaded active running   clamd scanner
clamav-milter.serviceloaded active running   clamav milter
dkimpy-milter.serviceloaded active running   dkimpy milter
mregex.service   loaded active running   regex milter
spamassassin-milter.service  loaded active running   SA milter
spamd.serviceloaded active runningSA daemon

works great

fwiw, i also run the fastmail auth milter in its SMTP mode in a prior stage, 
and inject into this^^ milter stage

ymmv.
___
Postfix-users mailing list -- postfix-users@postfix.org
To unsubscribe send an email to postfix-users-le...@postfix.org


[pfx] Re: Integrating a new milter with Postfix

2023-03-12 Thread EML via Postfix-users



On 12/03/2023 12:49, David Bürgin via Postfix-users wrote:

EML:

I can run the milter as a service, if necessary, instead of adding an entry in 
master.cf, but this feels like the wrong way to do this. Thanks.


But note that this is how milters are normally operated, eg milters
installed from a distro package.


That's a surprise - thanks. I've just checked and seen that opendkim and 
opendmarc set up init-style services. I'll do a systemd service for this 
milter, but I'd be interested to hear if there's any policy or other 
advice about whether we should be using master.cf or a service.




___
Postfix-users mailing list -- postfix-users@postfix.org
To unsubscribe send an email to postfix-users-le...@postfix.org

___
Postfix-users mailing list -- postfix-users@postfix.org
To unsubscribe send an email to postfix-users-le...@postfix.org


[pfx] Re: Integrating a new milter with Postfix

2023-03-12 Thread David Bürgin via Postfix-users
EML:
> I can run the milter as a service, if necessary, instead of adding an entry 
> in master.cf, but this feels like the wrong way to do this. Thanks.

But note that this is how milters are normally operated, eg milters
installed from a distro package.
___
Postfix-users mailing list -- postfix-users@postfix.org
To unsubscribe send an email to postfix-users-le...@postfix.org