Email - on Linux

Card Puncher Data Processing


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 user@hostname, or by just specifying the user.

Mail location

It can be found in the MAIL environment variable

echo $MAIL

This is called a spool file. Standard location are:

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

Local Client

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


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


Discover More
Card Puncher Data Processing
What is Sendmail ?

Sendmail is: * a mail transfer agent (MTA) for linux (ie a SMTP server, running on the port 25). * a command line (MUA) to send a message Almost all MTAs provide a sendmail interface making it...

Share this page:
Follow us:
Task Runner