From 59514a00909dac717d4af21a41773916f0c3836d Mon Sep 17 00:00:00 2001 From: Joerg Jaspert Date: Thu, 8 May 2014 11:09:35 +0200 Subject: Adjust mail sending option -e should be -E: Some mailx variants don't list -e, some silently seem to map it to -E, some others use it to check if the local users mailbox has some content, but -E (for those I've seen) always means what we want: "Don't send a mail when there is no body". Thanks to Neil Mayhew for reporting. --- bin/ftpsync | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/ftpsync b/bin/ftpsync index 0aa7a17..780245b 100755 --- a/bin/ftpsync +++ b/bin/ftpsync @@ -110,7 +110,7 @@ cleanup() { if [ -n "${MAILTO}" ]; then # In case rsync had something on stderr if [ -s "${LOGDIR}/rsync-${NAME}.error" ]; then - mail -e -s "[${PROGRAM}@$(hostname -s)] ($$) rsync ERROR on $(date +"%Y.%m.%d-%H:%M:%S")" ${MAILTO} < "${LOGDIR}/rsync-${NAME}.error" + mail -E -s "[${PROGRAM}@$(hostname -s)] ($$) rsync ERROR on $(date +"%Y.%m.%d-%H:%M:%S")" ${MAILTO} < "${LOGDIR}/rsync-${NAME}.error" fi if [ "x${ERRORSONLY}x" = "xfalsex" ]; then # And the normal log @@ -119,7 +119,7 @@ cleanup() { # Someone wants full logs including rsync MAILFILES="${MAILFILES} ${LOGDIR}/rsync-${NAME}.log" fi - cat ${MAILFILES} | mail -e -s "[${PROGRAM}@$(hostname -s)] archive sync finished on $(date +"%Y.%m.%d-%H:%M:%S")" ${MAILTO} + cat ${MAILFILES} | mail -E -s "[${PROGRAM}@$(hostname -s)] archive sync finished on $(date +"%Y.%m.%d-%H:%M:%S")" ${MAILTO} fi fi @@ -675,7 +675,7 @@ if [ -r "${TO}/project/ftpsync/LATEST.VERSION" ]; then fi if [ ${difference} -ge 259200 ]; then # Only warn every third day - mail -e -s "[$(hostname -s)] Update for ftpsync available" ${MAILTO} <