Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

sendmail relay + spamassassin + spamass-milter to forward spam

80 views
Skip to first unread message

smith

unread,
Nov 29, 2006, 7:03:36 PM11/29/06
to
I have a sendmail relay setup that has no local user and just relays
mail to an internal ms exch server. Spamassassin and the
spamass-milter are running and currently tagging the subject of all
spam with [SPAM]. What I'd like to do is forward any spam to
sp...@domain.com instead of being delived to the user. I know how to do
it if I could use procmail but this being a relay that isn't an option.
What is the way to do this with my current setup??

David F. Skoll

unread,
Nov 29, 2006, 9:25:02 PM11/29/06
to
smith wrote:

I don't know if spamass-milter is sufficiently flexible, but it's very
easy to do this with MIMEDefang:

http://www.mimedefang.org/node.php?id=35

--
David.

smith

unread,
Nov 29, 2006, 9:44:20 PM11/29/06
to
Thanks, I had come to that conclusion earlier with some google research
but wasn't sure if there was just something I was missing in the
spamass-milter. Thanks for confirming.

Taylor, Grant

unread,
Nov 29, 2006, 9:48:59 PM11/29/06
to
On 11/29/06 20:25, David F. Skoll wrote:
> I don't know if spamass-milter is sufficiently flexible, but it's very
> easy to do this with MIMEDefang:

man spamass-milter

<snip>

-b spamaddress
Redirects tagged spam to the specified email address. All envelope
recipients are removed, and inserted into the message as `X-Spam-Orig-To:'
headers.

<snip>

Plus some other nifty things.

Grant. . . .

smith

unread,
Nov 30, 2006, 11:31:00 AM11/30/06
to
thanks but i'm no expert here, where would I add the -b spamaddress to?
not the local.cf file, doesn't seem like in sendmail.mc???

smith

unread,
Nov 30, 2006, 2:16:17 PM11/30/06
to
ok found it. in /etc/init.d/spamass-milter I added
EXTRA_FLAGS="-b sp...@example.com"

and that is working... thanks so much. last question is there any
way for me to tell it to just change the subject for spam rated 3-4
while 5+ just goes to the spam email? Right now anything with 5+ gets
[SPAM] added to subj and now with this get sent to sp...@example.com. I
would just like a setting for "suspected spam" so to speak.

Taylor, Grant

unread,
Nov 30, 2006, 8:15:35 PM11/30/06
to
On 11/30/06 13:16, smith wrote:
> ok found it. in /etc/init.d/spamass-milter I added
> EXTRA_FLAGS="-b sp...@example.com"

*nod*

> and that is working... thanks so much. last question is there any
> way for me to tell it to just change the subject for spam rated 3-4
> while 5+ just goes to the spam email? Right now anything with 5+ gets
> [SPAM] added to subj and now with this get sent to sp...@example.com. I
> would just like a setting for "suspected spam" so to speak.

Ugh! I doubt it. Think about what you are really asking to do now. First let's think about what SpamAssassin is meant to do. SA will analyze an email and decide if a message has a high enough spam score to be declared spam or not. If the message is spam, then it is treated as such. if the message is not spam, then it is treated as ham. You are wanting to have SA decide if a message is not spam, is suspected but not confirmed spam, and if a message is spam. That is a non binary decision. One thing that comes to mind is to configure spamass-milter to reject spam if it has a high enough spam score and only allow lower scoring spam through in addition to messages that are not considered spam. This is what I'm doing. I don't think it is possible with spamass-milter to tag low scoring spam and redirect high scoring spam. You could probably very likely do something like that with MIMEDefang tough. I suppose you could also run your messages through SA via spamass-milter
and then have another milter look at SAs results and decide what to do with the message then.

Grant. . .

David F. Skoll

unread,
Nov 30, 2006, 9:21:56 PM11/30/06
to
Taylor, Grant wrote:

>> and that is working... thanks so much. last question is there any
>> way for me to tell it to just change the subject for spam rated 3-4
>> while 5+ just goes to the spam email? Right now anything with 5+ gets
>> [SPAM] added to subj and now with this get sent to sp...@example.com. I
>> would just like a setting for "suspected spam" so to speak.

> Ugh! I doubt it. Think about what you are really asking to do now.

Again, MIMEDefang makes that trivial because it's scriptable in Perl.
Pseudocode in filter_end:

if ($score >= 5) {
send_to_spamtrap_address();
} elsif ($score >= 3) {
action_change_header('Subject', "[SPAM] $Subject");
}

Easy, no? :-)

Regards,

David.

smith

unread,
Dec 1, 2006, 4:19:03 PM12/1/06
to
Yes after your first reply I realized mimedefang is the way to go.
However i needed to get it working at least to forward spam to an
address and having the spamass-milter already configured and then just
one line change to get it working that is what I implemented. When i
get more time I will configure mimedefang for those more advanced
features I'd like to have. I already have it installed and just turned
off right now. Plus the milter is only getting about 30 spams a day to
it as 5-7x that is being rejected from the DNS blacklists I have set up
so that's cool.
0 new messages