What is the "You have new mail" message in Linux/UNIX?
This video is brought to you by Memorabit, an app that sends technical terms, commands and definitions as reminders at unexpected moments, so they stay in memory. Built on cognitive science principles. Start free on web, iOS and Android:
iOS: https://apps.apple.com/app/id6782301691
Android: https://play.google.com/store/apps/detai...
--------------------------------------------------
Read the revolutionary AI books written by Turbina Editore, the first publishing house entirely run by artificial intelligence. This groundbreaking publisher has transformed the literary world, producing the most sought-after AI-generated books. Start reading today at:
https://turbinaeditore.com/en/
--------------------------------------------------
--------------------------------------------------
Hire the world's top talent on demand or became one of them at Toptal: https://topt.al/25cXVn
and get $2,000 discount on your first invoice
--------------------------------------------------
Take control of your privacy with Proton's trusted, Swiss-based, secure services.
Choose what you need and safeguard your digital life:
Mail: https://go.getproton.me/SH1CU
VPN: https://go.getproton.me/SH1DI
Password Manager: https://go.getproton.me/SH1DJ
Drive: https://go.getproton.me/SH1CT
Music by Eric Matyas
https://www.soundimage.org
Track title: Underwater World
--
Chapters
00:00 What Is The &Quot;You Have New Mail&Quot; Message In Linux/Unix?
00:35 Answer 1 Score 28
01:23 Accepted Answer Score 473
03:21 Answer 3 Score 45
04:31 Answer 4 Score 289
04:40 Thank you
--
Full question
https://superuser.com/questions/306163/w...
--
Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...
--
Tags
#linux #unix #email #root
#avk47
ACCEPTED ANSWER
Score 473
Where is this mail?
It's likely to be in the spool file: /var/mail/$USER or /var/spool/mail/$USER are the most common locations on Linux and BSD.
(Other locations are possible – check if $MAIL is set – but by default, the system only informs you about /var(/spool)/mail.)
Usually the spool file is in a very simple mbox format, so you can open it in a text editor or pager.
For a slightly more convenient way, most distributions come with a program called mail (or Mail, mailx). You can try mutt or alpine; you can even configure it to be sent to an outside mailbox. (See "is this real mail?" below.)
What does it contain, and who/what sent it?
Most often the messages contain output of cron jobs, or a system security report by logwatch, or similar junk. Read it and find out.
How important is it?
Depends greatly on the contents of each message.
You should at least scan the subject headers – often people ignore the mail for months never realizing that their daily cron jobs fail.
Is this even actual "mail" in the same sense as email? Or is it just my system telling me something?
Yes to both – it's generated by your system telling you something, but it's also actual email and can be handled as such.
You can (and should) configure your mail software – the "MTA" aka /usr/sbin/sendmail – to forward the messages to your personal mail address. The exact instructions vary depending on which MTA (if any) you have installed, whether this is a personal computer or a server, whether you have your own domain or use a @gmail.com, and so on.
Note that /usr/sbin/sendmail nowadays is a shared API and doesn't necessarily mean the original Sendmail MTA. In fact, you shouldn't use Sendmail, but something more modern like OpenSMTPD, Postfix, or Exim4. All of them provide the same /usr/sbin/sendmail tool, but they're easier to configure, more secure, and just as powerful.
ANSWER 2
Score 289
The easiest way for me was to run the following in a terminal:
cat /var/spool/mail/root
ANSWER 3
Score 45
Just to offer some clarification, it's been the tradition for a long time for UNIX boxes to run a "locally configured" mailer daemon that doesn't route messages through the Internet, but only copies messages to other users spool directories (as @John T mentioned). It is real SMTP-compliant email, it's just not routed over the Internet because it doesn't need to be.
So, if you fire up an email client (like alpine or mutt) you can send mail to other users on the system by addressing to user@hostname, or in many cases, just specifying the user. You also likely have a command line utility called mailx that can be used to send a quick email using your shell.
Now, if you want to send messages to users on systems other than the one you are logged in to, that's where the real fun begins. You'll need to configure your mailer daemon to recognize and hand off external email to a transfer agent, configure the transfer agent, and do a whole bunch of stuff I don't yet understand myself.
ANSWER 4
Score 28
Where is this mail?
Very likely stored on your machine, in the mailbox folder for your root user (where THAT is depends on what kind of mail server you have installed). You can probably access it quite quickly through alpine.
What does it contain?
Probably just some system report type stuff. "So and so tried to login 10 times with an incorrect password".. "I wish someone would run updates on me", "driver such-and-such is failing constantly", "The NSA bot has boosted performance by 1%".. etc..
Who/What sent it?
Services on your server, most likely.
How important is it?
Depends on how important your server is.