Hello
I have setup SpamAssasin and it is working as intended. On question remains:
How do I tag/mark email that is being forwarded?
I have setup a sample rule in SpamAssasin like:
body LOCAL_DEMONSTRATION_RULE /test/ score LOCAL_DEMONSTRATION_RULE 0.1 describe LOCAL_DEMONSTRATION_RULE This is a simple test rule
service spamassassin restart
Send an email from my yahoo account to the email server in question. On the server the message had the [SPAM} tag.
That account forwards all emails to another gmail account. When the same message arrived at gmail, it had no SpamAssassin headers and the subject was not modified.
Simple schema:
Yahoo>My Server > [SPAM] tag added > Delivered to user inbox. Shows [SPAM] in Subject > Email forwarded to Gmail > Delivered to user inbox. No tag or subject showing [SPAM]
From logs I can see that SpamAssassin is processing the email before it is being forwarded.
Jun 15 18:40:29 ns4 clamsmtpd: 100075: from=user@yahoo.com, to=user@domain.com, status=CLEAN Jun 15 18:40:29 ns4 postfix/smtp[30406]: 8F09F414E8: to=user@domain.com, relay=127.0.0.1[127.0.0.1]:10025, delay=1.7, delays=1.6/0/0.04/0.08, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as 12E4C414FB) Jun 15 18:40:29 ns4 spamd[30529]: spamd: setuid to user.domain.com succeeded Jun 15 18:40:29 ns4 spamd[30529]: spamd: processing message 12345456789.YahooMailNeo@web160403.mail.bf1.yahoo.com for user.domain.com:1061 Jun 15 18:40:31 ns4 spamd[30529]: spamd: identified spam (19.6/5.0) for user.domain.com:1061 in 1.8 seconds, 3757 bytes. Jun 15 18:40:31 ns4 spamd[30529]: spamd: result: Y 19 - DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,HTML_MESSAGE,LOCAL_DEMONSTRATION_RULE,RCVD_IN_DNSWL_NONE,RP_MATCHES_RCVD,TVD_SPACE_RATIO scantime=1.8,size=3757,user=user.domain.com,uid=1061,required_score=5.0,rhost=localhost,raddr=127.0.0.1,rport=59962,mid=123456789.YahooMailNeo@web160403.mail.bf1.yahoo.com,autolearn=spam Jun 15 18:40:31 ns4 postfix/local[30410]: 12E4C414FB: to=user.domain.com@ns4.domain.com, orig_to=user@domain.com, relay=local, delay=2.1, delays=0.08/0/0/2, dsn=2.0.0, status=sent (delivered to command: /usr/bin/procmail-wrapper -o -a $DOMAIN -d $LOGNAME) Jun 15 18:40:31 ns4 postfix/local[30410]: 12E4C414FB: to=user.domain.com@ns4.domain.com, orig_to=user@domain.com, relay=local, delay=2.1, delays=0.08/0/0/2, dsn=2.0.0, status=sent (forwarded as 27115414E8) Jun 15 18:40:32 ns4 postfix/smtp[30431]: 27115414E8: to=user@gmail.com, orig_to=user@domain.com, relay=gmail-smtp-in.l.google.com[173.194.70.26]:25, delay=2.9, delays=2/0/0.12/0.69, dsn=2.0.0, status=sent (250 2.0.0 OK 1371310832 w7si5936159eel.134 - gsmtp)
How can I make SpamAssassin tag forwarded emails?
Thank you
This is obviously delayed but maybe this will help: http://www.halfslide.com/dropping-spam-with-postfix-and-spamassassin-on-...
Thank you for your reply.
What worked for me is:
/^X-Spam-Level: \*{5,}.*/ DISCARD
Anything above a score 5 will not be forwarded.