Run script after pmg-smtp-filter

mbrother

Member
Oct 29, 2021
38
7
13
42
Hi,

Can I run a bash script after pmg-smtp-filter process finished? Thanks for any help!
 
Last edited:
Hi Stoiko,

Thank you for your answer. I want to write log to custom file when an email is blocked by pmg-smtp-filter. Have you any idea to do that?
 
Thank you for your answer. I want to write log to custom file when an email is blocked by pmg-smtp-filter. Have you any idea to do that?
pmg-smtp-filter logs all final actions (actually most actions) and the rule-name to the journal/syslog - e.g.:
Code:
Aug 08 11:53:33 pmg7 pmg-smtp-filter[7505]: 809DF62F0DD1DBE2BC: accept mail to <xx@xxyyy.example> (DE7B46A835) (rule: default-accept)
you can use this and create a dedicated syslog file (rsyslog can match quite effectively for patterns and write those to a dedicated file) for all such actions (keep in mind that the log-lines should also end up in /var/log/syslog, if you want to use the Tracking Center)

see e.g. https://www.rsyslog.com/doc/v8-stable/configuration/filters.html
(but there's tons of HOWTOs on the internet)

I hope this helps!