]> gitweb.fluxo.info Git - firma.git/commitdiff
fixed stuff with LIST_MESSAGE
authorrhatto <rhatto>
Wed, 10 Aug 2005 16:05:57 +0000 (16:05 +0000)
committerrhatto <rhatto>
Wed, 10 Aug 2005 16:05:57 +0000 (16:05 +0000)
firma

diff --git a/firma b/firma
index d6dd140cf1617f0af88765d22738ad388719a6cd..523695d07a0f8c90e97478845a97b0ce438622b3 100755 (executable)
--- a/firma
+++ b/firma
@@ -131,21 +131,27 @@ function message_list {
 # compose and send a message to the list
 # $1: subscriber email
 # sorry no identation :P  
-echo "$PASSWD
+
+LIST_MESSAGE=( $(echo "$PASSWD
 Message from: $FROM
 Subject: $SUBJECT
 $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 | sed -e 's/^\(.*\)$/\1\\n/') )
+
+# now send the message
+echo -e "From: $LISTNAME\nTo: $1\nSubject: none\n\n${LIST_MESSAGE[@]}" | sed -e 's/^ //' | $MAIL $MAIL_ARGS
   
-$(echo -e "$PASSWD\n${GPG_MESSAGE[@]}" | $GPGDECRYPT 2> /dev/null)" | sed -e 's/=20$//' | $GPGENCRYPT $1 | $MAIL -r $LISTNAME $1
 }
 
 function message_list_error {
 # compose and send an error message
 # sorry no identation :P  
-echo "$PASSWD
+
+LIST_MESSAGE=( $(echo "$PASSWD
 Message from: $FROM
 Subject: [BAD SIGNATURE] $SUBJECT
 $DATE
@@ -153,7 +159,11 @@ $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 | sed -e 's/^\(.*\)$/\1\\n/') )
+
+# now send the message
+echo -e "From: $LISTNAME\nTo: $1\nSubject: none\n\n${LIST_MESSAGE[@]}" | sed -e 's/^ //' | $MAIL $MAIL_ARGS
+
 }
 
 function message_list_return {