1833621 Members
3528 Online
110062 Solutions
New Discussion

Re: Stopping mailx

 
Timothy P. Jackson
Valued Contributor

Stopping mailx

I am currently doing some testing of a program that was written by someone else that uses mailx. I would just like to turn off mailx so that it will not send messages out while I am testing.

Is mailx part of sendmail? Can I just stop sendmail and that will turn off mailx?

Any help would be greatly appreciated!

Thanks,
Tim
7 REPLIES 7
Pete Randall
Outstanding Contributor

Re: Stopping mailx

Tim,

Yes, you could just stop sendmail but that's going to stop all messages. Couldn't you just comment out the mailx commmands?


Pete

Pete
renarios
Trusted Contributor

Re: Stopping mailx

Hi Tim,

A possibility is to create a global variable like MAIL_TARGET and give it the value of your own email address incase of testing and change it to the old email address in case of production. That way you can change it one place in the script.

Hope it helps,

Renarios
Nothing is more successfull as failure
Suraj Singh_1
Trusted Contributor

Re: Stopping mailx

Hi,

Stopping sendmail will stop all the communication through this machine. So u are sure that no other application uses sendmail, you may stop the sendmail daemon. Else the best thing (if u are unaware) is to COMMENT out the line containing "mailx".

Rgds
What we cannot speak about we must pass over in silence.
Florian Heigl (new acc)
Honored Contributor

Re: Stopping mailx

I'd simply use an alias for mailx like
alias mailx="echo mail with parameters $* >> /tmp/mailx.runs"

mailx is not really a component of sendmail (mail transfer agent), but just a small email program (mail user agent), so disabling it by the shell's means should be the easiest solution.
yesterday I stood at the edge. Today I'm one step ahead.
harry d brown jr
Honored Contributor

Re: Stopping mailx

Stopping sendmail will NOT STOP mailx from performing it's duty.

Try it:

[root@vpart3 /etc/mail]# /sbin/init.d/sendmail stop
Sendmail pid is 24536
Killing sendmail
Please wait .....
Sendmail killed.
[root@vpart3 /etc/mail]# ps -ef| ux2dos | uuencode bdf.txt|mailx -m -stest hbrown@devnull.com
[root@vpart3 /etc/mail]# ps -ef | grep sendmail
root 24593 2005 1 09:04:42 ttyp3 0:00 grep sendmail
[root@vpart3 /etc/mail]#


live free or die
harry d brown jr
Live Free or Die
Pete Randall
Outstanding Contributor

Re: Stopping mailx

Thanks Harry - I had a nagging doubt in the back of my mind about that so I just finished testing it so I could come back and correct my blunder, but you beat me to it!


Pete

Pete
harry d brown jr
Honored Contributor

Re: Stopping mailx

Pete,

What are friends for? :-)

live free or die
harry d brown jr
Live Free or Die