March 7, 2021
Hot Topics:

Enhancing your Webmail program

  • By Bjxrn Borud
  • Send Email »
  • More Articles »

While viewing the contents of a folder you can now move messages into other folders as well. Just mark the checkboxes in front of the messages you wish to move into a particular folder (just like you would do if you wanted to delete them), then select a folder from the folder pulldown menu in the lower right corner and click the "move to" button. The selected mail messages will then be moved to the target folder.

Folders and files

To make the files in which the folders reside easier to identify, and therefore easier to list in the Webmail interface, I've added some code to massage the folder names a bit.

When you want to enter or create a folder the folder name that you typed (or clicked on) is filtered through the function


  function m_mailbox_name ($mbx)
    global $M_MBOX, $M_PREFIX;

    /* no mailbox specified means we map it to the inbox */
    if ($mbx == "") {
      return $M_MBOX . "INBOX";

    /* replace some special chars */
    $mbx = ereg_replace("[^[:alnum:]]", "_", $mbx);

    return $M_MBOX . $M_PREFIX . $mbx;

If the mailbox name was blank, it will assume that we want the default folder. In the IMAP protocol this folder is called

. If the mailbox we request has a name, the code will remove any non-alphanumeric characters and the variables
are prepended to the mail folder name.

Page 3 of 7

This article was originally published on May 25, 1999

Enterprise Development Update

Don't miss an article. Subscribe to our newsletter below.

Thanks for your registration, follow us on our social networks to keep up-to-date