Just how do I make cron email my @gmail account

I have a number of cron work that occasionally generate mistake result and also would love to get an alert in my "actual" e-mail account, given that I do not utilize my customer's mail box in my Ubuntu laptop computer, yet cron (or is it postfix possibly) maintains attempting to email the neighborhood origin account.

I recognize I can add the MAILTO variable to the crontab:

[email protected]:~$ sudo crontab -l
[email protected]
# m h  dom mon dow   command
*/5 * * * * /home/ricardo/mrtg/cfg/run.sh

Yet it does not appear to pay any kind of focus to it

I additionally attempted including my e-mail to the /etc/aliases documents and also running newaliases

[email protected]:~$ cat /etc/aliases
# See man 5 aliases for format
postmaster:    root
root:          [email protected]
ricardo:       [email protected]

still, whenever cron intends to send an e-mail it's still sending it to [email protected]:

[email protected]:/var/log$ tail mail.log
Aug  3 16:25:01 ricardo-laptop postfix/pickup[2002]: D985B310: uid=0 from=<root>
Aug  3 16:25:01 ricardo-laptop postfix/cleanup[4117]: D985B310: message-id=<[email protected]>
Aug  3 16:25:01 ricardo-laptop postfix/qmgr[2003]: D985B310: from=<[email protected]>, size=762, nrcpt=1 (queue active)
Aug  3 16:25:03 ricardo-laptop postfix/smtp[4120]: D985B310: to=<[email protected]>, orig_to=<root>, relay=smtp.gmail.com[74.125.157.109]:25, delay=1.5, delays=0.38/0.02/0.9/0.18, dsn=5.7.0, status=bounced (host smtp.gmail.com[74.125.157.109] said: 530 5.7.0 Must issue a STARTTLS command first. d1sm12275173anc.19 (in reply to MAIL FROM command))

Any kind of pointers? I'm running Ubuntu 10.04, with every little thing up-to-date

0
2019-05-07 00:01:21
Source Share
Answers: 1

It would certainly show up that you have actually set up smtp.gmail.com as your smarthost for the mail web server. You require to remove the smarthost arrangement or modify it to make sure that your web server goes to all with the ability of sending out mail to the outdoors.

The arrangement you have currently for the mail onward seems functioning, yet is falling short due to the fact that smtp.gmail.com is denying the mail.

Update : For future reference, the trouble remained in /etc/mailname which detailed a name that had not been in the mydestinations checklist of postfix. This created all mails to be taken into consideration international and also the mail bypassed /etc/aliases handling.

0
2019-05-08 21:47:07
Source