• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

On-server mail filtering

P

pkern

Guest
Hi there.

Is there any way to get mail filtering on the server for certain users? It could also involve putting a filter in place as root, but I have absolutely no clue of qmail (this was one of the points I most criticised about Plesk). How could I get qmail to check for a .mailfilter in the users homedir (aka the path in which the Maildir resides) before it delivers its mails and then passing it to maildrop instead? (This is just an idea I have from my other site running exim.)

Kind regards and thanks in advance for any help,
Philipp Kern
 
Qmail does not use .mailfilter files, it uses .qmail files.

Look in the qmail user folder for the hidden .qmail file.
 
Originally posted by ShadowMan
Look in the qmail user folder for the hidden .qmail file.

Ok, I just checked this file and it looks a bit like a .forward file where one could use shell scripts for filtering. Apart from the fact that I have to find documentation for it, am I allowed to modify this file? I have SpamAssassin activated in Plesk (to get user customised spam levels) and the .qmail file pipes the mails into it.

But any change to the SpamAssassin settings in Plesk would trash my filter, correct? Is there a way to prevent it and would root/root, 0644 help?

Kind regards,
Philipp Kern
 
AFAIR, the .qmail file does get overwritten, I don't think you want to change the ownership of the file, that may prevent qmail from accessing it (should be popuser for both uid and gid), but I have not tested that scenario.

I believe some others, including 4psa's products use a cron script to check and rewrite thier pipes into the file at intervals, again AFAIR.

You could try setting the file as immutable using chattr +i , but then you'd have to remember which ones you changed at some later date (when you're tearing your hair out that this user's settings aren't working....)

Is this to get additional antivirus or antispam filtering? or just special case-by-case handling?
 
Originally posted by ShadowMan
You could try setting the file as immutable using chattr +i , but then you'd have to remember which ones you changed at some later date (when you're tearing your hair out that this user's settings aren't working....)

Thanks for that tip.

Is this to get additional antivirus or antispam filtering? or just special case-by-case handling?

No in fact the mails should just get distributed in a set of mailboxes on the server-side. In this case IMAP is used from various mail clients on different platforms, so it's difficult to maintain a common ruleset (and yes, the mail volume is high on that account).

I tried to get maildrop running from .qmail, but it failed without any hint what's going wrong (something like '| DEFAULT=".../Maildir/" maildrop' in .qmail).

Kind regards,
Philipp Kern
 
Back
Top