The following works fine as expected from command line:
mail < /home/incoming/mailprocoutput.txt -s "Message Processing results..." -r [email protected] [email protected]
cat filename pipe mail etc also works fine on command line. But either method results in an empty message body when used in a shell script:
#!/bin/bash
# This is to send an email from the mailproc python script with the results of message processing
timestamp=$( date +%T )
curDate=$( date +"%m-%d-%y" )
logger "Mailproc has run at $timestamp on $curDate, sending response back to the creator..."
mail < /home/incoming/mailprocoutput.txt -s "Message Processing results..." -r [email protected] [email protected]
exit
What am I doing wrong? Ubuntu 18.04, GNU mailutils version 3.4
0 Answers