Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Diverting possible spam to junk folder using subject header

Status
Not open for further replies.

izzyonstage

Programmer
Oct 12, 2007
1
GB
Hi all,

I am trying to configure my sendmail to route any emails with the subject begining with {SPAM} to the junk folder of a user.

Is this possible?

I am using SpamAssassin to mark the mail. And MailScanner to get the incoming mail a route it to be scanned for spam and AV. however I am having problems trying to find a way to then get any marked mails to be sent to the junk-mail folder.

I want to do it this way just in case of FP's.

On average I recieve 100-200 Spam's a day. but 2-3 of these may be email's that i am actualy expecting and not realy spam.

Please can someone point me in the right direction.

Thanks in advance.
 
If you are using spamassassin then you just have to tell procmail what to do with mail marked spam. Here is an example:

Code:
DROPPRIVS=yes
:0fw
| /usr/bin/spamc
:0
* ^X-Spam-Status: Yes
! junkmail@mydomain.com

Here mail is sent to spamc (spamassassin) and if the spam status is yes, then it is sent to a special mail account created just for spam.


 
I just reread your post and noticed that you wanted the spam to go to the user's junk folder specifically. In that case just replace:

Code:
! junkmail@mydomain.com

with

Code:
$HOME/junk

You probably figured that out already but I just wanted to make sure. This only applies to users with a home directory. If they are mail only users with no login then obviously this method won't work.



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top