I read that the $MAIL shell environment variable is one of the most common ones, and stores the location of my mailbox file, where my emails are stored.

I looked into the /var/spool/mail and /var/mail directories, and there are no files or directories in them at all (checked with cd /var/spool/mail; ls as well as checking Show Hidden Files under the View menu.

Yet I have Thunderbird Mail running and do have mail coming in from my GMail.

So my (related) question is two-fold - Where are my emails kept? And why is my $MAIL environment variable not defined?


The $MAIL variable points to the location of your system mail account (i.e. where Postfix, Exim, ... would drop your mails when using the sendmail or mail to send a mail to a local user), however this variable is not used by any graphical E-Mail client I know of -- Which is probably why is its not defined.

Thunderbird stores your E-Mail in these directories:

  • ~/.thunderbird/<ProfileName>/Mail for local messages (sent messages and messages obtained via POP3)
  • ~/.thunderbird/<ProfileName>/ImapMail for downloaded IMAP messages

Note: <ProfileName> is the name of your user Thunderbird user profile and will look similar to this: e7d2hvg8.default.

  • So if I download and install Postfix (which I actually don't know how to at the moment, actually), I will have the $MAIL variable set automatically? A bit of topic, but I also don't have the PROMPT_COMMAND environment variable. – dayuloli Jun 1 '14 at 3:29
  • I'm not sure but it seems like the $MAIL variable is set for all new user logins after the /var/mail directory has been created, however Postfix might also be involved somehow... Anyway installing software is done through apt-get or aptitude on command line (i.e.: sudo aptitude install postfix), there is also the Software Center for higher level and Synaptic for lower level package management if you prefer GUIs. OT: What's your background? REHL? SLES? BSD? Mac? – ntninja Jun 1 '14 at 13:03
  • Also $PROMPT_COMMAND can be set in ~/.bashrc – ntninja Jun 1 '14 at 13:04
  • Thanks for the help! I've used Windows all my life, never touched Unix or Linux til this week. I want to learn Linux because I think managing my own server would be really cool! And most servers run Linux. – dayuloli Jun 1 '14 at 13:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.