| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
| |
is updated.
|
| | |
|
| | |
|
| |
|
|
|
| |
non-ASCII data, lets not make email.Header.Header barf on it; use 'replace'
as the unicode error strategy (this requires email-2.5b1.)
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
constructor is changing. We no longer pass the sender in since that's
calculated to be the site list's -bounces address to prevent mail
loops when a list's owner bounces.
Also, factor out the _enqueue() private method from the send()
method. OwnerNotifications need to set the `envsender' key on the
message's metadata.
Problem diagnosed by Peer Heinlein.
|
| |
|
|
|
|
|
|
|
| |
UserNotification but provides a different constructor. It calculates
the recipients from the list's owners and, if the tomoderators flag is
true (the default), includes the list's moderators.
The ctor also munges the To header so that it looks like it's being
sent to the list's -owner address.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Heinlein's recent problems. This patch adds several things to better
update pickled Message objects to the latest email package.
Specifically,
__init__(): Add a version number to Message objects so that we can
make __setstate__() more efficient (I don't want to do the next bit of
hackery for every single unpickled Message object).
__setstate__(): For Message objects older than the current email
package version, we'll ensure that the data format is the same. We
keep the previous updates and add one that trolls through the message
headers, ensuring that if any of the headers are Header instances,
that their chunks all have 2nd items as Charset instances, not
strings. This is an invariant for email 2.4.3, but older Message
instances might not conform.
|
| |
|
|
| |
to aid in debugging.
|
| |
|
|
|
|
|
|
|
|
|
| |
updates from email 2.1 and email 2.2, you're a bit screwed. Message
objects grew a _default_type attribute which is *probably* text/plain
but that's not guaranteed. Unfortunately at the time __setstate__()
is called, we can't know for sure what _default_type ought to be,
since it depends on whether this object is contained in a
multipart/digest and we have no reference to the container.
This is the best we can do.
|
| |
|
|
|
| |
Precedence: header, add Precedence: bulk since these are typically
internally crafted messages destined for a single address.
|
| |
|
|
|
|
| |
2-tuple with an empty realname item; second, we should extract all
matching headers with Message.get_all() to make sure we don't miss
anything (even though RFC 2822 says those should only appear once).
|
| |
|
|
| |
List-Post: et al headers.
|
| |
|
|
| |
None, which obviously can't be .split(). This is more robust.
|
| |
|
|
|
|
|
|
|
| |
the character set. The most common reason for this is that the
notification message is a multipart/mixed and it makes no sense to
give those type of messages a charset.
.send(): Set the `nodecorate' key to 1 so that messages that original
from the virgin queue don't get headers and footers.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
loosens the membership test to check additional headers. I've
modified Jason's patch in the following ways:
- get_author() -> get_senders() even though I suggested the former. ;)
I'd like to eventually deprecate get_sender() so this will be its
eventual replacement.
- added an optional `headers' argument which defaults to None, meaning
the list of headers we agreed on previously. This allows you to
pass in the exact headers you want to consult (and their order).
- Some implementation details.
|
| |
|
|
|
|
|
|
|
| |
there was a lang argument given, call self.set_charset() instead of
doing nothing. Note that when a text argument is given, set_charset()
is called implicitly by set_payload().
Otherwise, given lang but no text results in no MIME-Version: header
being set.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
they have a _charset attribute, adding a default one if not. This
should fix a problem I think Dan Mick had, which I believe is caused
by a Message object being pickled w/ version 0.96 of the email
package, and unpickled by 0.97/1.1 of the email package.
Why doesn't this go into email.Message.Message? Because I don't want
to clutter its code up with something that should both be transient
and assumes that Message is pickled. Mailman seems more responsible
for the pickle consistency (if every Python class that grew an
attribute had to have such schema migration code, we'd be up sh*ts
creek).
|
| |
|
|
|
|
|
| |
charset information can be propagated into the headers, if necessary.
Use the new mimelib/email package's Charset and Header classes.
Patch by Ben Gertzfield. Requires email 0.97.
|
| |
|
|
|
| |
module pprint uses repr() instead of str(). This aids in debugging
with bin/dumpdb.
|
| |
|
|
|
|
|
| |
one if it's missing (most notably qmail). It's easy and correct for
us to add a compliant one.
SF patch #500670 by Jason Mastaler.
|
| | |
|
| |
|
|
|
| |
Also, use cStringIO directly instead of our own hack-around StringIO
module.
|
| |
|
|
|
|
|
|
|
|
|
| |
cause None to be returned from self.__getitem__(). Keep looking
through headers if that happens (this avoids a bug reported by Mentor
Cana on messages with no Sender: header and USE_ENVELOPE_SENDER set to
true).
send(): If the message doesn't have a Message-ID (and it probably
won't), craft one. This aids in debugging because the message-id will
get logged to logs/smtp.
|
| |
|
|
|
| |
argument defaults to None. Only set the payload when the text
argument is not None.
|
| |
|
|
| |
through to the enqueue() method.
|
| |
|
|
| |
comparisons.
|
| |
|
|
|
| |
the 0.3 release. This means you must download and install the 0.3
version of mimelib to work with the current CVS snapshot!
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
| |
contract with rfc822.Message.__init__() and also breaks news->mail
gatewaying. A different patch will be applied to fix SF bug #109220.
|
| |
|
|
|
|
| |
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.).
|
| |
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
| |
algorithm needs to be reproducible.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
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.
|
| |
|
|
|
| |
elements for the value of the To: field, and assign a copy of the list
to self.recips. Otherwise do the old behavior.
|
| |
|
|
| |
underscore are volatile and don't get saved to disk.
|
| |
|
|
| |
None. The type of the return value must always be a string.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
should fix problems where approved held messages weren't being
archived properly, and other problems. Thanks to Thomas Wouters for
tracking this problem.
|
| |
|
|
|
|
|
|
| |
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.
|
| | |
|
| |
|
|
|
|
|
|
|
| |
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.
|
| | |
|
| |
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
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).
|
| |
|
|
| |
are valid.
|
| |
|
|
|
|
|
|
|
| |
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.
|