How to verify mail utilities are functioning correctly with nhMail
On a Unix system, eHealth uses the /bin/mail utility (which makes use of the /usr/lib/sendmail utility) to send mail
Note: By default, on Solaris, Sendmail logs it's activity to /var/adm/messages. To verify the proper log file, see /etc/syslog.conf. The following is an example of the default entry in syslog.conf:
To test if mail is functioning properly on the system, follow the procedure below.
- Open 2 command shells, and in the first type:
$ tail -f /var/adm/messages
- In the second shell, type the following:
nhMail <yourusername@domain name> $NH_HOME/nethealthrc.sh
Example: nhMail email@example.com nethealthrc.sh
In the first shell, sendmail will log a message similar to the following if the mail was handled successfully:
Jul 19 14:53:11 ohio sendmail: [ID 801593 mail.info] j6JIrAi09279: from=ehealth, size=5476, class=0, nrcpts=1,
Jul 19 14:53:11 ohio sendmail: [ID 801593 mail.info] j6JIrAi09279: firstname.lastname@example.org, ctladdr=ehealth (1002/10), delay=00:00:01, xdelay=00:00:00, mailer=relay, pri=125476, relay=mailhost.ca.com. [172.17.0.240], dsn=2.0.0, stat=Sent (j6JIqcM21168 Message accepted for delivery)
If the second line reports anything besides "Message accepted for delivery", contact your system administrator to fix the mail configuration on the system.
If you do not receive an email after running the following command:
nhMail email@example.com [name] [filename]
then follow the procedure below.
On a Windows server, eHealth uses %NH_HOME%\bin\nhMail.bat, which calls %NH_HOME%\bin\nhMail.sh, which then calls %NH_HOME%/bin/sys/nhiNtMail.exe.
The SMTP server (Mail relay) is defined in the NH_NT_SMTP_SERVER environment variable. Often, this variable is either misconfigured or not configured (please see Defining the SMTP server)
If email is not working after confirming the NH_NT_SMTP_SERVER variable, run the following command:
For Usage type: nhiiNtMail -h
- From a command prompt type:
nhiNtMail filename -t firstname.lastname@example.org -v
An example of the output is shown below:
Recv: 220 mailserver.ca.com ESMTP Sendmail Switch-2.2.8/Switch-2.2.6; Tue, 31 July 2005 18:41:22 -0500 (EST)
send: HELO pc.ca.com
Recv: 250 mailserver.ca.com Hello dhcp1103.ca.com [10.150.100.3] (may be forged), pleased to meet you
send: MAIL FROM:<email@example.com>
Recv: 250 2.1.0 <firstname.lastname@example.org>... Sender ok
send: RCPT TO:<email@example.com>
Recv: 250 2.1.5 <firstname.lastname@example.org>... Recipient ok
Recv: 354 Enter mail, end with "." on a line by itself
send: Return-Path: email@example.com
send: Subject: test
send: Date: Tue, 31 July 2005 18:42:14 PM EST
send: From: firstname.lastname@example.org
send: To: email@example.com
Recv: 250 2.0.0 i0RNfMV01018 Message accepted for delivery
Recv: 221 2.0.0 mailserver.ca.com closing connection
If there is a problem with the file, the local delivery agent, sender/recipient address, or mail relay, the output will reveal where the problem lies.