1834450 Members
2219 Online
110067 Solutions
New Discussion

sendmail

 
SOLVED
Go to solution
Nobody's Hero
Valued Contributor

sendmail

Need a quick script liner to check to see if sendmail is running, if it is, get the version number.
UNIX IS GOOD
6 REPLIES 6
Rick Garland
Honored Contributor

Re: sendmail

ps -ef | grep mail
To see if mail is running

sendmail -d0
To get the version number
# sendmail -d0
Version 8.9.3 (PHNE_29774)
Compiled with: LDAPMAP MAP_REGEX LOG MATCHGECOS MIME7TO8 MIME8TO7
NAMED_BIND NDBM NETINET NETUNIX NEWDB NIS NISPLUS QUEUE SCANF
SMTP USERDB XDEBUG

============ SYSTEM IDENTITY (after readcf) ============
(short domain name) $w = odo
(canonical domain name) $j = odo.quantum.com
(subdomain name) $m = quantum.com
(node name) $k = odo
========================================================

Recipient names must be specified

(I break from this point to get back to prompt)
Gregory Fruth
Esteemed Contributor

Re: sendmail

If you do a:

sendmail -d0 < /dev/null

then it will return immediately and not
require you to break.

Assuming that the sendmail in
/usr/sbin/sendmail is the one that is
running, you can also get the version
number from:

what /usr/sbin/sendmail

Mark Greene_1
Honored Contributor

Re: sendmail

mailq -d and the version should be on the first line of the output.
the future will be a lot like now, only later
Steven E. Protter
Exalted Contributor
Solution

Re: sendmail

Shalom Robert,


sm=$(whence sendmail)
what $sm

Two lines, but it works well.

HP-UX only.

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
Sandman!
Honored Contributor

Re: sendmail

Yet another one-liner

# UNIX95= ps -Csendmail && sendmail -di
cheers!
Arturo Galbiati
Esteemed Contributor

Re: sendmail

Hi,
to check if sendmail is running:
ps -ef|grep [s]endmail
usuallu you sould receive:
root 17081 1 0 23:55:08 ? 0:58 sendmail: accepting connections on port 25

to check the version:
what $(whence sendmail)
/usr/sbin/sendmail:
Copyright (c) 1998 HEWLETT PACKARD COMPANY and its licensors,
including Sendmail, Inc., and the Regents of the
University of California. All rights reserved.
version.c 8.9.3.1 (Berkeley) 10/10/2003 (PHNE_29774)

It runs on HP-UX 11i

HTH,
Art