K
K
Kirill Kazakov2015-06-28 01:34:40
linux
Kirill Kazakov, 2015-06-28 01:34:40

How to stub root mail on linux?

There is a server on Debian, set up a notification in case of problems with soft raid according to this article. Replaced postfix with msmtp . Now logs are not written to /var/mail/root , and if errors occur in syslog , the server apparently tries to send a report via msmtp and this error appears

/USR/SBIN/CRON[585259]: (root) MAIL (mailed 1 byte of output; but got status 0x0041, #012)

How to return the stub so that a file with mail for root is created, but at the same time not to kill the sending of alerts on problems with raid ?
Though it doesn't seem to be related to the postfix change.
Perhaps cron tried to send an error by mail and came across an error, is it possible to write this error (mail body) at least to the same syslog?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
E
Ergil Osin, 2015-06-28
@Ernillew

Mother of God and LMM!
Why are you going to deliver letters to the local root? Will you read them all the time? Not sure.
Who is the MAILADDR directive in mdadm.conf for? Send letters to someone who will definitely read them, send them to your e-mail. And then when you come to the server one sad day, you will find that
1. The raid fell apart six months ago, because one of the disks burned out
2. The second disk is also dying and cannot be saved.
Well, what did you break with your msmtp, Russell's Teapot knows it, return the postfix back, just direct it to listen to localhost, not the star.

T
torr2009, 2015-06-29
@torr2009

Mail for root can be redirected by creating a link in /etc/aliases .

V
Vlad Zhivotnev, 2015-06-28
@inkvizitor68sl

https://debian.pro/1128 - I won't tell you about mstmp, but I described everything under ssmtp.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question