[Mailman-Users] mailman-AttachmentMove: completely remove moved attachment?

Mark Sapiro mark at msapiro.net
Thu May 15 16:44:34 CEST 2014


On 05/15/2014 01:48 AM, Sylvain Viart wrote:
> 
> What'd be the trouble if I completely remove attachment from the message?


None if you do it correctly.

Assuming msg is a multipart message object with 3 subparts and you want
to delete the second of the 3 parts.

parts = msg.get_payload()
# parts is a list of 3 message objects which are the sub-parts.
# delete the second.
del parts[1]
msg.set_payload(parts)

-- 
Mark Sapiro <mark at msapiro.net>        The highway is for gamblers,
San Francisco Bay Area, California    better use your sense - B. Dylan


More information about the Mailman-Users mailing list