[mail command] cannot send message
by thomasbb from LinuxQuestions.org on (#5EG95)
To automatically update my computer, I made this script:
Code:#!/bin/bash
apt-get update &> /tmp/apt-list.log
apt-get upgrade -Ryq > /tmp/apt-info.log 2> /tmp/apt-error.log
if [ $? -eq 0 ] ; then
aptitude clean
mail -s "[Maintenance] Update done" e@mail.com <<< "Updated"
else
cat /tmp/apt-error.log | mail -s "[Maintenance] Update failed" e@mail.com
fibut it returns
Code:cannot send message: Process exited with a non-zero statusand error code is
Code:$ echo $?
36Any idea?


Code:#!/bin/bash
apt-get update &> /tmp/apt-list.log
apt-get upgrade -Ryq > /tmp/apt-info.log 2> /tmp/apt-error.log
if [ $? -eq 0 ] ; then
aptitude clean
mail -s "[Maintenance] Update done" e@mail.com <<< "Updated"
else
cat /tmp/apt-error.log | mail -s "[Maintenance] Update failed" e@mail.com
fibut it returns
Code:cannot send message: Process exited with a non-zero statusand error code is
Code:$ echo $?
36Any idea?