nixCraft Linux Forum

nixCraft

Linux / UNIX Tech Support Forum

Sendmail block email based on Body / Words

This is a discussion on Sendmail block email based on Body / Words within the Mail Servers forums, part of the Mastering Servers category; Hi. I'm using sendmail. I want to block mails contain a single word in access file e.g., example* REJECT sendmail ...

Register free or login to your existing account and remove all advertisements.


Go Back   nixCraft Linux Forum > Mastering Servers > Mail Servers

Linux answers from nixCraft.


Mail Servers Discussion on Postfix/Sendmail Mail servers and related program such as IMAP/POP3, Anti-Spam technologies.

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-17-2009, 04:31 AM
Senior Member
User
 
Join Date: Jul 2006
Posts: 145
Thanks: 0
Thanked 2 Times in 2 Posts
Rep Power: 4
asim.mcp is on a distinguished road
Default Sendmail block email based on Body / Words

Hi.

I'm using sendmail. I want to block mails contain a single word in access file

e.g., example* REJECT

sendmail block full email

example@example REJECT ... this works in access file but example* REJECT does not work.. any help please..


Regards
Asim
Reply With Quote
  #2 (permalink)  
Old 04-17-2009, 11:00 AM
nixcraft's Avatar
Never say die
User
 
Join Date: Jan 2005
Location: BIOS
OS: RHEL
Scripting language: Bash and Python
Posts: 2,672
Thanks: 11
Thanked 240 Times in 180 Posts
Rep Power: 10
nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute
Default

The access database defines what host(s) or IP addresses have access to the local mail server and what kind of access they have. So you cannnot use the same. You may need to use Procmail to filter how email based upon its body. Configure MTA to use procmail and add something as follows to your $HOME/.procmailrc

Code:
:0B
example *
 /dev/null
See the following more more info:
  1. ACS - Students - Procmail - a mail filtering agent
  2. Timo's procmail tips and recipes
__________________
Vivek Gite
Linux Evangelist
Be proud RHEL user, and let the world know about your enterprise choices! Join RedHat user group.
Always use CODE tags for posting system output and commands!
Do you run a Linux? Let's face it, you need help

Last edited by nixcraft; 04-17-2009 at 11:03 AM. Reason: .procmailrc example added
Reply With Quote
Reply

Tags
email , email filtering , procmail , sendmail , sendmail filtering


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads

Thread Thread Starter Forum Replies Last Post
Sendmail catch all email ephdia Mail Servers 0 03-09-2009 04:29 PM
How to Block Spam Mails in Sendmail ppnair Mail Servers 3 08-28-2008 01:06 AM
how to send mail body with multiple attachments amankhurana Shell scripting 1 04-07-2008 02:44 AM
How to send mail body with multiple attachments amankhurana Shell scripting 0 04-02-2008 11:34 AM
Sendmail control incoming email to accept, deny, or relay jerry All about FreeBSD/OpenBSD/NetBSD 1 06-22-2006 02:39 PM


All times are GMT +5.5. The time now is 01:03 PM.


Powered by vBulletin® Version 3.8.4 - Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2
©2005-2009 nixCraft. All rights reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38