Меню Рубрики

Linux you have new mail

You have new mail

Звиняйте за тупость. Сегодня логинюсь — выходит такое сообщение. Где его посмотреть? Кажется, всё уже облазил, не нашёл. И «кто» его пишет?

Re: You have new mail

Смотреть в локальной папке /var/spool/mail/user. Проверка почты идет скорее всего через biff и прописана в /etc/profile.

Re: You have new mail

mail в консоли набери, удивишься 🙂

а сообщения тебе пишет сама система

Re: You have new mail

неа, нифига 🙂 подефолту локальная почта юзеров хранится в mbox, а не в maildir

хотя наверное в разных дистрах поразному 😉

Re: You have new mail

Re: You have new mail

Re: You have new mail

Что /etc/login.defs ?
Или ты JB ответил о mbox/maildir ?
Или мне о MAIL_CHECK_ENAB ?
—————————————
Я писал о том кто сообщает о почте — это login

Re: You have new mail

По-порядку:
1. ls -A /var/spool/mail/
.keep
Т.е. пусто.
2. $ mail
bash: mail: command not found
3. mutt-а тоже нет. Видимо, надо поставить.
4. Ни в /etc/profile, ни в /etc/login.defs никакого упоминания не увидел.
Не хочется быть «чайником», но вот.

Re: You have new mail

> bash: mail: command not found

mailx установлен? и вообще какой дистрибутив?

Re: You have new mail

Похоже что джента, т.к. есть .keep в папках.

Re: You have new mail

У меня на слаке уже давно отключена проверка почты в локальном ящике, ибо неоткуда ей там взяться. Прописывается это в /etc/login.defs.

Re: You have new mail

Надо же, угадал. Действительно Gentoo. Но я так и не понял, уведомления о почте идут, а посмотреть никак.

Источник

“You have mail” – How to Read Mail in Linux Command Line

This indicates there is a message in your spool file. Usually the spool file is in a very simple mbox format, so you can open it in a text editor or with the mail program.

View Spool File

Use the following command to read the mail for the currently logged in user. The $(whoami) variable returns the currently logged in user.

Press uppercase G to scroll to the bottom of the file and lowercase q to quit. Use you keyboard arrows to scroll up and down.

If you wish to read another user’s mail, just enter their user name.

Delete Spool File

You can simply delete the /var/mail/username file to delete all emails for a specific user. The $(whoami) variable returns the currently logged in user.

Using the mail Program

You can also use the mail program to easily list and view messages in your spool file. If mail is not installed, you can install it with sudo apt install mailutils .

Messages will be listed with a corresponding number:

After the ? prompt, enter the number of the mail you want to read and press ENTER .

Press ENTER to scroll through the message line by line and press q to return to the message list.

To exit mail , type q at the ? prompt and then press ENTER .

Delete All Messages using mail

To delete all messages using mail, after the ? prompt, type d * and press ENTER .

Let me know if this helped. Follow me on Twitter, Facebook and YouTube, or 🍊 buy me a smoothie.

Источник

What is the “You have new mail” message in Linux/UNIX?

Sometimes, when I log into a box and ‘su’ to root, I get a cute little message saying I have mail (thank GOD it’s not AOL).

  • Where is this mail?
  • What does it contain?
  • Who/What sent it?
  • How important is it?

Is this even actual «mail» in the same sense as email? Or is it just my system telling me something?

EDIT: In relation to this question, would I be able to send myself mail using the sendmail program like so: email@localhost ?

7 Answers 7

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.

The easiest way for me was to run the following in a terminal:

For anyone wondering how to read these messages one by one, you can just use ‘mail’

Then type a message number from the list which you want to read.

To goto the next message you can type ‘next’, another useful command is ‘delete’..

To see more about how the mail program works, see the output of man mail .

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.

Источник

You have new mail

Когда я логинюсь на tty или по ssh, я получаю уведомление «You have new mail», если есть новая почта. В иксовой сессии такого при запуске эмулятора терминала нет. Подскажите, пожалуйста, в каком конфиге может быть прописан вызов некой команды, которая показывает этот «you have new mail».

Это сообщение выводит login , там же, где он выводит и motd .

Что бы их отключить, достаточно сделать touch

Не, я такое же хочу в .zshrc себе запихнуть. А как бы это изящно сделать, чтобы дважды не выводилось? Хашнуть логин и в .zshrc записать?

Stdout команд в кроне в /dev/null направь.

Спасибо, буду вникать.

Баг-фикс: не -eq 0, а -ne 0 или || вместо &&. 🙂

А как бы мне сделать так, чтобы это выполнялось только в случаях, если я не через login в систему попадаю? Знаю, что можно проверить, не на tty ли я, но есть же ещё ssh.

Источник

«You have new mail»

Как убрать эту гадость? Не чтобы строчка не появлялась, а чтобы сами письма от систем не возникали.

Посмотри что их шлёт (cron?) и выключи там.

Там где-то правопреемник рута определён, кому рутовская почта пересылается.

А мне всегда приятно получать письма. ну только не когда пяти тысячам присылают письма про пенис, а когда именно тебе.

В slackware, когда только залогинился, сразу же письмо от самого Патрика. Меня это всегда впечатляло, сразу появлялось ощущение, что это не персоналка с консолью, а информационная система с командным центром управления.

Да и письмо Патрика лично тебе — это приятно. 🙂

У меня в генте алиас для рута прописан в /etc/mail/aliases.

Источник

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *

  • Video player для mac os
  • Video copilot optical flares mac os
  • Vidalia bridge bundle mac os
  • Vida volvo mac os
  • Victoria для mac os