Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: system email alerts sent to gmail address?

  1. #1
    Join Date
    Apr 2007
    Location
    Raleigh, NC, USA
    Beans
    170

    system email alerts sent to gmail address?

    I have ssmtp setup on my system so I can get crontab alerts sent to my gmail address. I actually have 2 gmail address, one I created for the computer to use to sent messages and one is my regular email to receive these alerts. I followed the instructions below:

    https://help.ubuntu.com/community/EmailAlerts

    I'm getting the daily alerts correctly, but mail sent to root from the system, like smartd do not get sent to me. Instead I get a Delivery Status Notification (Failure) from gmail to the email address setup for the computer to send out the alerts.

    Any idea on how to fix this?

    Jim A

    The response was:

    DNS Error: 6824058 DNS type 'mx' lookup of mythbuntu responded with code NXDOMAIN Domain name not found: mythbuntu

    Reporting-MTA: dns; googlemail.com
    Received-From-MTA: dns; XXXXXXXX@gmail.com
    Arrival-Date: Wed, 14 Nov 2018 04:50:59 -0800 (PST)
    X-Original-Message-ID: <5bec1a33.1c69fb81.d84f1.cd6a@mx.google.com>

    Final-Recipient: rfc822; root@mythbuntu
    Action: failed
    Status: 4.0.0
    Diagnostic-Code: smtp; DNS Error: 6824058 DNS type 'mx' lookup of mythbuntu responded with code NXDOMAIN
    Domain name not found: mythbuntu
    Last-Attempt-Date: Wed, 14 Nov 2018 04:51:01 -0800 (PST)


    ForwardedMessage.eml
    Subject:
    SMART error (FailedOpenDevice) detected on host: mythbuntu
    From:
    root <XXXXXXXXXX@gmail.com>
    Date:
    11/14/18, 7:50 AM
    To:
    <root@mythbuntu>

    This message was generated by the smartd daemon running on:

    host name: mythbuntu
    DNS domain: [Empty]

    The following warning/error was logged by the smartd daemon:

    Device: /dev/sdf [SAT], unable to open device

    Device info:
    TOSHIBA HDWD120, S/N:58NYHDVCS, WWN:5-000039-fd4db8021, FW:MX4OACF0, 2.00 TB

    For details see host's SYSLOG.

    You can also use the smartctl utility for further investigation.
    The original message about this issue was sent at Tue Nov 13 07:50:57 2018 EST
    Another message will be sent in 24 hours if the problem persists.

  2. #2
    Join Date
    Nov 2008
    Location
    Boston MetroWest
    Beans
    16,326

    Re: system email alerts sent to gmail address?

    DNS Error: 6824058 DNS type 'mx' lookup of mythbuntu responded with code NXDOMAIN Domain name not found: mythbuntu
    Remote servers can only send mail to fully-qualified domain names like mail.example.com. If you have a domain, use that, not "mythbuntu."

    You could try using as an alternative the To address

    you@[10.10.10.10]

    with your machine's IP address substituted for 10.10.10.10.

    GMail is pretty picky so I can't promise it would work.
    If you ask for help, do not abandon your request. Please have the courtesy to check for responses and thank the people who helped you.

    Blog · Linode System Administration Guides · Android Apps for Ubuntu Users

  3. #3
    Join Date
    Apr 2007
    Location
    Raleigh, NC, USA
    Beans
    170

    Re: system email alerts sent to gmail address?

    The point is my server is sending mail to my personal account. I've setup cron to do it and some SQL database maintenance stuff. I get those emails. The problem is other system functions like smartd send emails to root@mythbuntu.

    If I can't forward all mail to root to my personal address, I'll have to figure out each system daemon that sends mail to root and change that address.

  4. #4
    Join Date
    Nov 2008
    Location
    Boston MetroWest
    Beans
    16,326

    Re: system email alerts sent to gmail address?

    Add an entry to /etc/aliases that points root to your email address.

    Code:
    root:     me@example.com
    Then run the "newaliases" command. Note the colon after "root".
    If you ask for help, do not abandon your request. Please have the courtesy to check for responses and thank the people who helped you.

    Blog · Linode System Administration Guides · Android Apps for Ubuntu Users

  5. #5
    Join Date
    Mar 2009
    Beans
    1,982

    Re: system email alerts sent to gmail address?

    Gmail wants you to send FROM a real domain too. They have lots of rules to prevent spam and malware. There are instructions with gmail to configure your systems, can't really remember much of it but years ago when I did it we had to add a bunch of extra records to the company's dns.

  6. #6
    Join Date
    Apr 2007
    Location
    Raleigh, NC, USA
    Beans
    170

    Re: system email alerts sent to gmail address?

    Quote Originally Posted by SeijiSensei View Post
    Add an entry to /etc/aliases that points root to your email address.

    Code:
    root:     me@example.com
    Then run the "newaliases" command. Note the colon after "root".
    Unfortunately, newaliases isn't used by ssmtp

    PHP Code:
    jim@mythbuntu:~$ sudo newaliases
    newaliases
    Aliases are not used in sSMTP 

  7. #7
    Join Date
    Apr 2007
    Location
    Raleigh, NC, USA
    Beans
    170

    Re: system email alerts sent to gmail address?

    Quote Originally Posted by 1clue View Post
    Gmail wants you to send FROM a real domain too. They have lots of rules to prevent spam and malware. There are instructions with gmail to configure your systems, can't really remember much of it but years ago when I did it we had to add a bunch of extra records to the company's dns.
    I have my server sending mail as an gmail user to other gmail accounts. That's not the problem. I can't seem to get my sSMTP setup to forward internal mail sent to 'root' forwarded to a gmail account.

  8. #8
    Join Date
    Nov 2008
    Location
    Boston MetroWest
    Beans
    16,326

    Re: system email alerts sent to gmail address?

    Quote Originally Posted by jfaberna View Post
    Unfortunately, newaliases isn't used by ssmtp

    PHP Code:
    jim@mythbuntu:~$ sudo newaliases
    newaliases
    Aliases are not used in sSMTP 
    I only use sendmail or postfix, so I can't help with that.
    If you ask for help, do not abandon your request. Please have the courtesy to check for responses and thank the people who helped you.

    Blog · Linode System Administration Guides · Android Apps for Ubuntu Users

  9. #9
    Join Date
    Apr 2007
    Location
    Raleigh, NC, USA
    Beans
    170

    Re: system email alerts sent to gmail address?

    So how difficult is it to install and use sendmail or postfix? Can I install it over sSMTP?

  10. #10
    Join Date
    Nov 2008
    Location
    Boston MetroWest
    Beans
    16,326

    Re: system email alerts sent to gmail address?

    It might remove ssmtp. I know that's true for sendmail or Postfix when the other is installed. Do a backup first.
    If you ask for help, do not abandon your request. Please have the courtesy to check for responses and thank the people who helped you.

    Blog · Linode System Administration Guides · Android Apps for Ubuntu Users

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •