1840501 Members
2864 Online
110165 Solutions
New Discussion

Filter Sendmail

 
joe_91
Super Advisor

Filter Sendmail

Recently we had to shutdown the sendmail on one of our boxes so as to prevent unnecessary email to be sent to various people. We stopped sendmail and also moved the binary. Now they say the mail should run but you should filter it in such a way that there should not be unneccesary emails sent. I am totally confused, how wd you do it?

Thanks

Joe.
6 REPLIES 6
Steven E. Protter
Exalted Contributor

Re: Filter Sendmail

Shalom Joe,

You can use the sendmail access file as a filter.

For HP-UX this script with modification may be needed to activate the access file.

http://www.hpux.ws/buildmail.hpux.text

For more on access file syntax see:
http://www.sendmail.org

Search for access or access.db using their google search box.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
joe_91
Super Advisor

Re: Filter Sendmail

Good. So here are my questions. using access or access.db here are my questions.

1. Do we have the ability to filter e-mail in HP-UX where certain e-mail addresses can be exempt from receiving mail - yes or no?

2. If yes, how should we do it?

Thanks

Joe
Geoff Wild
Honored Contributor

Re: Filter Sendmail

In /etc/mail/access

userid@yourdomian.com ERROR:"553 reject...wrong email address..."

Thats a TAB between the email addy and the word "ERROR"

Then create the hash:

makemap hash /etc/mail/access
Then stop/start sendmail:

/sbin/init.d/sendmail stop
/sbin/init.d/sendmail start


Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
joe_91
Super Advisor

Re: Filter Sendmail

so just create this new access file unser /etc/mail and then vi that file and add these entries? also i am looking at a way where certain email address will not recive any emails at all from this machine..

ex: block all emails to john@abc.com, mike@abc.com etc..I mean block all emails from this machine. I think in your example it looks like i can block an email from a particular user to a particular user. I am looking to block all emails to a particular user.

Thanks

Joe

Geoff Wild
Honored Contributor

Re: Filter Sendmail

It is only to a single user...

Unless you want to block all:

To:yourdomain.com ERROR:"553 reject...."

But then you can accecpt say certain users:

you@yourdomain.com OK

Or reject individual users:

baduser@yourdomain.com ERROR:"553 reject...."


Rgds...Geoff


Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
joe_91
Super Advisor

Re: Filter Sendmail

Geoff/SEP:

Is this correct way.

1. Create a file called access in /etc/mail(touch /etc/mail/access)
2. edit the file and add the following

abc@domain.com OK(tab between email and OK)
(i am just putting the address of allthe people who want to accept the emails here)

3.makemap hash /etc/mail/access 4. sendmail stop/start.

After these steps will only the users who i have mentioned in the access file would receive emails? All other would be rejected?

That is what i want to acheive, accept certain users to recieve emails(say 10 users) and block all emails for the rest of them.

Thank you so much for the guidance..

Best Regards

Joe C