SurgeWeb Advanced Admin HowTo's

How to do some of the things that you may want to do but are not common practise.

Reset surgeweb's universal imap labes

Imap has up to 22 imap flags available as custom imap flags. These are unique to each account and will be used for all folders in this imap account. Under normal circumstances, once created you do not remove these as all message in all folders in the account should be checked to see if any existing labels need removing and this is likely be a non trivial operation (definitely so on large imap accounts).

In some cases manual reset is warranted and to do this you need to apply the following steps:

1. Remove flags from all messages

Using a mail client (like surgeweb with the pin labeled messages to top of the message list feature) you should check all folders for messages that have imap labels. Remove all these labels from all labelled messages. If this is not done these labels will visibly reappear as one of the newly labels depending on the creation number (1-22).

2. Close surgeweb and avoid other mail client activity

Particularly when modifying sw_labels.dat, make sure that surgeweb is not logged in.

3. Reset the imap custom flags

Delete the new.flags file from the users mailstore /mdir folder (find using "tellmail path user@domain"). This will render any imap flags previously set on any message in any form as meaningless, which is why these should already have been manually cleared first (step 1 above).

4. Edit surgeweb's flag definition

Surgeweb maintains a mapping of the imap flags in sw_labels.dat. This can be found in the users mailstore/xfile directory. To delete all labels (including surgeweb labels) remove this file. If you just want to reset the imap labels remove the entries in this file that refer to the imap labels in question using a text editor.

Also remove surgeweb's cached copy of this file in the users surgeweb folder (find using "tellmail swpath user@domain")

5. Reset surgeweb cache

Login to surgeweb and under Options-Preferences-Advanced, reset the surgeweb message cache.

Labels in surgeweb should now be reset.

  • surgeweb labels: Any surgeweb labels that are found on messages that were not removed should reappear as the original name. This may actually be used to your benefit.
  • universal labels: When new replacement custom imap labels are created, if any "mysteriously appear" on existing messages as the new label name it means not all labels were removed in step 1, so just remove the label from the message in question and ignore.