The SpamAssassin Procmail Spam Delivery module does not keep the variable definitions at the top of /etc/procmailrc
when Action for messages classified as spam is changed. As a result, for example, when switching to Deliver normally, the first lines of procmailrc
are changed to:
DROPPRIVS=yes :0fw | /bin/spamc :0 * ^X-Spam-Status: Yes $DEFAULT
…but $DEFAULT
is not yet defined, so the message goes nowhere.
Isn't $DEFAULT set automatically by procmail?
Yes, according to this:
I don't know what the "standard system mailbox" is set to or how it's determined, but moving
DEFAULT=$HOME/Maildir/
right afterDROPPRIVS=YES
fixed the problem for me.Last edit: Lomedhi 2022-02-04
So this appears to be a problem with trying to use both Webmin's Procmail Spam Delivery and Virtualmin's spam settings. I thought you could use both and one or the other was intended to take precedence, but that's not the case.
Virtualmin doesn't want you to use Webmin's Procmail Spam Delivery. It complains if you've done so when you run Re-Check Configuration. Virtualmin wants to manage procmail per virtual server.
When you create the first virtual server with email, Virtualmin rewrites
/etc/procmailrc
from:To:
So yes, if you have allowed Webmin to add SpamAssassin capability, switching to Deliver normally in Webmin has problems due to the placement of the variable assignments, but that's not the way things are intended to be used. With proper use, the variable assignment placement in Virtualmin's modifications doesn't matter because they are not preceded by a delivery recipe, other than the one to
/dev/null
when no valid domain is detected.In actual fact, there's no reason that anything after the
INCLUDERC
needs to be retained at all, because the included file handles delivery.So there's technically no bug here, but maybe you could detect whether
/etc/procmailrc
has been modified by Virtualmin and display a warning?Last edit: Lomedhi 2022-02-04
Sorry, I've been chasing ghosts because I was trying to use Webmin's server-wide SpamAssasin procmail settings along with Virtualmin's per-virtual server settings. When sticking with just the latter, everything works.
The one thing I'd like to request is what would have saved me from my own stupidity: A warning from Webmin when Virtualmin has already changed
/etc/procmailrc
.Thanks for indulging me.
Yes, we should do that. Where in Webmin were you editing the procmail config?
I edit the procmail config in Servers > Procmail Mail Filter, but the warning should actually go in Servers > SpamAssassin Mail Filter > Procmail Spam Delivery. There's already a warning there that procmail has not been set up for server-wide operation; I think the best approach would be:
Good idea, I'll add a warning for this (and also in the Procmail Mail Filter module).