I need ways to bulk manage Mercury mail accounts, hundreds at a time, from information in a database.
Looking at Mercury's files, there seems to be a PMAIL.USR, and then a directory for each user containing a PASSWD.PM and a HIERARCH.PM that Mercury creates as required.
If I wrote a tool to create or delete the user directorys, whilst maintaining suitable entries in PMAIL.USR, is that all there is to it?
Regards,
Richard
yes, have a look at: http://community.pmail.com/files/folders/codesnippets/entry167.aspx
If I wrote a tool to create or delete the user directories, whilst
maintaining suitable entries in PMAIL.USR, is that all there is to it?
Pretty much that's it but you do not need the hierarch.pm. I wrote one in BASIC years ago to take data from a file and it's not all that difficult. You send the command "Reload Users" after you make the changes so the running version of Mercury gets the changes.
If this is a really significant change then I would pause or unload Mercury during the process so you would not lose mail. For example, it you delete a user you would want MercuryS to bounce the message but Mercury was still running MercuryS would receive the message and core try to deliver to a non-existent user. If mail for a new user was received it would be bounced. All in all is makes more sense to stop all the processes during the update.
[quote user="Peter Strömblad"]yes, have a look at: http://community.pmail.com/files/folders/codesnippets/entry167.aspx[/quote]
Thanks Peter, thats what I was intending to use, Delphi & MSSQL.
I'll read your code with interest and if I produce anything useful post it back here.
Regards,
Richard
Good. I'm in the middle of porting all to C#, as a webservice where the SQL end will contact each service to update domains, aliases, users, lists etc.
That code will be available here in due time.
Hi Thomas,
Thank you for your reply.
I think this is asking the same question, but in a different way, but I assume this implies that Mercury saves nothing to do with any particular user, such as which folders they have created in their mailbox and which mail is in which folder, anywhere other than somewhere within that users folder eg c:\MERCURY\MAIL\john.
Do the names of the files corresponding to mail in a users mailbox have to be unique to that user, or system wide unique? If they only have to be unique for each user, would that also imply that if I had 2 different Mercury servers and I wanted to move john's account from one to the other, moving c:\MERCURY\MAIL\john from server1 to server2 and maintaining PMAIL.USR is sufficient.
Thanks for your help,
Richard
Files/folders need be unique to the maildrop (=user), but the file/folder structure within imap in Mercury isn't that straightforward as to just create directories... - but yes if you have a user named John, you can create that user on the second server, then move the files from Johns maildrop on server1 to 2 and all works - this is one benefit of a file based maildrop - when it comes to a sort of lazy redundancy.
Your previous draft for topic is pending
If you continue, your previous draft will be discarded.