How to verify mail utilities are functioning correctly with nhMail

Document ID : KB000023179
Last Modified Date : 14/02/2018
Show Technical Document Details

Introduction: 

How to verify mail utilities are functioning correctly with nhMail

Environment:  

eHealth

Instructions: 

UNIX

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:

        *.err;kern.debug;daemon.notice;mail.crit        /var/log/messages

To test if mail is functioning properly on the system, follow the procedure below.

  1. Open 2 command shells, and in the first type: 

    $ tail -f /var/adm/messages

  2. In the second shell, type the following:

    nhMail <yourusername@domain name> $NH_HOME/nethealthrc.sh           

    Example:  nhMail popeye@ca.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[9279]: [ID 801593 mail.info] j6JIrAi09279: from=ehealth, size=5476, class=0, nrcpts=1,
msgid=<200507191853.j6JIrAi09279@ohio.ca.com>, relay=ehealth@localhost

Jul 19 14:53:11 ohio sendmail[9281]: [ID 801593 mail.info] j6JIrAi09279: to=popeye@ca.com, 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.

----------------------

Microsoft Windows

If you do not receive an email after running the following command:

 

nhMail yourusername@domain.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

  1. From a command prompt type:

    nhiNtMail   filename -t user@ca.com -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:<popeye@ca.com>
Recv: 250 2.1.0 <popeye@ca.com>... Sender ok
send: RCPT TO:<popeye@ca.com>
Recv: 250 2.1.5 <popeye@ca.com>... Recipient ok
send: DATA
Recv: 354 Enter mail, end with "." on a line by itself
send: Return-Path: popeye@ca.com
send: Subject: test
send:
send: Date: Tue, 31 July 2005 18:42:14 PM EST
send: From: popeye@ca.com
send: To: popeye@ca.com
send:
send:
.
Recv: 250 2.0.0 i0RNfMV01018 Message accepted for delivery
>: Q.UIT
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.