can we block mails with perticular subject line

Raj rajlinux at
Fri Jun 23 08:00:55 IST 2006

Hi everyone.
really thx for your replays,

I think i found the solution to block or redirect the mails with particular
words in the subject line.


YES ......It is possible on sendmail.
i used scripts on MDA( message deliver agent) which is procmail on my

I will explain how, May some one can benefit out this.

I made a simple script inside ~/.procmailrc on each user.

* ^Subject:.*\fuck

* ^Subject:.*\sex

This will move mails with fuck & sex on the subject line from inbox to SPAM
folder for each user in the sendmail.There are many thing possible on
procmail you can even send these mails to any other user as if mailscanner
is sending a warning to a superuser.

for that u have to give

 * ^Subject:.*fuck
                  :0 c
                  !trackspam at


where fuck is the bad word & trackspam is the user to monitor the mails.

by carefully inspecting procmail many things are possible , u can even
manipulate mails with words in the message body or perticular attachment and
so on.

so try your own scripts which suites your company & infrastructure.

But still i am facing some problem, what happened is i got nearly 80 users &
if i want to implement this i have to copy these files to all home directory
on each & every user.
The same scripts didn't worked when i put inside /etc/procmailrc.

I am trying to find a solution, if any one got please help me out.

On 6/21/06, Raj <rajlinux at> wrote:
> Can we block any particular subject line in MailScanner
> i mean if subject have words like Viagra, sex, fuck etc.. can we block
them ?
> MailScanner is working very well blocking with extension like *.exe.
> I am facing too many problem with spams these days. Some time
> spamassassin fails to recognise the spams. So can we block them with
> its subject line.
> it is possible on qmail by QTRAP. it blockes mails with customised words.
> i gone through docs of MS, But fails to find such function out of it.
> If this is possible on MS that will be great.
> --
> Regards
> Rajeev Sekhar
> ph 9822751120

Rajeev Sekhar
ph 9822751120
-------------- next part --------------
An HTML attachment was scrubbed...

More information about the MailScanner mailing list