Operating System - HP-UX
1830168 Members
5748 Online
109999 Solutions
New Discussion

Re: Sendmail need to block incoming mails

 
Ganesan R
Honored Contributor

Sendmail need to block incoming mails

Hi Freinds,

I need to block incoming mail for a particular user where that user can send only outgoing mails. We are using sendmail 8.9.3 with PHNE_35950. The steps I performed are below.
1.Using /usr/newconfig/etc/mail/cf/cf/gen_cf script, created new sendmail.cf.gen file and copied to /etc/mail/sendmail.cf to enable
the blocklist recipients feature.

2. Then I create the /etc/mail/access file manually and put the below entry.
# more /etc/mail/access
test@abc.com REJECT

3.Then I created database map using the below command
#makemap dbm /etc/mail/access < /etc/mail/access

4.Restarted the sendmail daemon.

But still the user "test" is receiving mail if i send test mail from root user.

# mailx test@abc.com
Subject: test mail
test mail
.
EOT
#

Your valuable advice pls..
Best wishes,

Ganesh.
9 REPLIES 9
Robert-Jan Goossens
Honored Contributor

Re: Sendmail need to block incoming mails

---
But still the user "test" is receiving mail if i send test mail from root user.

test@abc.com REJECT <--- external address
---
Thats internal mail, try to send a mail from an other server (external).
Ganesan R
Honored Contributor

Re: Sendmail need to block incoming mails

Hi Robert,

Thanks for your response.

I want to reject both internal as well as external mails.
Best wishes,

Ganesh.
Steven E. Protter
Exalted Contributor

Re: Sendmail need to block incoming mails

Shalom,

check the /var/adm/mail.log file and see if the traffic is even passing through the server in question.

It could be relayed through an smtp gateway elsewhere on the network.

Your configuration steps to date are correct. You could in addition try to block the traffic by hostname, if the user has a specific hostname.

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
Ganesan R
Honored Contributor

Re: Sendmail need to block incoming mails

Hi SEP,

This is the entry from /var/adm/syslog/mail.log

Aug 21 06:15:52 il06depo sendmail[15787]: GAA15787: from=root, size=162, class=0 , pri=30162, nrcpts=1, msgid=<200708211115.GAA15787@il06depo.corp.mot.com>, rela y=root@localhost
Aug 21 06:15:52 il06depo sendmail[15789]: GAA15787: to=test@il06depo.corp.mot.co m, ctladdr=root (0/3), delay=00:00:00, xdelay=00:00:00, mailer=local, stat=Sent

Here the host name is il06depo.corp.mot.com instead of abc.com
Best wishes,

Ganesh.
Philip Gunter
Respected Contributor

Re: Sendmail need to block incoming mails

Hi Ganesan,

the issue is likely to be your access file.

# more /etc/mail/access
test@abc.com REJECT
^^^

You need to use tabs to separate the fields.

You also should use the following syntax if you just want to block inbound emails. Just be careful as you'll have issues if email ever bounces.

To:test@abc.com REJECT

Cheers,
Philip.
Philip Gunter
Respected Contributor

Re: Sendmail need to block incoming mails

Oops forgot to add retain formatting

# more /etc/mail/access
test@abc.com REJECT
^^^

Aashique
Honored Contributor

Re: Sendmail need to block incoming mails

Hi,
you can try this way

vi /etc/mail/access
test@abc.com REJECT ( here no space, use tab)

then,
makemap hash access.db < access
Restart sendmail daemon

Hopefully it will work

Thanks & Regards

A.Aashique
Ganesan R
Honored Contributor

Re: Sendmail need to block incoming mails

Still no luck.

I have recreated the access file with in between the field(old file also same>

Then tried this also.
makemap hash access.db < access
Best wishes,

Ganesh.
Philip Gunter
Respected Contributor

Re: Sendmail need to block incoming mails

Hi Ganesan,

can you post your sendmail.cf?

Cheers,
Philip.