Question

Email Blocking using keyword

Asked by: sohaib69

hello,

Is there any one who can help me in blocking email by using a keyword either in access file or any other help.

like if I wanted to block sex as an keyword how I am going to do that , is there any extra settings Ihave to do in my sendmail I am running RH7.2 please help, I am not intrested in using spamassasin any help rather than that software.

Thanks.

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2003-07-02 at 09:16:30ID20666518
Tags

email

Topic

SendMail Email Server

Participating Experts
2
Points
0
Comments
29

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. Block Sex Word In All incoming Emails
    Dear Sir. Is there anyway, I can block word sex or any other bad word, so that who ever wants to send any email with a word sex, in the subject or the body of the message they got blocked or got denied in sending me an email, I am using sendmail-8.9.3-15 Please let me know ...
  2. Keyword
    Hi I have a form with a field "Description". I want to ensure that this always has a recognised keyword as part of the description. I do not want to limit the user to a drop down list. Is there a way to achieve this? preferably with a table holding all the keywo...
  3. Blocking Keywords using access db
    Back to the ultimate resource for linux questions :) I'm currently running a sendmai server with fedora core 1 yarrow and sendmail 8.12 I'm using the rbl feature of the sendmail config along with blocking and allowing domains through the access db file. What i'm wondering ...
  4. synchronized keyword
    Hi, anyone have any idea what does the synchronized keyword means and wad it does? Thanks

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: jleviePosted on 2003-07-02 at 10:12:19ID: 8842198

Sendmail is only going to look at sender/recipient address/IP information. While you could create a custom cf rule to examine the Subject:, I suspect that your more interested in the body of message. And for that you need something like SpamAssassin, a libmilter filter, or a keyword list to logall.c. In each of these cases you are going to have to add something to your Sendmail server.

 

by: sohaib69Posted on 2003-07-02 at 10:16:10ID: 8842230

hi , my sendmail is compiled with logall.c

How I will block that sex keyword in the message body, subject or header.

thanks

 

by: jleviePosted on 2003-07-02 at 10:48:06ID: 8842477

How to use this feature is described in the comments at the beginning of logall.c, but in brief you could do something like:

1) Create a file containing a list of key words, say /etc/mail/bad-words.

2) Add 'F{LogBad}/etc/mail/bad-words' to your mc file where you enable logging, something like:

LOCAL_CONFIG
D{LogAll}/var/log/mail.log
D{LoxMax}65535
F{LogBad}/etc/mail/bad-words

3) Build and install a new cf file and restart sendmail

 

by: sohaib69Posted on 2003-07-02 at 10:59:23ID: 8842571

hi i created that file in /etc/mail/bad-words
chmod 777 /etc/mail/bad-words

than i enter

viagra
sex

save that file and then enter that in sendmail.cf

F{LogBad}/etc/mail/bad-words
D{LogAll}/var/log/mail.log

restart sendmail i send one test email to my self with sex as an subject and in that message body the email arrive in my inbox as well as i saw that email in that log file too.

tks

 

by: jleviePosted on 2003-07-02 at 13:37:35ID: 8843891

Did you also include a D{LogMax}nnnn definition (I see I mispelled it above, sorry)? Rejecting won't happen on a keyword match unless there's a LogMax directive in addition to a LogBad directive. See the comments at the top of logall.c for more information.

 

by: sohaib69Posted on 2003-07-02 at 14:50:53ID: 8844388

it worked fine

D{LogAll}/var/log/mail.log
D{LogMax}5242880
C{LogBad}penis (Edited by Computer101) viagra penis enlargement mortgage (Edited by Computer101)

now tell me this

i set that LogMax to
D{LogMax}5242880


but honestly speaking I didnt understand that D{LogMax}5242880

I wanted to be sure what exactly it do, is that mean like it will SCAN message or attachment for that amount of size if the size is higher than that it will still scan it or leave it Or

Is that mean like it will only send email limited to that 65535 bytes ONLY and scan attachment and mail .

Also when I run that F{LogBad} sex viagra

it will work but when i run like
F{LogBad}/etc/mail/bad-words

it wont work WHY is that ?

please advise.

 

by: sohaib69Posted on 2003-07-02 at 14:53:28ID: 8844401

that thing F{LogBad}/etc/mail/bad-words work fine cos i was running that with C now please inform me regarding

i set that LogMax to
D{LogMax}5242880


but honestly speaking I didnt understand that D{LogMax}5242880

I wanted to be sure what exactly it do, is that mean like it will SCAN message or attachment for that amount of size if the size is higher than that it will still scan it or leave it Or

Is that mean like it will only send email limited to that 65535 bytes ONLY and scan attachment and mail .

 

by: sohaib69Posted on 2003-07-02 at 15:36:58ID: 8844658

