Hello fellow Plesk users,
I am having some spam mails slipping through my spamassassin filters and want to get rid of them by checking for various subject lines. Since there is no GUI way in Plesk to do this and I also couldn't find a CLI command I was looking for other solutions.
With postfix-pcre I found a package that could solve this.
First I checked if postfix-pcre is already installed.
# postconf -m
pcre is listed there. So it should be supported and running.
Next I enabled header_checks in Postfix by editing the main configuration file
# sudo nano /etc/postfix/main.cf
and added the following at the end of the file
# header_checks = pcre:/etc/postfix/header_checks
I saved and closed the file and opened the lookup file
# sudo nano /etc/postfix/header_checks
In there I added phrases like this
/Potenzmittel/ REJECT
and saved the file.
Finally I build the index file with
# sudo postmap /etc/postfix/header_checks
and restarted postfix
# /etc/init.d/postfix restart
--
So far so good. At first it looked really promising but today one of the blocked subjects came through again. So its not working properly I guess.
What could I do to block emails that contains blocked words in their subject?
Do you see a mistake in the process described above?
Thanks and cheers,
pleskify
I am having some spam mails slipping through my spamassassin filters and want to get rid of them by checking for various subject lines. Since there is no GUI way in Plesk to do this and I also couldn't find a CLI command I was looking for other solutions.
With postfix-pcre I found a package that could solve this.
First I checked if postfix-pcre is already installed.
# postconf -m
pcre is listed there. So it should be supported and running.
Next I enabled header_checks in Postfix by editing the main configuration file
# sudo nano /etc/postfix/main.cf
and added the following at the end of the file
# header_checks = pcre:/etc/postfix/header_checks
I saved and closed the file and opened the lookup file
# sudo nano /etc/postfix/header_checks
In there I added phrases like this
/Potenzmittel/ REJECT
and saved the file.
Finally I build the index file with
# sudo postmap /etc/postfix/header_checks
and restarted postfix
# /etc/init.d/postfix restart
--
So far so good. At first it looked really promising but today one of the blocked subjects came through again. So its not working properly I guess.
What could I do to block emails that contains blocked words in their subject?
Do you see a mistake in the process described above?
Thanks and cheers,
pleskify