Steven Jones wrote:

>While looking at the shunt queue I see a all pcks at a certain time (Feb 17 
>20:21) I have looked at so far have this as a content, instead of normal 
>content.
>
>============
>[r...@vuwunicosmtp004 shunt]# /var/mailman/bin/show_qfiles 
>1197321907.8858631+471a68770096868aa8540e5bf8bc643da86ac63d.pck|moreTraceback 
>(most recent call last):
>  File "/var/mailman/bin/show_qfiles", line 74, in ?
>====================> 
>1197321907.8858631+471a68770096868aa8540e5bf8bc643da86ac63d.pck
>    main()
>  File "/var/mailman/bin/show_qfiles", line 67, in main
>    sys.stdout.write(msg.as_string())
>  File 
> "/var/tmp/mailman-2.1.5.1-25.rhel3.8-root/var/mailman/pythonlib/email/Message.py",
>  line 130, in as_string
>  File 
> "/var/tmp/mailman-2.1.5.1-25.rhel3.8-root/var/mailman/pythonlib/email/Generator.py",
>  line 102, in flatten
>  File 
> "/var/tmp/mailman-2.1.5.1-25.rhel3.8-root/var/mailman/pythonlib/email/Generator.py",
>  line 130, in _write
>  File 
> "/var/tmp/mailman-2.1.5.1-25.rhel3.8-root/var/mailman/pythonlib/email/Generator.py",
>  line 156, in _dispatch
>  File 
> "/var/tmp/mailman-2.1.5.1-25.rhel3.8-root/var/mailman/pythonlib/email/Generator.py",
>  line 230, in _handle_multipart
>  File 
> "/var/tmp/mailman-2.1.5.1-25.rhel3.8-root/var/mailman/pythonlib/email/Generator.py",
>  line 102, in flatten
>  File 
> "/var/tmp/mailman-2.1.5.1-25.rhel3.8-root/var/mailman/pythonlib/email/Generator.py",
>  line 130, in _write
>  File 
> "/var/tmp/mailman-2.1.5.1-25.rhel3.8-root/var/mailman/pythonlib/email/Generator.py",
>  line 156, in _dispatch
>  File 
> "/var/tmp/mailman-2.1.5.1-25.rhel3.8-root/var/mailman/pythonlib/email/Generator.py",
>  line 297, in _handle_message
>  File 
> "/var/tmp/mailman-2.1.5.1-25.rhel3.8-root/var/mailman/pythonlib/email/Generator.py",
>  line 102, in flatten
>  File 
> "/var/tmp/mailman-2.1.5.1-25.rhel3.8-root/var/mailman/pythonlib/email/Generator.py",
>  line 130, in _write
>  File 
> "/var/tmp/mailman-2.1.5.1-25.rhel3.8-root/var/mailman/pythonlib/email/Generator.py",
>  line 156, in _dispatch
>  File 
> "/var/tmp/mailman-2.1.5.1-25.rhel3.8-root/var/mailman/pythonlib/email/Generator.py",
>  line 230, in _handle_multipart
>  File 
> "/var/tmp/mailman-2.1.5.1-25.rhel3.8-root/var/mailman/pythonlib/email/Generator.py",
>  line 102, in flatten
>  File 
> "/var/tmp/mailman-2.1.5.1-25.rhel3.8-root/var/mailman/pythonlib/email/Generator.py",
>  line 130, in _write
>  File 
> "/var/tmp/mailman-2.1.5.1-25.rhel3.8-root/var/mailman/pythonlib/email/Generator.py",
>  line 156, in _dispatch
>  File 
> "/var/tmp/mailman-2.1.5.1-25.rhel3.8-root/var/mailman/pythonlib/email/Generator.py",
>  line 277, in _handle_message_delivery_status
>  File 
> "/var/tmp/mailman-2.1.5.1-25.rhel3.8-root/var/mailman/pythonlib/email/Generator.py",
>  line 102, in flatten
>  File 
> "/var/tmp/mailman-2.1.5.1-25.rhel3.8-root/var/mailman/pythonlib/email/Generator.py",
>  line 130, in _write
>  File 
> "/var/tmp/mailman-2.1.5.1-25.rhel3.8-root/var/mailman/pythonlib/email/Generator.py",
>  line 156, in _dispatch
>  File 
> "/var/tmp/mailman-2.1.5.1-25.rhel3.8-root/var/mailman/pythonlib/email/Generator.py",
>  line 274, in _handle_message_delivery_status
>TypeError: iteration over non-sequence


That's not the content of the shunt queue entry, it is the traceback
from the exception that show_qfiles throws when it attempts to display
the message because the message is malformed.

What happens with bin/dumpdb instead of bin/show_qfiles?


Here's a withlist script you can try:

------------------------------------------------------------------
import os
import copy
from Mailman import mm_cfg
from Mailman.Mailbox import Mailbox
def find_bad(mlist):
    fn = os.path.join(mm_cfg.VAR_PREFIX,
                      'lists',
                      mlist.internal_name(),
                      'digest.mbox'
                      )
    try:
        mbox = Mailbox(open(fn))
    except IOError:
        return
    msg = mbox.next()
    msgno = 1
    while msg is not None:
        if msg == '':
            # It was an unparseable message
            print '------------------------------'
            print 'Message %i: Unparseable' % msgno
            print '------------------------------'
            msg = mbox.next()
            msgno += 1
            continue
        print '------------------------------'
        print 'Message %i:' % msgno
        print 'Subject: %s' % msg['subject']
        print 'From: %s' % msg['from']
        try:
            z = copy.deepcopy(msg)
        except RuntimeError:
            print 'Bad One!'
        print '------------------------------'
        msgno += 1
        msg = mbox.next()
------------------------------------------------------------------


If you save that in Mailman's bin/ directory as bin/find_bad.py, then
you can run the following:

 bin/withlist -r find_bad -a

It will check every digest.mbox and print the sequence number, Subject:
and From: of every message and try to do a deepcopy of the message ad
print "Bad One!" if it throws an exception.

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

------------------------------------------------------
Mailman-Users mailing list Mailman-Users@python.org
http://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://wiki.list.org/x/AgA3
Security Policy: http://wiki.list.org/x/QIA9
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe: 
http://mail.python.org/mailman/options/mailman-users/archive%40jab.org

Reply via email to