Considerations for spam filtering plus email forwarding

Hellos!

I just found out - by experiment and then forum search :slight_smile: - that SpamAssassin via Procmail is only executed for users who have an actual local mailbox, and not for Postfix-level aliases.

I’d like to achieve to have local users in addition to forward-only mailboxes, with spam checking performed for both of them. I also don’t wish to force all local users to have spam put into the “Maildir/.spam” folder, since that would force them to use IMAP to check the spam folder for potential false positives.

Am I seeing this correctly so far? I’d have to set the spam delivery option to “Deliver normally”, and then use individual .procmailrc files for each user to decide what to do - put the spam in “.spam”, throw it away, leave it as it is (and let them filter in the client based on X-Spam-Status header), plus have them decide for themselves whether to use local mailbox or mail forwarding?

Now the question: I’d like to have a default setting for users, like what makes the most sense. E.g. “put mail in .spam, no forwarding”. This means I’d need to have a default .procmailrc for their homes, right? I think I saw an option somewhere to have files auto-copied into new mail users’ homes, like “/etc/skel” for domains. Can’t find that option right now, but I think it’s there. Would that be the way to go?

I’d like to achieve to have local users in addition to forward-only mailboxes, with spam checking performed for both of them.

To achieve that, you’d have to have local accounts created, you couldn’t do it purely with aliases/forwarding.

Outside of using a Postfix Milter sort of thing (which Virtualmin can’t figure ATM), since it’s procmail that calls SpamAssassin and ClamAV, you’d need to have a local user, even if it’s just a forward-only account. But based on the rest of your message, you may very well realize that :slight_smile:

also don’t wish to force all local users to have spam put into the “Maildir/.spam” folder, since that would force them to use IMAP to check the spam folder for potential false positives.

Yeah, at the moment, the best you can do is per-domain settings, and not per-user (changing the delivery defaults, as you saw).

At one point, nothing from /etc/skel was copied over for new email accounts, that was only done for a new Virtual Server.

However, it’s possible such a feature has made it’s way in there :slight_smile: I’m not seeing it ATM though…

As far as letting the users decide some things – in Usermin, there are filtering and forwarding options available in there. If you’re looking to give users some control, they can do a lot of things from within Usermin. But, not all of them will understand how to do that :slight_smile:

Does that help… a little at least? :slight_smile:

-Eric

It did help, yes, thanks! :slight_smile: So basically you agree with that what I outlined would be the best course of action right now, to achieve what I have in mind?

(I also found the “copy files into new mail user’s directory upon creation” thing again meanwhile. :slight_smile: It’s in the Virtualmin Configuration -> Default few new domains.)

It did help, yes, thanks! :slight_smile: So basically you agree with that what I outlined would be the best course of action right now, to achieve what I have in mind?

Well, I think my only outstanding question is where you said:

“Now the question: I’d like to have a default setting for users, like what makes the most sense. E.g. “put mail in .spam, no forwarding”. This means I’d need to have a default .procmailrc for their homes, right?”

I don’t believe you’d need a default .procmailrc for each user to accomplish that… you could just setup a server-wide default, and use a .procmailrc to override it. If I understand what you’re asking :slight_smile:

Also, don’t forget that Usermin allows individual users to do a lot of configuring of these sorts of things. They can setup forwards and procmailrc entries from there.

So, your more savvy users could do that on there own… but you could of course have a procmailrc template to copy in for users who don’t want to have to do that :slight_smile:

-Eric

Yeah, your last paragraph goes exactly in the direction that I meant. :slight_smile:

I e.g. cannot set a server-wide default to have spam filed into ~/Maildir/.spam/, since some users maybe want it elsewhere. The default would take preference over the user’s choice then though, since it’s executed before the individual .procmailrc I think. At least it looks that way when I add a user filter rule for “email is spam”… that one appears after the default one. But when I set the server-wide thing to “Deliver normally”, each user can set the storage location where they want.

The savvy ones can do that themselves, yepp. But the un-savvy ones should get a feasible default, which would mean put “file into .spam” into their default-.procmailrc.