David T-G spaketh:

>% Some good info and suggestions in your reply.  What do you think of
>
>Happy to help!
>
>% this brute-force approach?
>
>Hrmmm...
>
>% $cf = '/etc/mail/spamassassin/local.cf';
>% system("cp -p $cf ${cf}.tmp"); # Preserve original
>% open(CF, ">>$cf") || die "Can't open $cf $!\n";
>% flock(CF, LOCK_EX); # Lock file to prevent updates during processing
>
>Shouldn't you lock before opening?


Nope, you need a file handle before you can lock.


>% print CF "all_spam_to $username";
>% system("/usr/local/bin/formail -s /usr/sbin/sendmail $username <
>% /var/log/spam/$file
>
>You're just pumping it back through sendmail again, so you're having to
>rely on a whitelist, but you're doing it on a username basis -- and,
>meanwhile, what about any other spam that shows up while you have the
>file modified?
>
>
>% flock(CF, LOCK_UN);
>
>Shouldn't you unlock after you rewrite?


You mean renaming the file (below)?  Yes, possibly.


>% close(CF);
>% rename("${cf}.tmp", $cf); # Restore original
>
>This last bit is definitely a pain; that's almost never the right way to
>go.
>
>Why not just add a permanent rule that whitelists your special header and
>then let SA add it or a following procmail rule add it (before sending
>it to your quarantine) or whatnot?  That seems a lot easier and more
>appropriate; you're tinkering with the messages rather than your config...


That's the approach I'm exploring now.  It seems to offer the least 
ugly-factor.


>% The routine would probably work, but it seems like a crude solution.
>% But perhaps it's better than some alternatives.
>
>I'm sure there is *some* alternative which isn't as good :-)  In general,
>though, I agree that it's probably too crude.


I was disturbed by it also, but I've seen worse.  Hell, I've used worse.


>HTH & HAND
>
>:-D
>--
>David T-G                      * It's easier to fight for one's principles
>(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
>(work) [EMAIL PROTECTED]
>http://www.justpickone.org/davidtg/    Shpx gur Pbzzhavpngvbaf Qrprapl Npg!


Thanks for your input.  Much appreciated.

.\\ichelle
--------------------
Michelle Brownsworth
System Administrator
Willamette.Net
http://www.willamette.net
Phone (541) 465-3282
Fax   (541) 465-1194

_______________________________________________________________

Don't miss the 2002 Sprint PCS Application Developer's Conference
August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm

_______________________________________________
Spamassassin-talk mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/spamassassin-talk

Reply via email to