aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrhatto <rhatto>2005-08-06 14:05:35 +0000
committerrhatto <rhatto>2005-08-06 14:05:35 +0000
commit2dd5990b8d52a37059cc0c10b7155d6f46bd5595 (patch)
tree0c2cbc4b52e7a95ed20af13504d9e2aa46a7479b
parent780de1e372fe0a38869fe1057a6441f9b0ebb08e (diff)
downloadfirma-2dd5990b8d52a37059cc0c10b7155d6f46bd5595.tar.gz
firma-2dd5990b8d52a37059cc0c10b7155d6f46bd5595.tar.bz2
substituido uso do nail por um smtp/wrapper no estilo do sendmail
-rwxr-xr-xfirma22
1 files changed, 17 insertions, 5 deletions
diff --git a/firma b/firma
index 5588c47..2688eea 100755
--- a/firma
+++ b/firma
@@ -6,7 +6,8 @@
# list configuration is passed thru the config file,
# where you put PARAMETER=value (whithout spaces)
#
-# MAIL= path for mail program
+# MAIL= path for smtp/wrapper binary (sendmail-like)
+# MAIL_ARGS= smtp options (-oem -oi -t)
# GPG= path for gnupg binary
# LISTNAME= list email
# LISTADMIN= list administrator email addresses (space separated)
@@ -42,7 +43,6 @@ function version {
echo "for more details."
}
-
function check_config {
# check configuration file parameters
if [ ! -f $GPG -o ! -x $GPG ]; then
@@ -136,6 +136,10 @@ function message_list {
# $1: subscriber email
# sorry no identation :P
echo "$PASSWD
+From: $LISTNAME
+To: $1
+Subject: none
+
Message from: $FROM
Subject: $SUBJECT
$DATE
@@ -143,13 +147,17 @@ $DATE
$(get_gpg_stderr | grep -F 'gpg: Signature made')
$(get_gpg_stderr | grep -F 'gpg: Good signature from')
-$(echo -e "$PASSWD\n${GPG_MESSAGE[@]}" | $GPGDECRYPT 2> /dev/null)" | sed -e 's/=20$//' | $GPGENCRYPT $1 | $MAIL -r $LISTNAME $1
+$(echo -e "$PASSWD\n${GPG_MESSAGE[@]}" | $GPGDECRYPT 2> /dev/null)" | sed -e 's/=20$//' | $GPGENCRYPT $1 | $MAIL $MAIL_ARGS
}
function message_list_error {
# compose and send an error message
# sorry no identation :P
echo "$PASSWD
+From: $LISTNAME
+To: $1
+Subject: none
+
Message from: $FROM
Subject: [BAD SIGNATURE] $SUBJECT
$DATE
@@ -157,7 +165,7 @@ $DATE
$(get_gpg_stderr | grep -F 'gpg: Signature made')
$(get_gpg_stderr | grep -F 'gpg: BAD signature from')
-$(echo -e "$PASSWD\n${GPG_MESSAGE[@]}" | $GPGDECRYPT 2> /dev/null)" | sed -e 's/=20$//' | $GPGENCRYPT $1 | $MAIL -r $LISTNAME $1
+$(echo -e "$PASSWD\n${GPG_MESSAGE[@]}" | $GPGDECRYPT 2> /dev/null)" | sed -e 's/=20$//' | $GPGENCRYPT $1 | $MAIL $MAIL_ARGS
}
function message_list_return {
@@ -165,6 +173,10 @@ function message_list_return {
# $1: sender email (usually $FROMADD)
# sorry no identation :P
echo "
+From: $LISTNAME
+To: $1
+Subject: none
+
Message from: $FROM
Subject: [RETURNED MAIL] $SUBJECT
$DATE
@@ -175,7 +187,7 @@ $DATE
you have any questions. ]
--
- firma v$VERSION" | $MAIL -r $LISTNAME $1
+ firma v$VERSION" | $MAIL $MAIL_ARGS
}
function process_message {