How to change Mailbox-Names ?

Max Meyer
2013-12-09
2013-12-10
  • Max Meyer

    Max Meyer - 2013-12-09

    Hello,

    iam looking for a solution to change names of Mailboxes as easy as possible, in best case through the web interface.

    The Problem is if someone has his/her name changed (exp. marriage), we dont want the old name to occur anymore in the e-mails-adress.

    We were thinking of a script that renames the mailuser folder on the server and afterwards updates this information in the database, activated with a button in the Postfix Admin webinterface.

    Is there allready a solution for this kind of problem?

    I appreciate any help.

    greetings

     
  • Simon Hobson

    Simon Hobson - 2013-12-09

    As far as I know there is no existing solution for this - I agree it would sometimes be useful.

     
  • Christian Boltz

    Christian Boltz - 2013-12-09

    This isn't as easy to implement as it might look ;-) because the mail address is used as primary key in the mailbox and alias table, and therefore not meant to be edited. Also the maildir column won't be updated.

    Feel free to do some experiments with SVN trunk (you can easily make the username and maildir editable with a $CONF[mailbox_struct_hook] and $CONF[alias_struct_hook] function) - but I can't promise that you'll get a working result ;-)

    I'd propose to create a new mailbox, and change the old mailbox to forward-only. This even has the advantage that people that were not invited to the marriage ;-) will still be able to send mails to the old address.

     
  • Max Meyer

    Max Meyer - 2013-12-10

    Thank you very much for your help and suggestions Simon and Chrisitian. We will try how well the user accepts your suggestion to simply make a new mailbox and forward the old one.

    Anyways the thing we were aiming for was a standalone system were an admin can handle everything through the web interface without root-access and without mailbox migration. But for now we will stick with the "new mailbox" solution and look into this later, if we find any other solution ill post it here.

    Thank you very much again, i appreciate your help. Sorry for my english, iam trying my best. ;)

     
    Last edit: Max Meyer 2013-12-10
  • Simon Hobson

    Simon Hobson - 2013-12-10

    I don't see any great problem in renaming a mailbox - provided your code correctly maintains the right relationships/keys/etc and correctly updates all fields that change (eg path to mailbox). One issue you would need to deal with is that the web server probably doesn't have permissions to go fiddling in the mail store.

    IMO just adding a new mailbox isn't the answer - unless the user only uses POP. If they use IMAP, I assume they would prefer to keep their old mail.

     
    • Charles

      Charles - 2013-12-10

      On 2013-12-10 10:40 AM, Simon Hobson simonhobson@users.sf.net wrote:

      I don't see any great problem in renaming a mailbox - provided your code
      correctly maintains the right relationships/keys/etc and correctly
      updates all fields that change (eg path to mailbox). One issue you would
      need to deal with is that the web server probably doesn't have
      permissions to go fiddling in the mail store.

      and I shudder to think about what might happen if it did...

      IMO just adding a new mailbox isn't the answer - unless the user only
      uses POP. If they use IMAP, I assume they would prefer to keep their old
      mail.

      What I would do...

      1. Create the new mailbox

      2. Delete the newly created maildir

      3. mv the old maildir to the new one

      4. Create an alias for the old email address to the new one.

      Done...

       

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks