andybalholm / spamass-milter

A Sendmail milter to run SpamAssassin
7 stars 9 forks source link

I am receiving a Mail Delivery Status Report for every message I receive. #13

Closed volanin closed 3 years ago

volanin commented 3 years ago

I am running spamass-milter with postfix, and starting it with the -x parameter in order to do virtual table alias expansion. This is necessary because I need to pass the virtual username to spamc in order to create separate bayes databases. So far, so good, everything works as it should.

Here comes the problem: Looking at the code, when I pass the -x parameter, spamass-milter calls the sendmail program with the -bv parameter. But when the postfix's sendmail is called with the -bv parameter, it sends an e-mail with the Status Report to the calling user.

I am getting inundated with useless Status Reports! What am I doing wrong? Is this a bug?

andybalholm commented 3 years ago

Some of spamass-milter's features work only with the original Sendmail, not with Postfix. I'm guessing this is one of them.

volanin commented 3 years ago

Oh damn... postfix and the original sendmail can't coexist on Debian/Ubuntu. Trying to install one removes the other. Since my server is already configured to use postfix, I guess I won't be able to use spamass-milter then, which is really unfortunate... anyhow, thanks a lot for the help.

gdt commented 3 years ago

FWIW I use spamass-milter and postfix just fine on NetBSD, with no sendmail installed. But I do not use the -x flag.

volanin commented 3 years ago

Maybe I am doing something wrong. The problem I have is with catch-all addresses.

In my system, I have two users: wagner and paula. And my postfix virtual file is as follows:

paula@example.org   paula
@example.org        wagner

When I get an e-mail to paula@example.org, spamass-milter correctly calls spamc -u paula, creating the bayes database in paula's home directory. But when I get an e-mail to contact@example.org, spamass-milter calls spamc -u contact, and I get the following error in spamd.log:

info: spamd: handle_user (getpwnam) unable to find user: 'contact'
warn: spamd: still running as root: user not specified with -u, not found, or set to root, falling back to nobody

The mail is correctly put in wagner's home directory, but the bayes database is not created. Passing the -x parameter to spamass-milter makes it expand the address contact@example.org into wagner, and everything works... but then, postfix's sendmail insists on sending a Report Status to my mailbox.

Maybe I could compile a static sendmail (original) and make spamass-milter use it instead, for address expansion only, but then things start to be quite non-standard, and I am trying to avoid this as much as I can to make maintenance easier a few years from now, when I won't remember these details as much.

gdt commented 3 years ago

I didn't mean to say you were doing it wrong. Your point in wanting -x is totally valid, even if it opens a can of worms, when a@ forwards to b@ and c@ both.

It does not seem sound to me to run sendmail for expansion on mail system configured for postfix, because a lot of the behavior is within postfix config (virtual tables etc.) and not necesssarily all in /etc/mail/aliases.

I suspect what's needed is to have postfix have a feature to do expansion like sendmail does with -bv, either to figure it out or add it, and then teach spamass-milter to use it. I realize that's likely a lot of work, but if postfix does it already, maybe not so bad for you to just hack it into your copy and see how it goes.

gilgongo commented 3 months ago

In order to prevent the spamass-milter account from filling up the disk with notification emails, I had to use procmail to send all mail to that account to /dev/null. Setting the home dir to that produced a pyzor error.

Rather not elegant, but works. Ubuntu 22.04 (spamass-milter installed from Ubuntu repo)