aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrhatto <rhatto>2005-08-09 00:38:05 +0000
committerrhatto <rhatto>2005-08-09 00:38:05 +0000
commit121200a5e2f36515958f04db94e87321030b9d6d (patch)
tree233692ac204bd987dcfab394c62ac43346321df5
parenta5ec22cc828453abd88ab6d63b5b9ce3c1736e7a (diff)
downloadfirma-121200a5e2f36515958f04db94e87321030b9d6d.tar.gz
firma-121200a5e2f36515958f04db94e87321030b9d6d.tar.bz2
uso de LIST_MESSAGE nas funcoes message_list e message_list_return
-rwxr-xr-xfirma26
1 files changed, 24 insertions, 2 deletions
diff --git a/firma b/firma
index ec0fc9d..ddbd0d3 100755
--- a/firma
+++ b/firma
@@ -131,6 +131,7 @@ 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
@@ -139,12 +140,23 @@ $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 | 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
+
}
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
@@ -153,7 +165,17 @@ $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 | 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
+
}
function message_list_return {