The schedule discover email notification couldn't be received, nhAutoDiscover -notify <mail addr> option seems broken.

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

Description:

Issue: Customer followed the KB: TEC513753 (Legacy KB ID CNC TS13308) to change the From Address for email notifications. The nhMail command works, and email can be received, but the nhAutoDiscover with -notify <mail addr> option doesn't work, email could not be received.

Fact: eHealth 6.2

Fact: eHealth 6.1

Fact: eHealth 6.0

Fact:

nhAutoDiscover works in the same way as nhMail to call mailx in Unix or nhiNtMail in Windows to send out email notification using default From address ehealth@ca.com. If customer needs to change the From address to comply with their mail server relaying restriction, they need to change the nhAutoDiscover script to specify the From address as well.

Solution:

The nhAutoDiscover script locates in $NH_HOME/bin directory.
Please rename the original file (.orig) and make a copy so that you can test the modified file. CA Support will not modify the file, or test your file, but we will continue to support your installation after this file has been modified, tested, and validated.

For Solaris Installs:
Modify the nhAutoDiscover file:

Change nhAutoDiscover to use mailx in the SunOS\5 section and add the -r <sender> flag (with the desired "from" email address) and the -t flag (used to tell mailx to scan existing headers for recipient addresses and preserve the existing message structure). Below is an example of how to change nhMail for Solaris.

#-----------------------------------------------------------------------------
#               mail results
#
#
mailResults ()
{
        if [ -n "$mailUser" ]; then
                case `uname -rs` in
                        Windows_NT*)
                                nhiNtMail - -t $mailUser -s 'eHealth Merge Log'
                                ;;
                        HP-UX*)
                                /usr/bin/mailx -s 'eHealth Merge Log' $mailUser
                                ;;
                        SunOS\ 5*)
                                /bin/mailx -t -s 'eHealth Merge Log' -r autodiscover@ca.com $mailUser
                                ;;
                esac
        fi
}


Used to be:

#-----------------------------------------------------------------------------
#               mail results
#
#
mailResults ()
{
        if [ -n "$mailUser" ]; then
                case `uname -rs` in
                        Windows_NT*)
                                nhiNtMail - -t $mailUser -s 'eHealth Merge Log'
                                ;;
                        HP-UX*)
                                /usr/bin/mailx -s 'eHealth Merge Log' $mailUser
                                ;;
                        SunOS\ 5*)
                                /bin/mailx -s 'eHealth Merge Log' $mailUser
                                ;;
                esac
        fi
}

For Windows Installs:

Modify the nhAutoDiscover.sh file:
Add the switch -f to the Windows_NT section, followed by the desired "from" email address. Put the address in single quotes, ' ', as the @ is a special character.

#               mail results
#
#
mailResults ()
{
        if [ -n "$mailUser" ]; then
                case `uname -rs` in
                        Windows_NT*)
                                nhiNtMail - -t $mailUser -s 'eHealth Merge Log' -f 'autodiscover@ca.com'
                                ;;
                        HP-UX*)
                                /usr/bin/mailx -s 'eHealth Merge Log' $mailUser
                                ;;
                        SunOS\ 5*)
                                /bin/mailx -s 'eHealth Merge Log' $mailUser
                                ;;
                esac
        fi
}

Used to be:

#               mail results
#
#
mailResults ()
{
        if [ -n "$mailUser" ]; then
                case `uname -rs` in
                        Windows_NT*)
                                nhiNtMail - -t $mailUser -s 'eHealth Merge Log'
                                ;;
                        HP-UX*)
                                /usr/bin/mailx -s 'eHealth Merge Log' $mailUser
                                ;;
                        SunOS\ 5*)
                                /bin/mailx -s 'eHealth Merge Log' $mailUser
                                ;;
                esac
        fi
}

Related Issues/Questions:
How to change the from field of SMTP email notification by Scheduled Discovery.
How to change the from email address in nhAutoDiscover.

Problem Environment:
Solaris
Windows
eHealth

Additional Information:
Ensure that the 'From' address specified is a valid active email address. If not, this will not work.