I've been mulling over how to implement the pending queue conversion
feature that's mentioned in the wiki[¹] and it's not entirely clear to
me how this should be done. I could use your help if you have any
input.
One might ask whether conversion code is even necessary. If you're
the only TMDA user on your system, it would be pretty easy to convert
your current pending queue to say, a Maildir --
% chmod +t ~/.tmda
% mv ~/.tmda/pending ~/.tmda/pending.old
% maildirmake ~/.tmda/pending
% cp ~/.tmda/pending.old/*.msg ~/.tmda/pending/cur
% chmod -t ~/.tmda
Done. Going from Maildir to an "original" format queue would be
similarly straightforward. But consider the following cases:
- Sites which have hundreds or more TMDA users, perhaps in a vpopmail
setup. A good system admin could script the above for all his TMDA
users, but it would be a PITA to do so.
- Converting from a file based format like Maildir to say a SQL db
format. Now things aren't so straightforward, and multiply that for
multi-user installations.
So I do think we should implement conversion. I initially thought it
could be made seamless, where tmda-filter would check the value of
PENDING_QUEUE_FORMAT (a new var), and compare that to the current
pending queue. If they differ, it's assumed that the user has
selected a new format, and the conversion would be done from the old
to new format.
But I now think this might be too difficult. How for example would we
accurately figure out what format the old pending queue was in? If it
was a SQL db for example, the storage wouldn't be in PENDING_DIR,
so peeking inside PENDING_DIR wouldn't really help. I don't think
it's possible to do this in a totally hands free manner. This has to
be 100% accurate and reliable so that no mail is lost.
So I'm thinking the user will need to indicate he wants a conversion
done, and from what to what. The question is how best to do that?
Should it be a bin/tmda-foo script that the user or administrator runs
from a shell to convert pending queues one by one or en masse?
Or should it be driven by tmda-filter? Perhaps by adding a config
variable to specify this. e.g,
# convert pending queue from current maildir to a mysql db
PENDING_QUEUE_CONVERT = ('maildir', 'mysql')
Then next time a message is delivered, some code will take note of
this, make sure the current pending queue is really a maildir, and
then do the conversion.
I'm not really sure what the best option might be. My own use of TMDA
is pretty simple, but I'm trying to think of a solution that will
adequately address the diverse needs the whole.
Footnotes:
[¹]
http://wiki.tmda.net/TmdaOneDotTwoTodoList#head-9c4fb0cacc9f995ccfa607c65c2538db235638ce
_________________________________________________
tmda-workers mailing list ([email protected])
http://tmda.net/lists/listinfo/tmda-workers