spamass-milt-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: -x on Postfix, and a possible fix.


From: Tony Shadwick
Subject: Re: -x on Postfix, and a possible fix.
Date: Mon, 07 Jun 2010 06:33:58 -0500
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.1.9) Gecko/20100317 Lightning/1.0b1 Thunderbird/3.0.4

On 5/30/10 6:50 AM, Tony Shadwick wrote:


Okay, so quick search yields that no one else has fought with this yet,
and since I'm the on that asked for the feature way back when, I guess
it is only appropriate that I'm asking for this too. :)

In short - `sendmail -bv` does not behave as expected on Postfix. I've
known this for about a year, but him-hawed about speaking up. Now it's
biting me in the rear. Instead of printing to the terminal the results,
it emails the current user the results.

I did quite a bit of research on the matter, and it has something to do
with postfix not being run as root or somesuch. Whatever the reason,
there's really no way to make `sendmail -bv` behave as it does with
sendmail.

The alternative would be to provide what I call spamass-milter -y, which
would be to bring your own expansion command. Convienently for me, I
have one handy:

tshadwick# postmap -q address@hidden /etc/postfix/virtual
tshadwick

One could, in fact ditch -x and use -y on the same system by doing this:

tshadwick# sendmail -bv address@hidden | grep "deliverable:
mailer local" | awk '/mailer local, user (.*?)/ {print $6}'
numbski

(different machines - output from both is accurate).

So I guess what I proprose is allow -y to call a single command (I could
do the above example in a script), and it would then behave as -x does
today.

The reason I believe this is important is because I have another site
running postfix where postmap -q wouldn't do the job. They are using
postfix's mysql capability. I could however structure a script to query
mysql and return the correct result. It would allow proper
customization all the way around.

For now, I guess I can recompile spamass-milter and just change the
behavior of -x, but long-term I expect more users to go from sendmail to
postfix, and the result of -x right now on postfix isn't good - it
leaves a ton of zombie processes waiting to get an answer back. Not
your fault - you wrote this for sendmail, not postfix. Personally, I
feel like the Postfix project is being somewhat obstinate about the
whole thing - lots of people rely on sendmail -bv's behavior. Simply
allowing us to throw a flag or set a variable to get the old behavior
back would be trivial, but they have repeatedly refused to do so. This
fixes that.

Tony Shadwick

_______________________________________________
Spamass-milt-list mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/spamass-milt-list


Wow this is strange. So I got around to trying to fix this for myself tonight, and the results are not what I expected.

In spamass-milter.cpp, you have this:

/* open a pipe to sendmail so we can do address expansion */

                char buf[1024];
                char *fmt="%s -bv \"%s\" 2>&1";

I changed it to be this instead:

        char *fmt="%s -q \"%s\" /etc/postfix/virtual 2>&1";

Then I adjusted the appropriate sprintf/snprintf commands to send /usr/sbin/postmap instead of SENDMAIL for the first %s, and commented out the strstr's that pulled the resultant user out since we get a clean result from postmap. Easy fix, right? Well....not exactly...

Jun 7 03:12:31 mist spamass-milter[12632]: calling /usr/sbin/postmap -q "<address@hidden>" /etc/postfix/virtual 2>&1

Huh? Why are the < and > getting left on the address? I didn't comment anything out that got ride of them. Have they always been passed to sendmail -bv?

Tony Shadwick



reply via email to

[Prev in Thread] Current Thread [Next in Thread]