Difference between revisions of "Mail Folder Locations"

Line 47: Line 47:
 
# Edit the <code>.subscriptions</.code> file and remove the mailbox directory prefix from your folders.
 
# Edit the <code>.subscriptions</.code> file and remove the mailbox directory prefix from your folders.
 
#* e.g. if your prefix is "<code>Mail</code>", you'd change things like "<code>Mail/seminars</code>" to just "<code>seminars</code>".
 
#* e.g. if your prefix is "<code>Mail</code>", you'd change things like "<code>Mail/seminars</code>" to just "<code>seminars</code>".
# Create a <code>~/.mail_location</code> file and put your mailbox directory into it on a single line.
+
# Create a <code>~/.mail_location</code> file and enter your mailbox directory into it on a single line.
 
# Restart your mail client, remove any IMAP prefix setting, and make sure everything looks right.
 
# Restart your mail client, remove any IMAP prefix setting, and make sure everything looks right.
  
 
[[Category:Receiving Email]]
 
[[Category:Receiving Email]]

Revision as of 15:51, 7 May 2018

If you only check your mail through IMAP or POP (as documented on our Receiving Email page), you don't need to worry about where the mail is actually stored. (With an exception for Grad Net accounts; see that section below for details.) If you want to access the files directly (e.g. to set up procmail or use Pine directly on your mail folders), here's where they are.

All Accounts: Two Types of Folders

When our server receives email for you, it places that email message in your INBOX. (Unless you forward your mail or use procmail to put messages into a different folder.)

Your mail client will probably have the capability of moving emails into other folders, or mailboxes. Certain mailboxes often have special meaning for a particular client. For example, many clients store copies of email you've sent in a mailbox named "Sent".

The locations of your INBOX and your other mailboxes vary a little depending on whether you have a ugrad account or a grad net account.

Ugrad Net Mail Folders

Your INBOX is a single file in /var/spool/mail (on any of our Linux clients) with a name matching your account name. If your account is "example", your INBOX is /var/spool/mail/example.

Your mailboxes (think of them as your "mail folders" you would see in your mail client) are in the Mail directory in your home directory. Each mailbox is a separate file.

Note: Some older accounts have their mailboxes in a directory named mail (starting with a lowercase "m"). At this point, however, most people will be using Mail (with an uppercase "M").

Grad Net Mail Folders

Your INBOX is a single file in /var/spool/mail (on any of our Linux clients) with a name matching your account name. If your account is "example", your INBOX is /var/spool/mail/example.

The location of your mailboxes (think of them as your "mail folders" you would see in your mail client) is controlled by the contents of the .mail_location file in your home directory. If that file is empty or doesn't exist, your home directory is also the location of your mailboxes. Otherwise, the first line in that file gives the name of the directory containing your mailboxes. (Lines after the first line are currently ignored, but might be given other meanings in the future.)

Newer accounts have the Mail directory listed in the .mail_location file, so that's where those accounts' mailboxes are. Older accounts don't have a .mail_location file, so their mailboxes are in their home directory.

Changing Your Grad Net Mailbox Location

If you want to, you can change the location of your mailboxes for your grad net account. This can be particularly useful if you have an older account (with your mailboxes in your home directory) and you have a significant number of files in your home directory that are not mail folders. Many mail clients will try to treat every file in your mailbox directory (i.e. home directory) as a mail folder and will take a long time to look through all of them at times. (This can be mitigated a bit by setting an IMAP prefix, but changing your mailbox location is generally a better solution.)

  1. Decide where you want your mailboxes to be. We recommend Mail for consistency.
  2. If you have a mail client running, exit it.
  3. In your home directory, create that Mail directory, if it doesn't already exist.
  4. Move your current mailboxes into that directory.
  5. Move your ~/.subscriptions file (if you have one) into that directory.
  6. Edit (or create) a ~/.mail_location file and enter your new mailbox directory into it on a single line.
  7. Restart your mail client and make sure everything looks right.

Switching from an IMAP Prefix to a Mailbox Subdirectory

Before our separate mailbox definitions were available, we recommended that people put all of their mailboxes into a subdirectory and then set that subdirectory as an IMAP prefix. This setup works, but still has some drawbacks with respect to setting a .mail_location directly. To move from the old setup to the new one:

  1. If you have a mail client running, exit it.
  2. If you have some mail folders in your home directory (e.g. "Sent", "Junk"), move them into your mailbox directory.
    • If you're not sure whether you have any such folders, look at your ~/.subscriptions file for any folders that aren't in the mailbox directory already.
  3. Move your ~/.subscriptions file (if you have one) into your mailbox directory.
  4. Edit the .subscriptions</.code> file and remove the mailbox directory prefix from your folders.
    • e.g. if your prefix is "Mail", you'd change things like "Mail/seminars" to just "seminars".
  5. Create a ~/.mail_location file and enter your mailbox directory into it on a single line.
  6. Restart your mail client, remove any IMAP prefix setting, and make sure everything looks right.