i also notice one thing that it just block all my emails:(

why is that.

 

by: jleviePosted on 2003-07-02 at 15:40:03ID: 8844677

That sets the max message size that will be logged, and hence the max message size that will be
scanned for keywords. Since the keyword filter is very simple it doesn't understand the difference
between the text body of a message and any included binary attachment and will happily scan all of
it. This leads to a lot of legitimate mail being rejected because it has 'sex' or whatever as a part of
character string that represents the Base64 or UUencoded attachment.

So what you want to do is limit the max message size that will be logged (and scanned) to something
unlikely to contain an attachment, 65kb being a reasonable value. This has the unfortunate side affect
of not logging everything.

It's these sorts of reasons that really push you towards something like Spamassassin, which does
understand the structure of a multi-part message and knows not to look into any encoded binary
attachments. Out of curosity, what is your objection to using Spamassassin?

 

by: sohaib69Posted on 2003-07-03 at 09:50:40ID: 8850862

also when i do the following it just block all my emails why is that


F{LogBad}/etc/mail/bad-words


when i do like
C{LogBad}penis sex (Edited by Computer101) viagra penis enlargement mortgage (Edited by Computer101)

it worked fine so why its not getting that file I dont understand that , i change the permission to 777 in that file but still it just never sendany email to myself even its a clean and clear email.

 

by: jleviePosted on 2003-07-03 at 10:40:19ID: 8851298

Are any errors being logged when you attempt to use the file?

 

by: sohaib69Posted on 2003-07-03 at 11:07:29ID: 8851541

I check my maillog and I got this

Jul  3 23:06:49 ns1 sendmail[18361]: h63I6nQ18361: h63I6nR18361: return to sender: Service unavailable
Jul  3 23:06:49 ns1 sendmail[18361]: h63I6nR18361: to=root, delay=00:00:00, xdelay=00:00:00, mailer=local, pri=30100, dsn=5.7.1, sta
t=Service unavailable
Jul  3 23:06:49 ns1 sendmail[18361]: h63I6nQ18361: Losing ./qfh63I6nQ18361: savemail panic
Jul  3 23:06:49 ns1 sendmail[18361]: h63I6nQ18361: SYSERR(root): savemail: cannot save rejected email anywhere

I dont understand that , what that means !

 

by: jleviePosted on 2003-07-03 at 11:32:41ID: 8851769

I guess i should have made that more clear. Are any errors being logged when sendmail starts if you configure it to use a keyword file?

 

by: sohaib69Posted on 2003-07-03 at 12:13:13ID: 8852055

no errors while restarting sendmail , it restart fine

[root@ns1 root]# service sendmail restart
Shutting down sendmail: [  OK  ]
Starting sendmail: [  OK  ]
[root@ns1 root]#

 

by: sohaib69Posted on 2003-07-03 at 12:18:15ID: 8852086

no errors while restarting sendmail , it restart fine

[root@ns1 root]# service sendmail restart
Shutting down sendmail: [  OK  ]
Starting sendmail: [  OK  ]
[root@ns1 root]#

 

by: jleviePosted on 2003-07-03 at 13:37:08ID: 8852592

Are there any errors in the logfile right after sendmail starts.

 

by: sohaib69Posted on 2003-07-03 at 13:42:18ID: 8852621

what error log file

in that /etc/httpd/conf/error_log

or in /var/log/maillog

 

by: jleviePosted on 2003-07-03 at 13:49:14ID: 8852659

/var/log/maillog is where sendmail would log any errors.

 

by: sohaib69Posted on 2003-07-03 at 13:57:41ID: 8852702

Jul  4 01:55:22 ns1 sendmail[5164]: h63KTEt02217: Losing ./qfh63KTEt02217: savemail panic
Jul  4 01:55:22 ns1 sendmail[5164]: h63KTEt02217: SYSERR(root): savemail: cannot save rejected email anywhere
Jul  4 01:55:44 ns1 sendmail[5169]: h63Ktgr05169: from=<Sohaib@DOMAIN.COM>, size=2532, class=0, nrcpts=1, msgid=<014801c341a5$90b954
60$829cfea9@sohaib69chvse9bu9q>, proto=SMTP, daemon=MTA, relay=[202.154.254.58]
Jul  4 01:55:44 ns1 sendmail[5170]: h63Ktgr05169: to=<Sohaib@DOMAIN.COM>, delay=00:00:02, xdelay=00:00:00, mailer=local, pri=32032,
dsn=5.7.1, stat=Service unavailable
Jul  4 01:55:44 ns1 sendmail[5170]: h63Ktgr05169: h63Ktir05170: DSN: Service unavailable
Jul  4 01:55:44 ns1 sendmail[5170]: h63Ktir05170: to=<Sohaib@DOMAIN.COM>, delay=00:00:00, xdelay=00:00:00, mailer=local, pri=30100,
dsn=5.7.1, stat=Service unavailable
Jul  4 01:55:44 ns1 sendmail[5170]: h63Ktir05170: h63Ktis05170: return to sender: Service unavailable
Jul  4 01:55:44 ns1 sendmail[5170]: h63Ktis05170: to=root, delay=00:00:00, xdelay=00:00:00, mailer=local, pri=30100, dsn=5.7.1, stat
=Service unavailable
Jul  4 01:55:44 ns1 sendmail[5170]: h63Ktir05170: Losing ./qfh63Ktir05170: savemail panic
Jul  4 01:55:44 ns1 sendmail[5170]: h63Ktir05170: SYSERR(root): savemail: cannot save rejected email anywhere
Jul  4 01:55:47 ns1 qpopper[5171]: (v4.0.5) Timing for admin@202.154.254.58 (normal) auth=0 init=0 clean=0
Jul  4 01:55:50 ns1 qpopper[5173]: (v4.0.5) Timing for sohaib@202.154.254.58 (normal) auth=0 init=0 clean=0

 

by: jleviePosted on 2003-07-03 at 14:36:44ID: 8852890

I don't see where sendmail was restarted in that part of the log, which is what I'm interested in. You need
to restart sendmail and look at the tail end of the maillog to see if there are any startup errors.

 

by: sohaib69Posted on 2003-07-03 at 14:49:01ID: 8852961

This is what I got :-


Jul  4 02:47:30 ns1 sendmail[9470]: h63LlFr09470: from=<Sohaib@Domain.com>, size=2532, class=0, nrcpts=1, msgid=<01b201c341ac$ca4362a0$829cfea9@wcwschvse9bu9q>, proto=SMTP, daemon=MTA, relay=[202.154.254.58]
Jul  4 02:47:30 ns1 sendmail[9472]: h63LlFr09470: to=<Sohaib@Domain.com>, delay=00:00:11, xdelay=00:00:00, mailer=local, pri=32032, dsn=5.7.1, stat=Service unavailable
Jul  4 02:47:30 ns1 sendmail[9472]: h63LlFr09470: h63LlUr09472: DSN: Service unavailable
Jul  4 02:47:30 ns1 sendmail[9472]: h63LlUr09472: to=<Sohaib@Domain.com>, delay=00:00:00, xdelay=00:00:00, mailer=local, pri=30100, dsn=5.7.1, stat=Service unavailable
Jul  4 02:47:30 ns1 sendmail[9472]: h63LlUr09472: h63LlUs09472: return to sender: Service unavailable
Jul  4 02:47:30 ns1 sendmail[9472]: h63LlUs09472: to=root, delay=00:00:00, xdelay=00:00:00, mailer=local, pri=30100, dsn=5.7.1, stat=Service unavailable
Jul  4 02:47:30 ns1 sendmail[9472]: h63LlUr09472: Losing ./qfh63LlUr09472: savemail panic
Jul  4 02:47:30 ns1 sendmail[9472]: h63LlUr09472: SYSERR(root): savemail: cannot save rejected email anywhere

 

by: jleviePosted on 2003-07-03 at 18:16:33ID: 8853748

The messages I'm looking for might look something like:

Jul  3 20:15:35 chaos sendmail[1730]: alias database /etc/aliases rebuilt by jim
Jul  3 20:15:35 chaos sendmail[1730]: /etc/aliases: 40 aliases, longest 10 bytes, 395 bytes total
Jul  3 20:15:36 chaos sendmail[1743]: starting daemon (8.11.6): SMTP+queueing@01:00:00

 

by: sohaib69Posted on 2003-07-03 at 22:07:23ID: 8854355

I didnt get any of that message the error message I got I paste it above.

 

by: jleviePosted on 2003-07-04 at 05:21:00ID: 8856048

Those log messages will only be produced when sendmail is started. So it is necessary to restart
sendmail and then look for them.

 

by: sohaib69Posted on 2003-07-04 at 05:32:20ID: 8856111

i think i mention that before that I didnt GOT any error while restarting MY SENDMAIL, my sendmail restarted just fine with no error also Idid that tail -f maillog and the only error I got I mention it above .

 

by: jleviePosted on 2003-07-04 at 09:21:08ID: 8857434

The only thing I've seen is that the sendmail init script indicates that it started sendmail. That doesn't
mean that it completly started up correctly or that it didn't die after starting. If there are any errors
associated with the start of sendmail they will be logged in maillog. And if you don't see a startup
message logged, that would be a clue that sendmail is failing to start.

To see what is happening, you can do a 'service sendmail stop' and them manually start it with
'/usr/sbin/sendmail -bd -q10m' and see if it complains.

 

by: sohaib69Posted on 2003-07-04 at 09:28:06ID: 8857470

no it didnt complains anything

 

by: jleviePosted on 2003-07-05 at 11:32:21ID: 8861194

I don't know what's going wrong. Is there a running copy of sendmail? Check with 'ps -ef | grep sendmail | grep -v grep'

 

by: SpideyModPosted on 2003-07-05 at 13:13:34ID: 8861576

Administrative Action - PAQ'd and points NOT refunded.

SpideyMod
Community Support Moderator @Experts Exchange

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...