aboutsummaryrefslogtreecommitdiffstats
path: root/interfaces/email
Commit message (Collapse)AuthorAgeFilesLines
* Better unicode handling in be-handle-mail.W. Trevor King2009-07-181-16/+17
| | | | | | | | | | | | | | | | | | | | | | | be-handle-mail now gets a bit further on cat examples/unicode | ./be-handle-mail -o -l - 2>&1 1>/dev/null It successfully reads in unicode output from the command execution and successfully prints that output to the log ("-l - 2>&1 1>/dev/null" sets up the log to be printed to the terminal's stdout). However, it chokes later on with responding to John Doe <jdoe@example.com>: show Traceback (most recent call last): File "./be-handle-mail", line 274, in <module> main() File "./be-handle-mail", line 266, in main response_email = compose_response(ret, out_text, err_text, info).plain() File "./be-handle-mail", line 210, in compose_response LOGFILE.write("\n%s\n\n" % send_pgp_mime.flatten(response_email.plain())) File "/home/wking/src/fun/be/be.email/interfaces/email/interactive/send_pgp_mime.py", line 165, in flatten g.flatten(msg) File "/usr/lib/python2.5/email/generator.py" ... ... UnicodeEncodeError: 'ascii' codec can't encode character u'\ufffd' in position 2581: ordinal not in range(128)
* Added tracebacks to be-handle-mail's "uncaught exceptions".W. Trevor King2009-07-181-1/+2
|
* Added an email interface example requesting unicode comment output.W. Trevor King2009-07-171-0/+9
| | | | Indeed, be-handle-mail chokes... :(
* Added "be-handle-mail --logfile LOGFILE" for sane logfile handling.W. Trevor King2009-07-171-13/+43
| | | | | The previous setup had been pretty wimpy; now there's a degree of flexibility.
* Added symlinks to libbe and becommands in interfaces/email/interactive.W. Trevor King2009-07-172-0/+2
| | | | | With this set-up, be-handle-mail run from its own directory will load your working-state BE setup, not your system-wide BE installation.
* Setup be-handle-mail.BE_DIR to point to the BE repo by default.W. Trevor King2009-07-171-1/+1
| | | | | | | At least, it points to the directory where be-handle-mail lives. If you haven't moved it, that will be somewhere inside the BE repository. This removes my hardcoded BE_DIR.
* "be-handle-mail --output" added to support easy testing.W. Trevor King2009-07-171-2/+14
|
* Removed debugging reply-address adjustment from be-handle-mail.W. Trevor King2009-07-161-1/+0
| | | | Everything seems to be working now. On to the remote tests ;).
* be-hand-mail now catches errors and sends appropriate responses.W. Trevor King2009-07-161-27/+94
|
* Now be-handle-mail successfully catches stdout/stderr.W. Trevor King2009-07-161-1/+2
|
* Oops again, removed some old debugging loggingW. Trevor King2009-07-151-8/+0
|
* Oops, the header keys in be-handle-mail should all be unicode.W. Trevor King2009-07-151-4/+4
| | | | | Even though I convert to ascii in send_pgp_mime.Mail.__init__(), it's still good to be consistent inside each module ;).
* be-handle-mail succesfully sends replies.W. Trevor King2009-07-151-16/+49
| | | | | | | | | | | | | | | Although I'm not catching stdout/stderr yet, so the replies aren't very useful ;). Still it the send_pgp_mime.py interface is working :). I've added rudimentary logging (via LOGFILE) to keep track of what be-handle-mail is up to. There's also BE_DIR, which sets the directory that BE lives in (important ;). The author handling got more consistent, thanks to send_pgp_mime.source_email (using the new return_realname option) and email.utils.formataddr(). Now author_addr should look the same regardless of which phrasing you use to set it (e.g. "NAME <ADDR>" vs "ADDR (NAME)", and possibly others.)
* Adjusted _procmailrc to not match reply emails.W. Trevor King2009-07-151-2/+3
| | | | You might want to keep the output to read later ;).
* Add unicode-header handling to send_pgp_mime.pyW. Trevor King2009-07-151-11/+26
| | | | | | | | | | | | | | | | | | | | | | | | Also: Switched email.message_from_string() to email.parser.Parser().parsestr() for parsing the header, for access to the headersonly option. Adjusted module import order to alphebetize non-mime email modules. Added return_realname to source_email(), which makes it more useful to be-handle-mail (currently uncommitted). Added a doctest for the plain() output and removed redundant Content-Type line from the doctests (which we'd removed from the output with the last commit). Note that many doctests _will_fail_ unless me@big.edu and you@big.edu are in your gpg keyring. At some point I should make those addresses options to --test...
* Minor tweaks in send_pgp_mime.pyW. Trevor King2009-07-151-3/+1
| | | | | * No reason to set maxheaderlen to something other than the default. * MIMEText sets content-type and charset automatically.
* Added --mode=plain option to send_pgp_mime.W. Trevor King2009-07-152-10/+21
| | | | | | | | | | | | | | | 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.
* First attempt at real response email.W. Trevor King2009-07-151-15/+42
|
* Added some comments to send_pgp_mimeW. Trevor King2009-07-151-1/+6
|
* Incorperated send_pgp_mime into be-handle-mail.W. Trevor King2009-07-151-3/+16
| | | | | Todo: generate a real response email to replace the current dummy email.
* Ran update_copyright.sh on be-handle-mail and send_pgp_mime.W. Trevor King2009-07-152-2/+30
|
* Added my send_pgp_mime module to the project.W. Trevor King2009-07-152-0/+547
| | | | | | | | | This is a bit of a shameless plug, since there's not much motivation for encrypting bug emails. However, I've already written it, and it does send emails, so I'm using it ;). Perhaps some company will want to keep the bug submitter's contact information securely in a BE database. Anyhow, there's very little reason to _not_ use PGP, and the module certainly doesn't force you to encrypt anything. ;)
* Added be-handle-mail and some example emails.W. Trevor King2009-07-149-0/+146
| | | | | | So far, it parses the emails and executes the specified task. Todo: email the sender back with the output/errors/exit-status/etc.
* Added _procmailrc file for interactive email handling.W. Trevor King2009-07-141-0/+19
| | | | | | | | | | | The beginnings of an interactive email interface to BE. With a working procmail setup, copying _procmailrc to ~/.procmailrc should sort through incoming email to that user, passing all messages with subjects starting with [be-mail] on to the script be-handle-mail and deleting the rest. Now I just need to write be-handle-mail ;).
* Reorganized directory structure, mostly to put all the interfaces inW. Trevor King2009-07-141-0/+59
one place and make things clearer to the uninitiated. Here's my current understanding: . |-- libbe (the guts of BE) |-- becommands (plugins for all "be *" commands) |-- doc (documentation, currently just the man page) |-- interfaces (non-commandline interface implementations) | |-- web | | |-- Bugs-Everywhere-Web (in Turbogears) | |-- gui | | |-- beg (in Tkinter) | | `-- wxbe (in WX) | |-- email | `-- xml (xml <-> whatever conversion) `-- misc (random odds and ends) `-- completion (shell completion scripts) Note that I haven't attempted to use the web or gui interfaces in a while, so I'm not sure how well they're holding vs the core development.