Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
And now if you actually tell us what you're trying to do, version/distro of Linux, and exactly WHAT is not working, and what error(s) you're seeing, we can perhaps help.
I am using CentOS 5 and trying to block certain mails in sendmail depending on subject of mail
Thanks
You don't need to mess with sendmail.cf.
If you use spamassassin or some other spam filtering software, you can create a custom rule to block mail based on the subject.
Or you can use procmail to filter mail based on subject. Create a ~/.procmalrc like this (replace <Offending subject> with the subject you want to filter out):
While you shouldn't mess with sendmail.cf directly, you can just add the following to your sendmail.mc and then "./Build sendmail.cf" and "./Build install-cf":
While you're mucking around with sendmail.mc, you should consider putting in a few blacklist lines:
Code:
FEATURE(`dnsbl', `dnsbl.njabl.org' `Rejected - see http://dnsbl.njabl.org/')
FEATURE(`dnsbl', `black.uribl.com' `Rejected - see http://www.uribl.com/')
FEATURE(`dnsbl', `sc.surbl.org' `Rejected - see http://www.surbl.org/')
FEATURE(`dnsbl', `zen.spamhaus.org', `Message from $&{client_addr}rejected see zen.spamhaus.org') dnl
FEATURE(`dnsbl', `dul.dnsbl.sorbs.net', `Message from $&{client_addr} rejected see dul.dnsbl.sorbs.net') dnl
You have to build the file "/etc/mail/BAD-SUBJECTS" with periods between character strings because a space is a token delimiter,
For more info, look at the knecht.mc file in sendmail-8.14.4/cf/cf, look at 4.3.3.1 and 4.3.3.5 in The Bat Book, or do this:
Code:
mail:~/Downloads/sendmail-8.14.4/doc/op$ GROFF_NO_SGR=1; export GROFF_NO_SGR
:~/Downloads/sendmail-8.14.4/doc/op$ make op.txt
vi op.txt and look for Define.Header. There is a section on the "H line" there.
You should know that blocking spam using "Subject:" line strings is like playing Whack-A-Mole at the state fair. As others have written here, use spamassassin. It has tons of plugins and there are community-based rules that you can fetch and experiment with.
Nice one, agentbuzz. Like alot of others, I do my filtering further downstream, but it's nice to have a solution that uses sendmail directives directly. There is a special dark art to configuring it.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.