Re: mbox to Maildir

Dylan Reinhardt <[email protected]>
Newsgroups gmane.org.user-groups.linux.pdxlug
Message-ID <[email protected]>
[ will try typing something before hitting "send" this time. ]

On Mon, 2004-05-03 at 16:53, Robby Russell wrote:
> I tried to use a mbox to maildir perl script (mb2md) but it requires 
> that the user have a shell on the machine and the users (few hundred) 
> don't have a shell to su to do the conversion.
> 
> Is there a script that will do this (as root) ? for any user that I want 
> to run the script for?

An outline of a Python script for this might be:

-----

#!/usr/bin/python

import os

mbox_name = 'mbox name goes here'

for user_name in os.listdir('/home/'):
    if mbox_name in os.listdir('/home/' + user_name):
        os.system('sudo %s mb2md -s /home/%s/%s' % (
                                                   user_name, 
                                                   user_name, 
                                                   mbox_name))

-----

Hope that helps

Dylan
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.