[Pdx-pm] help with archivemail (python) ??
John Springer
john at digitalmx.com
Fri Feb 9 20:19:15 PST 2007
I'm trying to use a python program called archivemail to manage
a bunch of user mailboxes. Sorry for the foreign language
request but I'm calling it from a perl script so i should
get partial credit.
I don't know squat about python.
The program is putting stuff in the wrong temp directory
and I can't figure out how to fix it.
It's using /tmp and it needs to be /usr/tmp on my system because]
/tmp is a small partition. It's crashing with out-of-space on
self.mbox_file.write(body)
I can't for the life of me follow where the temp path is coming from.
Can anyone give me some guidance?
Here's some key statements i think:
import tempfile (seems to be a python module.. i'm suspicious this
is where /tmp is coming from.)
and
class StaleFiles:
"""Class to keep track of files to be deleted on abnormal exit"""
archive = None # tempfile for messages to be archived
procmail_lock = None # original_mailbox.lock
retain = None # tempfile for messages to be retained
temp_dir = None # our tempfile directory container
and
class RetainMbox(Mbox):
"""Class for holding messages that will be retained from the
original
mailbox (ie. the messages are not considered 'old'). Extends the
'Mbox'
class. This 'mbox' file starts off as a temporary file but will
eventually
overwrite the original mailbox if everything is OK.
"""
__final_name = None
def __init__(self, final_name):
"""Constructor - create a temporary file for the mailbox.
Arguments:
final_name -- the name of the original mailbox that this
mailbox
will replace when we call finalise()
"""
assert(final_name)
temp_name = tempfile.mktemp("retain")
self.mbox_file = open(temp_name, "w")
self.mbox_file_name = temp_name
_stale.retain = temp_name
vprint("opened temporary retain file '%s'" %
self.mbox_file_name)
self.__final_name = final_name
--
John Springer
Somewhere in Portland
Where it's probably raining.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.pm.org/pipermail/pdx-pm-list/attachments/20070209/7f04d623/attachment.html
More information about the Pdx-pm-list
mailing list