- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- sendmail check
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-26-2008 06:33 AM
тАО03-26-2008 06:33 AM
sendmail check
i want to reorganize sendmail logfile "mail.log" in a script. so i stop sendmail, copy "mail.log" to a directory and start sendmail.
how can i check, if sendmail runs ?
i found some solutions, but in some cases, i have to install GNU products (which have a lot of Run-time dependencies) :
- lsof -i :25
- nmap -v -p 25 -sT localhost
- netstat -an |grep
- telnet localhost 25 <<
EO^]
close
EOF
what is the best way to check sendmail ?
regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-26-2008 07:12 AM
тАО03-26-2008 07:12 AM
Re: sendmail check
/sbin/init.d/sendmail stop -and-
/sbin/init.d/sendmail start
to stop/start sendmail. If so, it shouldn't be an issue.
You might also simply examine the return code from the start command with *?. I believe it will return a non-zero if there are problems.
Two other alternatives:
UNIX95= ps -C sendmail -ocomm= | wc -l
should be 1 if sendmail is running,
or you might look at the section of code in the start-up script that is used to check the status:
pidfile="/etc/mail/sendmail.pid"
if [ -f $pidfile ]; then
test "$pidfile" && exec 0< $pidfile
read -r PID
sendserv=`ps -e | grep -E "^ [ ]*$PID .*sendmail" | wc -l`
if [ $sendserv -ne 0 ]; then
set_return
echo "sendmail has already been started"
exit $rval
fi
fi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-26-2008 07:18 AM
тАО03-26-2008 07:18 AM
Re: sendmail check
How?
> how can i check, if sendmail runs ?
Did anything go wrong when you started it?
Trying to send and receive e-mail is a pretty
good test.
You could look at that new log file, too.
"ps" could show you if there's a program
named "sendmail" running.
All those commands which mention "25" are
intended to tell you if anyone is listening
to the SMTP port (25). Sendmail should do
that.
> what is the best way to check sendmail ?
Best in what sense? Easiest? Most complete
and reliable? Checking actual e-mail
capability is probably the most realistic
test. Everything else is probably easier.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-26-2008 08:49 AM
тАО03-26-2008 08:49 AM
Re: sendmail check
> UNIX95= ps -C sendmail -ocomm= | wc -l
> "ps" could show you if there's a program
> named "sendmail" running.
Note that this tells you if there's _a_
program named "sendmail" running. It does
not tell you if _the_ "sendmail" program is
running.
Why do you care if sendmail is running?
Why do you run sendmail?
If you run sendmail to handle e-mail, then
the real question is, "Does e-mail work?",
and the best test for that is a real e-mail
test. Anything else you test will give you
only an approximation of what you really wish
to know.
Now, if, for some reason, you can't run a
real e-mail test, then you may need to fall
back to some less informative test, but it's
good to know why you're testing what you're
testing, and what your test really tells you
(and what it doesn't).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-26-2008 11:52 PM
тАО03-26-2008 11:52 PM
Re: sendmail check
i know the problematic of "sendmail" and that it isn't possible to check whether a mail arrives the receiver (i can only search mail.log?) we had some cases that sendmail hung. this it what we want to check. and when a process runs, you can't say the process work's?
so we want to make a check :
- process exists
- process exists and works
but we don't want to send a email.
sendmail is our programm to send mail from unix to other destinations !
regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-27-2008 12:46 AM
тАО03-27-2008 12:46 AM
Re: sendmail check
> unix to other destinations !
You might try to arrange for a different
system to forward e-mail back to the system
being tested. For example:
On the test system, send an e-mail test
message to "mirror@reliable_system".
Arrange for e-mail to "mirror" arriving at
reliable_system to be forwarded (back) to,
say, "tester@test_system".
If the test message is not received by
"tester" on test_system, then there's a
problem somewhere. If it is received, then
you can be pretty sure that sendmail is
working properly on test_system.
It's been a long time since I've cared, but,
as I recall, you can rig an e-mail alias to
run a program when a message arrives for a
user (like "tester"), so you might not need
to log in manually as "tester" just to check
his e-mail.
In fact, you could rig things so that if the
test message didn't return, an e-mail
message would get sent to the system manager.
Of course, this might not work either, so
you might need to be a bit more clever than
that. ("Let me know if you don't receive
this message.") But many things are
possible.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-27-2008 01:30 AM
тАО03-27-2008 01:30 AM
Re: sendmail check
Most corporate mail systems is DSrelayserver configuration in sendmail.cf to relay mail via smtp relay hosts.
It is rare that a Unix system is permitted to simply resolve the domain name and deliver mail.
Note that you need not run the sendmail daemon to merely send outbound mail. You need the sendmail daemon to receive mail on a system.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com