~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/services/messages/doc/message.txt

  • Committer: Launchpad Patch Queue Manager
  • Date: 2011-08-13 01:11:42 UTC
  • mfrom: (13668.1.31 private-bug-0)
  • Revision ID: launchpad@pqm.canonical.com-20110813011142-b8xvpxhdja422ln2
[rs=sinzui][no-qa] Moved canonical.launchpad.mail to lp.services.mail,
 bugs.mail, code.mail.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
= Messages =
 
1
Messages
 
2
========
2
3
 
3
4
The Message table is a central message spool that can be used by
4
5
various parts of launchpad. Currently, it is used by Malone for comments
143
144
has been a problem before, let's look at text_contents of a message
144
145
containing a signature.asc attachment.
145
146
 
146
 
    >>> from canonical.launchpad.mail.ftests import read_test_message
 
147
    >>> from lp.services.mail.tests.helpers import read_test_message
147
148
    >>> signed_msg = read_test_message('signed_detached.txt')
148
149
    >>> signed_msg['Message-Id'] = '<signeddetached@testmsg>'
149
150
    >>> print signed_msg.as_string()
510
511
    2005-06-17 09:45:13+00:00
511
512
 
512
513
 
513
 
== Unknown encoding ==
 
514
Unknown encoding
 
515
================
514
516
 
515
517
Some mail clients (Pine, for example) send messages with the character set
516
518
specified as x-unknown. Python's email package doesn't handle these well and
518
520
which often works.
519
521
 
520
522
    >>> import os.path
521
 
    >>> mail_path = ('../../../../canonical/launchpad/mail/'
522
 
    ...              'ftests/emails/x-unknown-encoding.txt')
 
523
    >>> mail_path = ('../../mail/tests/emails/x-unknown-encoding.txt')
523
524
    >>> msg_path = os.path.join(os.path.dirname(__file__), mail_path)
524
525
    >>> raw_msg = open(msg_path).read()
525
526
    >>> print raw_msg