[Mailman-Users] Help: 'str' object has no attribute 'get_sender'

Mark Sapiro msapiro at value.net
Thu Sep 28 17:34:02 CEST 2006

aaron wrote:
>I just upgraded from Mailman 2.1.5 to 2.1.9 on FreeBSD 4.9 with Python 2.4
>and Postfix 2.1.5. Mailman is now broken.
>I'm getting the following output constantly in /logs/error and no Mailman
>messages are going out:
>Sep 27 22:37:25 2006 (20239) SHUNTING:
>Sep 27 22:37:25 2006 (20239) Uncaught runner exception: 'str' object has no
>attribute 'get_sender'
>Sep 27 22:37:25 2006 (20239) Traceback (most recent call last):
>  File "/usr/local/mailman/Mailman/Queue/Runner.py", line 112, in _oneloop
>    self._onefile(msg, msgdata)
>  File "/usr/local/mailman/Mailman/Queue/Runner.py", line 162, in _onefile
>    sender = msg.get_sender()
>AttributeError: 'str' object has no attribute 'get_sender'

Something is not properly upgraded/installed. Either there is something
wrong with the dequeue() method in Mailman/Queue/Switchboard.py
causing it to not convert a 'string' message to a message object when
_parsemsg is true in the metadata, or there is something wrong with
the enqueue() method causing it to not set the _parsemsg flag when the
message is saved as a string or there is some other issue.

As a temporary workaround, you could try replacing

        if data.get('_parsemsg'):
            msg = email.message_from_string(msg, Message.Message)

in the dequeue() definition with

        if istype(msg, str):
            msg = email.message_from_string(msg, Message.Message)

Before you do that, you might try bin/dumpdb on one of the shunted
messages and see what it loogs like - in particular, the value of
_parsemsg. Better still, you could stop Mailman and post something and
look at the entry in the 'in' queue.

Mark Sapiro <msapiro at value.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