How to get rid of mail message?
Keith
keith at caramail.com
Fri Feb 25 22:35:44 UTC 2022
On 2/25/22 3:10 PM, Bo Berglund wrote:
> On Fri, 25 Feb 2022 12:35:31 -0600, Keith <keith at caramail.com> wrote:
>
>> On 2/25/22 12:00 PM, Bo Berglund wrote:
>>> On Fri, 25 Feb 2022 17:04:05 +0000, Colin Law <clanlaw at gmail.com> wrote:
>>>
>>>>>> This is it I think. It is just a matter of redirecting the output to
>>>>>> null in the cron command.
>>>>>> https://www.cyberciti.biz/faq/disable-the-mail-alert-by-crontab-command/
>>>>>>
>>>>>
>>>>> THanks!
>>>>> I will try this. Easy for cron jobs but harder for scripts started by at...
>>>>> There are a lot of scripts involved, do I have to edit all of them to redirect
>>>>> the output?
>>>>> The at commands are pretty complex (generated by another script) but I will have
>>>>> a look at it.
>>>>
>>>> If you redirect a script output doesn't it propagate down?
>>>>
>>>
>>> Well I have a script that downloads videos internally using ffmpeg and ffmpeg
>>> spews out stuff while it is working. But I also have other smaller scripts that
>>> are called from the main script and they have user feedback output which I put
>>> there just for convenience when I use them manually. Such as audio/video resync
>>> utility which works for a while with ffmpeg too and then outputs a success
>>> message. This is visible in the "mail".
>>>
>>> So should the script that creates the at jobs be modified?
>>> Now a typical job is created somewat like this (one line):
>>>
>>> echo "getvideostream 4080 input13.mp4 && syncaudio 0.05 input13.mp4 X && mv
>>> input13.mp4 ../new/2022-02-25_13PM_new_video.u.mp4" | at 13:00 today
>>>
>>> getvideostream and syncaudio are both scripts using ffmpeg and with some user
>>> feedback.
>>>
>>> Should I add > /dev/null 2>&1 at the end of the quoted command string above or
>>> to each of the internal commands separated by &&?
>>>
>>>
>>
>> Edit the file /etc/pam.d/login and change the line
>>
>> session optional pam_mail.so standard
>>
>> to
>>
>> session optional pam_mail.so nopen
>>
>> Save, logout and then log back in.
>
> I did the change and logged out of my sessions.
> When I logged on again I was greeted with this:
>
> ...
> You have new mail.
> Last login: Thu Feb 24 13:33:43 2022 from 192.168.119.236
>
>
I'd grep the other files in /etc/pam.d and see if they have a line for
pam_mail.so that may be generating that message.
Another possibility is that some application daemon or systemd service
is notifying you of mail on login. By default, journald records debug
level and higher priority entries in the logs so if there is a daemon
generating such a message, it'll probably listed in the journald log.
--
Keith
More information about the ubuntu-users
mailing list