On Sat, 2023-06-24 at 16:35 +1200, Peter via Postfix-users wrote:
> On 23/06/23 07:05, André Rodier via Postfix-users wrote:
> > Is there any way, with postfix, to run a script on authentication 
> > failure, with information like the IP address and the
> > username passed, for instance.
> 
> You can write your script up as a policy daemon and have it listen on an 
> inet or unix socket (you can use the spawn daemon for this), then do 
> something like this:
> 
> smtpd_recipient_restrictions = permit_sasl_authenticated,
>   check_policy_service unix:private/policy, reject
> 
> The policy service will only be called if sasl auth fails, make sure 
> that the policy service returns a response of either REJECT or DUNNO and 
> it should be called with all of the relevant info you want.
> 
> See SMTPD_POLICY_README, access(5) and spawn(8).
> 
> 
> Peter

Thanks, Peter, this is exactly what I was looking for.

Kind regards,
André
_______________________________________________
Postfix-users mailing list -- postfix-users@postfix.org
To unsubscribe send an email to postfix-users-le...@postfix.org

Reply via email to