On 3/4/2010 4:23 AM, Cedric Jeanneret wrote:
> 
> I think I found what's the problem is : the script works now, but as
> I write my own archiver, it doesn't do the pipermail part (i.e.
> update mails in archive)... I thought that this code :
> 
> mlist = MailList.MailList(maillist, lock=False)
> msg = email.message_from_file(sys.stdin, Message.Message)
> f = StringIO(str(sys.stdin))
> h = HyperArch.HyperArchive(mlist) 
> h.processUnixMailbox(f)
> f.close()
> 
> did all, but after reading a bit of code, it doesn't exactly. It
> saves to .mbox file, right ?


No. It doesn't save to the .mbox file. If you look at the ArchiveMail()
method in Mailman/Archivers/Archiver.py. it first saves to the .mbox by
doing

        if mm_cfg.ARCHIVE_TO_MBOX in (1, 2):
            self.__archive_to_mbox(msg)

Then it either calls the external archiver or executes essentially the
above to archive the mail in the pipermail archive.

What you are missing is

h.close()

and that's why it doesn't work.


> I tried to find where it does the pipermail stuff, but it's a bit
> complicated [I'm not so at ease with Python].


Yes, the archiver is very convoluted because classes are subclassed and
methods overridden all over. Don't feel bad. I've been looking at it for
years and still only barely understand it.

-- 
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