aboutsummaryrefslogtreecommitdiffstats
path: root/interfaces/email/interactive/be-handle-mail
diff options
context:
space:
mode:
authorW. Trevor King <wking@drexel.edu>2009-07-15 13:18:19 -0400
committerW. Trevor King <wking@drexel.edu>2009-07-15 13:18:19 -0400
commitf04ada1e90aaff9da1af46455a0ead597fc4deba (patch)
tree4d99464333b06161f940baa57a636385d3464f6a /interfaces/email/interactive/be-handle-mail
parent8562c18a92d726d1ad23d6625a3b5a5be4f6e439 (diff)
downloadbugseverywhere-f04ada1e90aaff9da1af46455a0ead597fc4deba.tar.gz
Added --mode=plain option to send_pgp_mime.
Also a few more tweaks to get things working. I think be-handle-mail is parsing the incoming messages correctly now, but I'm not getting replies back for some reason. Some of the adjustments: * Moved send_pgp_mime -> send_pgp_mime.py, otherwise Python doesn't recognize it as an importable module. * I use postfix now instead of msmtp, so send_pgp_mime.sendmail now points to postfix's sendmail-compatable frontend. * Added "--mode=plain" option to send_pgp_mime.py, so I can test my procmail rules and send_pgp_mime itself without worrying about be-handle-mail. * Fixed some typos in be-handle-mail.
Diffstat (limited to 'interfaces/email/interactive/be-handle-mail')
-rwxr-xr-xinterfaces/email/interactive/be-handle-mail9
1 files changed, 5 insertions, 4 deletions
diff --git a/interfaces/email/interactive/be-handle-mail b/interfaces/email/interactive/be-handle-mail
index 7b62129..a608074 100755
--- a/interfaces/email/interactive/be-handle-mail
+++ b/interfaces/email/interactive/be-handle-mail
@@ -28,8 +28,9 @@ single argument.
Eventually we'll commit after every message.
"""
-import libbe.cmdutil, libbe.utility
+import cStringIO as StringIO
import email
+import libbe.cmdutil, libbe.utility
import send_pgp_mime
import sys
import time
@@ -111,11 +112,11 @@ def run_message(msg_text):
response_header = [u"From: %s" % HANDLER_ADDRESS,
u"To: %s" % author,
- u"Date: %s" % , libbe.utility.time_to_str(time.time()),
+ u"Date: %s" % libbe.utility.time_to_str(time.time()),
u"Content-Type: text/plain; charset=%s" % encoding,
u"Content-Transfer-Encoding: 8bit",
u"In-reply-to: %s" % (id),
- u"Subject: %s Re: %s" % (SUBJECT_COMMENT, command),
+ u"Subject: Re: %s %s" % (SUBJECT_COMMENT, command),
]
response_body = [u"Results of running: (exit code %d)" % ret,
u" %s %s" % (command, " ".join(command_args)),]
@@ -130,7 +131,7 @@ def run_message(msg_text):
def main():
msg_text = sys.stdin.read()
- response_email = handle_message(msg_text)
+ response_email = run_message(msg_text)
send_pgp_mime.mail(response_email, send_pgp_mime.sendmail)
if __name__ == "__main__":