diff options
author | Joerg Jaspert <joerg@debian.org> | 2014-05-08 11:09:35 +0200 |
---|---|---|
committer | Joerg Jaspert <joerg@debian.org> | 2014-05-08 11:14:39 +0200 |
commit | 59514a00909dac717d4af21a41773916f0c3836d (patch) | |
tree | a1510da9c302643307bc686555f1c876acfdbe63 | |
parent | 26df6757ada617f423f653e114cfacfe40e607cd (diff) |
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.
-rwxr-xr-x | bin/ftpsync | 6 |
1 files 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} <<EOF + mail -s "[$(hostname -s)] Update for ftpsync available" ${MAILTO} <<EOF Hello admin, i found that there is a new version of me available. |