I wrote a little bash script right after I got amavisd+spamassassin running on the system here so I could forward email and have it learned as either spam or ham. I'm the only one that uses it though, I don't trust users on the system here to be able to differentiate between true spam and ham.

The script is pretty simple, just looks for an attached file, and renames it to a static filename so I can then run ripmime to get the original message. I wouldn't be surprised if there is a much more elegant solution. The regex may not work for non-mozilla clients, as I only made sure it worked for Mozilla as that is the only browser I use.


Ryan Moore ---------- Perigee.net Corporation 704-849-8355 (sales) 704-849-8017 (tech) www.perigee.net

(the second line is 'cd /tmp', the sed line will probably get wrapped, and there is a single whitespace between "\n name=")
---------------------------------------------------
#!/bin/bash


sed -e'/^Content-Type: message\/rfc822;/N;s/\n *name="\([^"]*\)"/\n name="spamtmporig.eml"/' > /tmp/spamtmp.eml
cd /tmp
mkdir spamtmp
cd spamtmp
mv ../spamtmp.eml .
cat spamtmp.eml | /usr/local/bin/ripmime -i - -d .
cat spamtmporig.eml | /usr/bin/sa-learn --spam
---------------------------------------------------



Ryan Parlee wrote:
I would like to have my users be able to forward spam that they receive to
an email address like "[EMAIL PROTECTED]".  I would then configure my
mail server to send this email through "sa-learn -spam".  Do I need to worry
about first stripping off "FW: ", the from address (this would be my user
and not the original sender), etc.?  Also, what about
"[EMAIL PROTECTED]".  In this case, my users would be wanting to
unlearn a particlar message to prevent it from being marked as spam in the
future.

Thanks,
Ryan




--


Ryan Moore
----------
Perigee.net Corporation
704-849-8355 (sales)
704-849-8017 (tech)
www.perigee.net



-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?   SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
_______________________________________________
Spamassassin-talk mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/spamassassin-talk

Reply via email to