aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrhatto <rhatto>2006-10-12 13:53:36 +0000
committerrhatto <rhatto>2006-10-12 13:53:36 +0000
commit7fa153ea2e4ea939baa09e2e05f512e1d1b7278a (patch)
tree4cf21a9ee3708289b93e00adb98de8c8ac072d6a
parentc6e5e6a518459d46c4dae62716213ab1c4366050 (diff)
downloadfirma-7fa153ea2e4ea939baa09e2e05f512e1d1b7278a.tar.gz
firma-7fa153ea2e4ea939baa09e2e05f512e1d1b7278a.tar.bz2
added back MimeWrapMessage; admin replies are now sent encrypted
-rwxr-xr-xfirma60
1 files changed, 57 insertions, 3 deletions
diff --git a/firma b/firma
index 713659b..0cc1983 100755
--- a/firma
+++ b/firma
@@ -1826,8 +1826,9 @@ function EmailListAdministration {
ListAdministration $command
fi
done`"
- # TODO: send encrypted
- ComposeAndSendBounceMessage
+ GPG_MESSAGE="`echo -e "${PASSPHRASE}\n${MESSAGE_BODY}" | $GPG_ENCRYPT --recipient $SENDER_ADDRESS`"
+ MimeWrapMessage
+ echo "$MESSAGE" | $MAIL_AGENT $MAIL_AGENT_ARGS
else
# message was sent by a normal subscriber
# this is the body of the message to be sent, so no indentation here
@@ -1874,6 +1875,58 @@ function AllowMessageProcessing {
return $return_code
}
+
+function MimeWrapMessage {
+ #-------------------------------------------------------------
+ # MIME wrap message to be sent, adding needed headers and body parts
+ #
+ # parameter(s): none
+ # depends on variable(s): RECIPIENTS, SUBJECT, GPG_MESSAGE
+ #
+ # returns: 0
+ #-------------------------------------------------------------
+
+ local boundary
+
+ boundary="`RandomString 15`"
+
+ # these are the headers of the message to be sent, so no indentation here
+ MESSAGE_HEADERS="\
+From: $LIST_ADDRESS
+To: ${RECIPIENTS}
+Reply-To: $LIST_ADDRESS
+Subject: ${SUBJECT_PREFIX}${SUBJECT}
+MIME-Version: 1.0
+Content-Type: multipart/encrypted;
+ protocol=\"application/pgp-encrypted\";
+ boundary=\"${boundary}\"
+Content-Disposition: inline"
+
+ # this is the body of the message to be sent, so no indentation here
+ MESSAGE_BODY="\
+This is an OpenPGP/MIME encrypted message (RFC 2440 and 3156)
+--$boundary
+Content-Type: application/pgp-encrypted
+Content-Description: PGP/MIME version identification
+
+Version: 1
+
+--$boundary
+Content-Type: application/octet-stream; name=\"encrypted.asc\"
+Content-Disposition: inline; filename=\"encrypted.asc\"
+Content-Description: OpenPGP encrypted message
+
+${GPG_MESSAGE}
+
+--${boundary}--"
+
+ # assemble entire message
+ MESSAGE="\
+${MESSAGE_HEADERS}
+
+${MESSAGE_BODY}"
+}
+
#-------------------------------------------------------------
# main()
#-------------------------------------------------------------
@@ -1950,7 +2003,8 @@ FUNCTIONS="
FixOwnership
RandomString
AdminLog
- EmailListAdministration"
+ EmailListAdministration
+ MimeWrapMessage"
for VAR in $GLOBAL_VARS; do
declare $VAR