PythonCard Email Application

This page is intended to capture issues for creating a sample email application in PythonCard.

Fred Pacquier created the fpop sample. fpop is modeled after the Japanese nPOP email program, but is designed to delete unwanted email such as SPAM from a POP3 server before the email is downloaded to the users local machine.

After spending some time with Fred's first pass at fpop, I started updating it with more features for viewing and sending email, automatically tagging SPAM for deletion, etc. I'm naive enough to think that we can create a basic email client using the standard Python libraries and PythonCard for the application framework. If nothing else, this will be a good stress test of the framework <wink>.

Email package

I decided to focus on using the latest version of the email module for the handling of messages. The most recent version of the email package is newer than what is included with Python 2.2.1 and so the package will likely get included with the email sample app to simplify usage. http://www.python.org/doc/current/lib/module-email.html http://sourceforge.net/projects/mimelib

http://lists.sourceforge.net/lists/listinfo/mimelib-devel

Mailbox format

I would like to use one of the standard mailbox formats already supported by Python. We would probably maintain additional index files to speed up searching and displaying mailboxes as they get large.

I have done some experimentation with importing mail messages (using the rfc822 library) into relational stores (Access, SQL Server, most recently MySQL with full text indexing), and would like to discuss whether this would offer additional benefits that might make it worth including this feature. I'm sure that the email module will be quite easy to adapt to. [SH]

Some Proposed Features

  • To, Cc, Bcc fields must support auto-complete of name/email addresses pulled from an address book
  • Inbox, Outbox, Sent, Deleted and Draft mailboxes. Some of the names might be different.
  • Simple rules set for automatically moving incoming messages or messages from a particular folder into the proper mailbox for mailing lists, SPAM filtering, etc.
  • SPAM blacklist
  • figure out the registry and COM necessary so that the email app will be used when other apps try and compose an email via a mailto URL...
  • display mail threads using Tree component or indents in MultiColumnList

  • possibly support some smarts for identifying URLs in email to automatically extend selections for launching a URL in a browser, opening a new message for a mailto, etc.
  • how about an automatically-updated SPAM blacklist? There must be sources on the 'Net, and it would seem sensible to make use of such information if it would help. [SH]
  • Mail handling semantics and policies

    Headers that are typically hidden from the user

    Replies versus Forward

  • Replies don't include attachments from an original email, a forwarded message does.
  • Replies should provide at least simple quoting using >. If possible more sophisticated X-Attribution style quoting can be applied

  • On replies, the Subject gets a "Re: " prepended if it doesn't already have one.
  • Should a Reply-To header override any of the semantics below?
  • non-nested citations (using X-Attribution header or initials)

    [From Barry Warsaw]

    Google's historical Usenet archives are a wonderful and scary thing. I couldn't remember who invented non-nested citations, and a quick search showed that it's been a long time:

    http://groups.google.com/groups?q=non-nested+citations&start=90&hl=en&lr=&ie=UTF-8&oe=UTF-8&scoring=d&selm=WARSAW.89May23110127%40rtg.cme.nbs.gov&rnum=97&filter=0

    But this nice posting includes the comments in one of the original versions of the file, which reveals that it was Martin Neitzel who invented it.

    http://groups.google.com/groups?q=non-nested+citations&start=90&hl=en&lr=&ie=UTF-8&oe=UTF-8&scoring=d&selm=TALE.89Jun13130214%40imagine.pawl.rpi.edu&rnum=96&filter=0

    Here's an example.

    >>>>> "KA" == Kevin Altis <altis@semi-retired.com> writes:

    KA> I'm assuming the code for Supercite is elisp not Python?

    Yup.

    Reply

    The first item in the From header of the original message is used for the To. You should certainly reply to the Reply-To address if such a header was present in the original message [SH]. Cc, Bcc from the original message are dropped.

    You should not see any Bcc headers coming in, since the feature works by transmitting the message to the user without including any header data. Relaying MTAs must save information about who should receive the message separately from the message content. If you are a Bcc recipient your address should appear nowhere in the headers (unless you are also listed as a recipient via To or Cc headers [SH].

  • There should be an option that allows addresses from messages to be added to the address book easily in some preferred format [SH]
  • Reply to Group

    Not sure here what meaning "group" has, unless the software will recognise subscribed mailing lists (perhaps recognizing particular headers from mailman and other list managers). Of course, if the program were to become a news client as well this feature would be more comprehensible. But do we want to rewrite Outlook Express? [SH]

    Reply to All

    Forward

    Message Threading

    Jamie Zawinski describes the algorithm used by Netscape Mail and News 2.0 and 3.0 for message threading

    RFCs

    RFC 2822 - Internet Message Format RFC 2821 - Simple Mail Transfer Protocol (SMTP) RFC 2231 - MIME Parameter Value and Encoded Word Extensions: Character Sets, Languages, and Continuations RFC 1939 - Post Office Protocol - Version 3 (POP3)

    See http://www.faqs.org/rfcs/rfc-activeT.html for other related RFCs

    References

    Internet Protocols and Support modules Internet Data Handling modules email project home on SF

    Fetchmail FAQ - additional POP3 issues

    Contributors

    Initials indicate comments by particular individuals.
  • [KEA] Kevin Altis
  • [SH] SteveHolden

    Changes

    PythonCardEmailApp (last edited 2008-03-11 10:50:22 by localhost)

    NOTE: To edit pages in this wiki you must be a member of the TrustedEditorsGroup.