summaryrefslogtreecommitdiff
path: root/Mailman/Message.py
Commit message (Collapse)AuthorAgeFilesLines
...
* mimelib's ReprMixin class and module was renamed to StringableMixin inbwarsaw2001-05-011-3/+3
| | | | | the 0.3 release. This means you must download and install the 0.3 version of mimelib to work with the current CVS snapshot!
* De-string-module-ify, transform to using mimelib instead of rfc822,bwarsaw2001-02-151-157/+51
| | | | | | | | | | | | | | | | | | | and use the switchboard interface. Specifically, Message class now multiply derives from mimelib.Message.Message and mimelib.ReprMixin.ReprMixin (for __str__() and get_text()). Other method changes: GetSender() -> get_sender() __init__(), __repr__(), __str__(), Enqueue(), Requeue(): removed OutgoingMessage class removed UserNotification class now inherits from Message and adds: send(): A convenience method for taking an internally crafted message and queuing it to the qfiles/virgin queue.
* Enqueue(): Allow for queuing to alternative queue directories. Ifbwarsaw2000-12-201-8/+20
| | | | | | | | | | | | | | | | | newdata or kws has an item called "_whichq", this specifies the directory to queue to, defaulting to INQUEUE_DIR. The metadata "filebase" is always set to __filebase, not just when the metadata is created for the first time. When writing the .db file (i.e. containing the metadata), always write it after the .msg text file, and always write it to a temporary file, with an os.rename() shuffle. This should avoid race conditions when queuing a message to another queue because the queue runners only key off of files ending in ".db". Requeue(): New method which calls Enqueue() after zapping self.__filebase so it'll be recalculated.
* OutgoingMessage.__init__(): Reversing patch 1.35 since this breaks thebwarsaw2000-08-021-12/+4
| | | | | contract with rfc822.Message.__init__() and also breaks news->mail gatewaying. A different patch will be applied to fix SF bug #109220.
* Enqueue(): Watch for the _dirty flag in the msgdata dictionary. Thisbwarsaw2000-07-271-3/+6
| | | | | | forces a write of the message text back to disk, even if it already exists. This is used when the message has been changed (e.g. new or changed header, etc.).
* One more try...bwarsaw2000-07-261-5/+8
| | | | | | | | | | | Enqueue(): Only calculate a new filebase (SHA hash) if the object wasn't assigned one in its constructor. Go back to including the current float time in the hash input. Message.__init__(): Take an optional `filebase' argument which can be restored from an enqueued message. This guarantees that a message, once assigned a hash value for its filebase, continues to use that filebase for its entire life.
* Enqueue(): Oops, you can't include the current time since the hashingbwarsaw2000-07-261-1/+1
| | | | algorithm needs to be reproducible.
* Enqueue(): Elaborate on the text fed to the SHA hashing function forbwarsaw2000-07-261-2/+4
| | | | | | | | | | | | calculating the file name. If a message is sent to two lists simultaneously and the receiving MTA doesn't distinguish them with something like a Delivered-To: header (as Postfix does), the hashes could be the same, prevent one or the other list from receiving the message. Now the hash is composed of the message's text, the destination list's name, and a string representation of the current floating point time. That ought to be unique enough for every message.
* OutgoingMessage.__init__(): Avoid the messy semantics ofbwarsaw2000-07-251-4/+12
| | | | | | rfc822.Message when the first line contains a colon. A blank header-terminating line is prepended to the given text if the first line contains a colon.
* UserNotification.__init__(): If recip is a list, then string join thebwarsaw2000-07-241-3/+7
| | | | | elements for the value of the To: field, and assign a copy of the list to self.recips. Otherwise do the old behavior.
* Enqueue(): New convention; msgdata keys that start with leadingbwarsaw2000-06-201-0/+5
| | | | underscore are volatile and don't get saved to disk.
* GetSender(): Return '' as the fallback false return value instead ofbwarsaw2000-06-141-1/+1
| | | | None. The type of the return value must always be a string.
* In a bit of a kludge, added an __repr__() which returns a stringbwarsaw2000-05-311-2/+11
| | | | | | | | | | | | | | | | | composed of - the unixfrom (i.e. From_ ) line - the rfc822 headers - a blank line - the body of the message This can be used to completely reconstruct the message as received by the MTA (and as needed by Pipermail). The __str__() still returns just the rfc822 headers and the body of the message. Enqueue(): Put the repr() in the .msg file, so that it can be completely reproduced.
* Message.__str__(): Include the unixfrom line in the return value; thisbwarsaw2000-05-311-2/+1
| | | | | | should fix problems where approved held messages weren't being archived properly, and other problems. Thanks to Thomas Wouters for tracking this problem.
* Enqueue(): New method to handle all the details of enqueuing a messagebwarsaw2000-05-081-3/+63
| | | | | | | | for re-delivery by qrunner. This makes it very easy for other clients to make sure a message doesn't get lost. The interface to this method is a bit convoluted, but is convenient for different calling conventions. See the docstring for details.
* Update the copyright lines to include the years 1999 & 2000.bwarsaw2000-03-211-1/+1
|
* GetSender(): Every access of the "sender" (really author) should nowbwarsaw2000-03-031-32/+47
| | | | | | | | | go through this one method. This consolidates and makes consistent the use of the From:, Sender:, and envelope-sender headers, and the search order based on USE_ENVELOPE_SENDER. The docstring explains the semantics of this method. GetEnvelopeSender(): Removed.
* GetSenderName(): Removed.bwarsaw1999-12-161-7/+1
|
* OutgoingMessage.__init__(): take an optional text argument, and passbwarsaw1999-11-241-2/+17
| | | | | | | | | that to the StringIO constructor. Useful for subclassing. UserNotification: Very useful subclass of OutgoingMessage which takes a recipient, a sender, a subject, and the message text, and sets the appropriate headers and `recips' attribute for use in the message pipeline.
* Greatly simplified by basing all this on the up-to-date rfc822.Messagebwarsaw1999-11-101-200/+33
| | | | | | | | | | | | | | object, which supports a writeable interface. Lots of cruft can go. Message.Message: Some of the API methods from previous incarnations are kept for convenience, notably: GetSender(), GetEnvelopeSender(), GetSenderTame. Message.__str__(): Flatten the message by concatenating its headers, adding a newline, and the message's body. OutgoingMessage(): convenience class for creating a Message object out of thin air.
* OutgoingMessage.SetDate(): removebwarsaw1999-07-211-3/+0
| | | | | | Utils.DeliverToUser(): Don't add a Date: header even if one is missing in the message. The MTA will always insert an RFC822 compliant header (and we weren't compliant anyway).
* IncomingMessage.GetSender(): Don't assume addresses taken from headershmeland1999-07-011-4/+8
| | | | are valid.
* Changed import of rfc822 to always get the version we distribute withhmeland1999-05-221-47/+8
| | | | | | | | | Mailman. IncomingMessage.SetHeader(): This messed up when changing headers that spanned multiple lines -- changed it to use rfc822.Message's emulation of a mapping type, which seems to get this right. IncomingMessage.__delitem__(): Removed, inherit from rfc822.Message instead.
* minor code formattingbwarsaw1999-03-091-2/+2
|
* More import games. Make sure we get an rfc822.Message with our newbwarsaw1999-01-121-1/+10
| | | | getallrecipients() method.
* Added some XXX comments for later:bwarsaw1998-12-101-0/+2
| | | | | | | | 1) OutgoingMessage.__delitem__() when name is missing probably ought to raise an exception instead of returning None. 2) There probably ought to be at least also an OutgoingMessage.__setitem__() too.
* .SetHeader(): Removed dubious line "name = "%s%s" % (name[0], name[1:])"klm1998-10-061-1/+3
| | | | | and added note about change to distributed rfc822.py as of 1.5.2 - but we'll want to wait a good while before we switch over to that...
* Added DeliverToOwner to Deliverer class in Deliverer.py that passescotton1998-10-011-0/+25
| | | | | | | | | | a message to the -admin address to the owners untouched and with the sender of the original message Added a GetEnvelopeSender method to Message.py that attempts to find the envelope sender from a messages's unix from line for use by DeliverToOwner changed the mailowner script to use DeliverToOwner method instead of the DeliverToList method scott
* .SetHeader(): New headers would not show in resulting message unlessklm1998-09-301-5/+7
| | | | | | | | | | | | | | | | | | | | | | optional "crush_duplicates" was set to 0, because the msg.dict would get the new entry, but the msg.headers would not. I've changed the code so that the non-crush_duplicates addition to msg.headers would happen whenever the header is new, regardless of crush_duplicates setting. (Of course, the newness of the header means there are no duplicates to crush...) Incidentally! John, there's a line at the top of this routine whose purpose i don't understand - i think it was there when i got the code, so i'm wondering if you know about it. It's the first line of code in the routine: name = "%s%s" % (name[0], name[1:]) The only thing i can think this would serve is to establish that the length of the name is at least 1 - seems to me it would be more efficient and clear to make the check explicit, if that's the purpose, avoid the assignment, etc. I suspect i'm missing something here - can you shed any light??
* Removed RCS crudbwarsaw1998-06-191-2/+0
|
* Added a readline() method to classes, since it turned out nntplib usedviega1998-06-021-2/+46
| | | | | | readline() and not readlines() as advertised. Also, added a subclass to IncomingMessage called NewsMessage, making it easier to add news-specific headers, etc.
* Add .readlines() to both message classes.viega1998-05-311-2/+13
| | | | | This was motivated by the fact that nntplib expects a file object on which it calls readlines().
* Fixed a typo in the zipcode.viega1998-05-261-2/+2
|
* Added copyright notices to all source files where I am legally entitled to ↵viega1998-05-251-1/+18
| | | | | | | do so. Added a copy of the GNU GPL. Added information about mailman-users in README, and reworded some text in there (made the credits less verbose... perhaps they should move to a credits file?)
* Digest class moved to mm_digest, because that is the only place itklm1998-05-011-19/+1
| | | | | will be used, and it uses maillist-specific digest stuff (e.g. DIGEST_MASTHEAD).
* Beginning of Digest class. (Premature checkin forced by need toklm1998-04-281-1/+19
| | | | relocate the repository.)
* OutgoingMessage: Add a __delitem__, extracting .CacheHeaders() methodklm1998-04-271-7/+23
| | | | from .SetHeaders() so the __delitem__ can use it.
* Use __delitem__ discipline for deleting headers by name. (Guidoklm1998-04-131-13/+22
| | | | | provided a refinement of the code that's not naive about continuation lines.)
* Add comment mentioning prospect of using StringIO instead of FakeFile.klm1998-04-101-1/+2
|
* Preparing to package a distribution - add a module docstring andmailman1998-04-091-0/+5
| | | | __version__ info.
* Add IncomingMessage.delitem() method, to remove approved headermailman1998-04-021-0/+15
| | | | | lines. (This maybe incorporated directly in the rfc822 class, in which case this method should eventually be removed...)
* Just some long-line wraps.mailman1998-03-191-5/+5
|
* Initial revisionmailman1998-02-271-0/+150