Email - on Linux

1 - About

Linux runs a “locally configured” mailer daemon that doesn't route messages by default through the Internet but only copies messages to other users spool directories

It is real SMTP-compliant email, it's just not routed over the Internet without configuration.

Locally email client send mail to other local users on the system by addressing to [email protected], or by just specifying the user.

3 - Mail location

It can be found in the $MAIL environment variable


echo $MAIL


/var/spool/mail/root

This is called a spool file. Standard location are:

  • /var/mail/$USER
  • or /var/spool/mail/$USER

4 - Local Client

  • mail (or Mail, mailx). Default

#centos
yum install mailx

  • mutt
  • alpine
  • less (to probe the file)

# shows the latest mails, at the end if the file
less +G $MAIL 
less +G /var/spool/mail/root

5 - Configuration

The configuration is done via the mail transfer agent (MTA) to forward the messages to an mail address.

PAM has a mail module to set some configuration at login See pam_mail

The variable environment MAIL set the path of a mailbox


MAIL=/var/spool/mail/nico


Data Science
Data Analysis
Statistics
Data Science
Linear Algebra Mathematics
Trigonometry

Powered by ComboStrap