Operating System - HP-UX
1833059 Members
2838 Online
110049 Solutions
New Discussion

Re: Sendmail mail should display only internal mails?

 
Irfan Ahmed_1
Advisor

Sendmail mail should display only internal mails?

Hi gurus,
I am new to sendmail concepts. I want to change sendmail configurations such that sendmail should not send/receive any mail from/to other systems. But as cronjobs are not having a display to send output to, the meachnism is, that stdout is sent via email. So sendmail should be able to accept message from a cronjobs on its own system.

Can anyone help me to know how can I do this?

Thanks
-Irfan
10 REPLIES 10
Steven E. Protter
Exalted Contributor

Re: Sendmail mail should display only internal mails?

sendmail is a mail transfer system. You can limit mail sources but not totally stop them without totally disabling your boxex networking.

vi
/etc/rc.config/mailservs

change the first variable from 1 to 0.

save the file

/sbin/init.d/sendmail stop

This will stop most inbound mail. However as long as port 25 is open its possible for other sendmail servers to push mail to your system.

Further, any user on the system with a command line can send mail to other uesrs on the system or other systems with tools provided with the OS like mail and elm.

If you disable the sendmail binary or remove the software then cron can't send mail either.

To learn the wonders of sendmail: http://www.sendmail.org

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
Sridhar Bhaskarla
Honored Contributor

Re: Sendmail mail should display only internal mails?

Hi Ifran,

If I understood your message correctly, you don't need to do anything special. Even if 'sendmail' daemon is not running, 'local mail' will still get deposited on the box. So, your crontab outputs should get mailed to the local account unless it is terribly messed up like .forward, vacation etc., that are not setup correctly.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Irfan Ahmed_1
Advisor

Re: Sendmail mail should display only internal mails?

Thanks for the reply.
As you said disabling the sendmail demon will not have any effect on transfer of local mails. It can be done using the binary file.
I checked out my cronjobs which sends output through mail. They are using mailx instead of sendmail.

Now a doubt came to my mind.
How is mailx different from mailx?

Regards
-Irfan
Irfan Ahmed_1
Advisor

Re: Sendmail mail should display only internal mails?

Thanks for the reply.
As you said disabling the sendmail demon will not have any effect on transfer of local mails. It can be done using the binary file.
I checked out my cronjobs which sends output through mail. They are using mailx instead of sendmail.

Now a doubt came in my mind.
How is mailx different from sendmail?

Regards
-Irfan
Sridhar Bhaskarla
Honored Contributor

Re: Sendmail mail should display only internal mails?

Irfan,

'mailx', 'mail', 'elm' etc are merely clients that can read the mail that is already received and handover the mail to 'sendmail' that is to be sent out. 'sendmail' will be invoked when mail is sent. In order for you to receive the mail on the box from remote systems, you will need to have sendmail running in daemon mode attached to port 25.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Irfan Ahmed_1
Advisor

Re: Sendmail mail should display only internal mails?

Hi Shridhar,
Thanks once again. Sorry to trouble you.
I executed mailx again by doing this.

chmod 444 /usr/sbin/sendmail
cat file_name | mailx -s "subject" root

Also I have stopped the sendmail demon.

Even now I am able to receive message.
If mailx uses sendmail, then how am I able to receive the message.

Regards
-Irfan
Sridhar Bhaskarla
Honored Contributor

Re: Sendmail mail should display only internal mails?

What can I say?. that's a good observation. mailx does use mail|rmail as alternative sendmail and they have the capability to append to the user's inbox. Try changing the permissions of 'rmail' and 'sendmail' together.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Irfan Ahmed_1
Advisor

Re: Sendmail mail should display only internal mails?

Hi Shridhar,
According to my understanding - mail,mailx,mailr all these are User Agents. They does almost the same activity with slight difference.
But sendmail is a Transfer agent.

Regards
-Irfan
Sridhar Bhaskarla
Honored Contributor

Re: Sendmail mail should display only internal mails?

You are right. But mail|rmail also have the capability to append to local user's inboxes. Look at the man pages for more information.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Bharat Katkar
Honored Contributor

Re: Sendmail mail should display only internal mails?

I irfan find attached doc on Sendmail Operations. Hope that clear your doubt.
Regards,
You need to know a lot to actually know how little you know