Codebase list metche / 433a518
Support more mailers than just mutt. Thanks to Kan-Ru Chen <koster@debian.org> for the patch. intrigeri 12 years ago
1 changed file(s) with 21 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
7070 fi
7171 }
7272
73 add_header() {
74 local subject="$1";
75 echo "Subject: $subject";
76 echo "To: $EMAIL_ADDRESS";
77 echo
78 cat;
79 }
80
81 _mail() {
82 local subject="$1";
83 if which mail > /dev/null ; then
84 LC_ALL="$LOCALE" mail -s "$subject" "$EMAIL_ADDRESS"
85 elif [ -x /usr/sbin/sendmail ]; then
86 LC_ALL="$LOCALE" add_header "$subject"|/usr/sbin/sendmail "$EMAIL_ADDRESS"
87 elif which mutt > /dev/null ; then
88 LC_ALL="$LOCALE" mutt -s "$subject" "$EMAIL_ADDRESS"
89 fi
90 }
91
7392 email() {
7493 debug "* email $@ to $EMAIL_ADDRESS"
7594 local subject="`current_system` - $_MAIL_SUBJECT : $1"
7695 if [ $ENCRYPT_EMAIL = "yes" ]; then
7796 LC_ALL="$LOCALE" gpg --batch --armor --encrypt \
7897 --recipient "$EMAIL_ADDRESS" |
79 LC_ALL="$LOCALE" mutt -s "$subject" "$EMAIL_ADDRESS"
98 LC_ALL="$LOCALE" _mail "$subject"
8099 else
81 LC_ALL="$LOCALE" mutt -s "$subject" "$EMAIL_ADDRESS"
100 LC_ALL="$LOCALE" _mail "$subject"
82101 fi
83102 }
84103