Operating System - Linux
1828144 Members
2773 Online
109975 Solutions
New Discussion

For Blocking Sendmail Users for sending mails

 
SOLVED
Go to solution
Sachin_48
Occasional Advisor

For Blocking Sendmail Users for sending mails

Hi All,

I want to block some users automatically and to unblock them also but without using the /etc/mail/access file .

Can somebody tell me what should I do
Or what are the available options for blocking the users for mail access.

Pls revert.

Thanks
Sachin Rajput
HCL
===============
5 REPLIES 5
Andrea Rossi
Frequent Advisor

Re: For Blocking Sendmail Users for sending mails

Maybe you want users to neither access their mailbox, isn't it? This doesn't concern sendmail, but, say, imap or pop3 daemon.
Steven E. Protter
Exalted Contributor

Re: For Blocking Sendmail Users for sending mails

Shalom,

#!/bin/sh


TARGET=$1

/sbin/iptables -I INPUT -s $TARGET -j DROP


Make target the IP address of the offending user.

The way to block mail is to use the access file.

I can provide you a script that will modify it with relative ease. Interested?

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
Sachin_48
Occasional Advisor

Re: For Blocking Sendmail Users for sending mails

Dear Steven,

You pls give me that script also .

And pls tell me if there is any other way .

I can block users using /etc/pam.d/smtp but unable to revert them back by removing the same entries.


Thanks
Sachin Rajput
====================
Ivan Ferreira
Honored Contributor

Re: For Blocking Sendmail Users for sending mails

Probably, you can use SMPT AUTH like in this example:

http://www.jonfullmer.com/smtpauth/

To send a mail, users must authenticate using their accounts, so, if yo lock the account with "usermod -L", they won't be able to send mails.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Steven E. Protter
Exalted Contributor
Solution

Re: For Blocking Sendmail Users for sending mails

Shalom,

Sorry I'm late with this, I had to take out my customizations:


newaliases
cd /etc/mail
makemap -r -v hash access.db < access
makemap -r -v hash domaintable.db < domaintable
makemap -r -v hash genericstable.db < genericstable
makemap -r -v hash mailertable.db < mailertable
makemap -r -v hash virtusertable.db < virtusertable
cp /etc/mail/sendmail.cf /root
m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf

You place your entries in the access file

192.168.0.10 554 Not permitted,
192.168.0.20 RELAY
192.168.0.30 OK

Run the above script and you have blocked sendmail.

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