nhMail sending PDF's in MIME format instead of attachments (Legacy KB ID CNC TS34531 )
search cancel

nhMail sending PDF's in MIME format instead of attachments (Legacy KB ID CNC TS34531 )

book

Article ID: 51720

calendar_today

Updated On:

Products

CA eHealth

Issue/Introduction

When modifying nhMail, make sure to add the -t flag to mailx syntax in the SunOS\5 section.
The "-t" flag is used to tell mailx to scan existing headers for recipient addresses and preserve the existing message structure of the message If this is not used mailx will produce MIME multipart that Outlook client cannot parse correctly.
Below is an example of how to change nhMail for Solaris.
Make a copy of the original nhMail.sh
Then change nhMail to use mailx in the SunOS\5 section and add the -r <sender> flag (with the desired "from" email address) and the -t flag.


From:


 mailResults ()
{
        if [ -n "$mailUser" ]; then
                case `uname -rvs` in
                        Windows_NT*)
                                exec 2>/dev/nul
                                nhiNtMail - -t $mailUser -penguin
                                ;;
                        HP-UX*)
                                /bin/mail $mailUser
                                ;;
                        SunOS\ 5*)
                                /bin/mail $mailUser 
                                ;;
                        AIX\ [2-9]\ 4)
                                /bin/mailx  $mailUser
                                ;;


                                                                            
To:


 mailResults ()
{
        if [ -n "$mailUser" ]; then
                case `uname -rvs` in
                        Windows_NT*)
                                ex.ec 2>/dev/nul
                                nhiNtMail - -t $mailUser -penguin
                                ;;
                        HP-UX*)
                                /bin/mail $mailUser
                                ;;
                        SunOS\ 5*)
                                /bin/mailx -t -r [email protected] $mailUser 
                                ;;
                        AIX\ [2-9]\ 4)
                                /bin/mailx  $mailUser
                                ;;  


 

.

Related Issues/Questions:
When changing the sender's email address for eHealth reports, the message is corrupted
nhMail fails to send PDF's attachments when the email sender is changed to be someone other than the default eHealth user
nhMail sending PDF's in MIME format

Problem Environment:
Solaris
eHealth
When running an eHealth report and using the nhMail command to send the report in PDF format to a user inbox, everything works fine and the PDF file is attached to the email as expected.   
However if nhMail is modified to change the sender (From: ) of the email to another user address other than the default eHealth user, the email might be received by the the recipient without the PDF attachment, but instead with the content of the PDF report in MIME format embedded in the email body.               
In this case, the message received from the modified sender is like the following, with no PDF file attached, but with the content coded in the message body:


------                                                                 
Subject: sbeICT00127.rtp-FastEthernet0_0_2009_05_22_11_51_06_010.pdf   
To: [email protected]                                             
Mime-Version: 1.0                                                      
Content-Type: multipart/mixed; boundary=arisaema_triphyllum_SDERDFRBA_98
Content-Transfer-Encoding: 7bit                                        
                                                                       
This is a multi-part message in MIME format.                           
                                                                       
--arisaema_triphyllum_SDERDFRBA_98                                     
Content-Type: text/plain; charset=us-ascii                             
Content-Transfer-Encoding: 7bit                                        
                                                                     
This is a PDF report from eHealth.   .                                
                                                                     
--arisaema_triphyllum_SDERDFRBA_98                                   
Content-Type: application/pdf; charset=us-ascii;                     
name="sbeICT00127.rtp-FastEthernet0_0_2009_05_22_11_51_06_010.pdf"   
Content-Transfer-Encoding: base64                                    
Content-Disposition: attachment;                                     
filename="sbeICT00127.rtp-FastEthernet0_0_2009_05_22_11_51_06_010.pdf"
------

.

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


(Legacy KB ID CNC TS34531 )

Environment

Release: LHBASC99000-6.2-eHealth-Live Health Upgrade Elements
Component: