]> gitweb.fluxo.info Git - firma.git/commitdiff
substituido uso do nail por um smtp/wrapper no estilo do sendmail
authorrhatto <rhatto>
Sat, 6 Aug 2005 14:05:35 +0000 (14:05 +0000)
committerrhatto <rhatto>
Sat, 6 Aug 2005 14:05:35 +0000 (14:05 +0000)
firma

diff --git a/firma b/firma
index 5588c47b4db1f6144e7c7919a612af7c70d5a8fd..2688eeabd0e25ff6d3c8de64682fff64b0d0c021 100755 (executable)
--- 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 {