hi , my sendmail is compiled with logall.c
How I will block that sex keyword in the message body, subject or header.
thanks
Main Topics
Browse All Topicshello,
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.
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.
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.
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.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
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.
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-wo
LOCAL_CONFIG
D{LogAll}/var/log/mail.log
D{LoxMax}65535
F{LogBad}/etc/mail/bad-wor
3) Build and install a new cf file and restart sendmail
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-wor
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
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-wor
it wont work WHY is that ?
please advise.
that thing F{LogBad}/etc/mail/bad-wor
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 .
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?
also when i do the following it just block all my emails why is that
F{LogBad}/etc/mail/bad-wor
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.
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 !
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@sohaib69chvse9
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
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$ca4362
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
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
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.
Business Accounts
Answer for Membership
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.