]> gitweb.fluxo.info Git - firma.git/commitdiff
palas
authorrhatto <rhatto>
Sun, 7 Aug 2005 22:43:20 +0000 (22:43 +0000)
committerrhatto <rhatto>
Sun, 7 Aug 2005 22:43:20 +0000 (22:43 +0000)
CHANGELOG
firma

index 33ff8dda6931da69532e76e04f534ba0f885118c..59875f229cb0f1af4e591bee0f712ee712635e64 100755 (executable)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,6 +1,8 @@
 Firma CHANGELOG 
 ---------------
 
+07/05/2005 - 
+
 07/05/2005 - 0.3-cvs (rev 1.13) - rhatto 
 
   - Firma now uses sendmail or any smtp wrapper directly:
diff --git a/firma b/firma
index 4c65930c0842f2cbe803f16dea5da7bc85ec4837..2d1e7a37af6eadffaba7c48cecf968a38b6e2dcb 100755 (executable)
--- a/firma
+++ b/firma
@@ -131,7 +131,6 @@ function message_list {
 # compose and send a message to the list
 # $1: subscriber email
 # sorry no identation :P  
-n=0
 echo "$PASSWD
 Message from: $FROM
 Subject: $SUBJECT
@@ -140,23 +139,12 @@ $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 | while read STDIN; do
-  LIST_MESSAGE[$n]="$STDIN\n"
-  ((++n))
-done
-
-echo -e "From: $LISTNAME
-To: $1
-Subject: none
-
-$(echo -e "${LIST_MESSAGE[@]}")" | $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  
-n=0
 echo "$PASSWD
 Message from: $FROM
 Subject: [BAD SIGNATURE] $SUBJECT
@@ -165,17 +153,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 | while read STDIN; do
-  LIST_MESSAGE[$n]="$STDIN\n"
-  ((++n))
-done
-
-echo -e "From: $LISTNAME
-To: $1
-Subject: none
-
-$(echo -e "${LIST_MESSAGE[@]}")" | $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_return {
@@ -259,7 +237,7 @@ function newlist {
     chmod 600 $CONFIG
     if [ -f $CONFIG ]; then
       gpg_args
-      echo -e "MAIL=$MAIL\n$MAIL_ARGS\nGPG=$GPG\nGPGDIR=$GPGDIR\nLISTNAME=$LISTNAME\nLISTADMIN=$LISTADMIN\nPASSWD=$PASSWD" > $CONFIG
+      echo -e "MAIL=$MAIL\nGPG=$GPG\nGPGDIR=$GPGDIR\nLISTNAME=$LISTNAME\nLISTADMIN=$LISTADMIN\nPASSWD=$PASSWD" > $CONFIG
       echo "now generating your keyring..."
 
       $GPGCOMMAND --gen-key <<EOF
@@ -361,7 +339,6 @@ EOF
 }
 
 # main -
-
 umask 0777
 
 # command line checking
@@ -384,9 +361,12 @@ if [ "$1" != "-c" -a "$1" != "-h" -a "$1" != "-v" ]; then
   fi
 fi
 
-declare -a MESSAGE
-declare -a GPG_MESSAGE
+# declare all vars
 declare n
+for array in MESSAGE GPG_MESSAGE LIST_MESSAGE; do
+  declare -a $array
+done
+
 export LANG=en_US
 
 # get gpg parameters and check the config
@@ -426,5 +406,5 @@ else
   usage
   exit 1
 fi 
+
 unset MESSAGE; unset GPG_MESSAGE; unset LIST_MESSAGE