Results 1 to 4 of 4

Thread: mail delivery errors

  1. #1
    Join Date
    Jan 2008
    Location
    Kansas
    Beans
    545
    Distro
    Ubuntu 12.04 Precise Pangolin

    mail delivery errors

    This is kind of an embarrassing problem, because I should know how to fix it myself, but I don't.

    I recently set up exim4 on a development server I have running Ubuntu. I set it up to send mail using gmail's smtp so that I could test some of the mail functions of a project I was working on.

    Now I'm getting mail delivery errors in my gmail account daily, saying that messages were not delivered to root@(username).com and www-data@(username).com

    I can't remember where the settings would be to change these addresses so it doesn't try to send to them anymore. I've checked in /etc/aliases, but it wasn't there.

    There are two folders - root and www-data - in my /var/mail directory. If I delete those, will that fix the problem?

  2. #2
    Join Date
    Nov 2008
    Location
    Metro Boston
    Beans
    9,041
    Distro
    Kubuntu 14.04 Trusty Tahr

    Re: mail delivery errors

    What process is sending these messages? Are they coming from cron? If so, you can set the MAILTO environment variable at the top of a crontab to point to any address you want.

    It sounds like your exim implementation doesn't know how to handle local delivery, or else it's sending two copies of each message, one to the local user root and another to root@domain.name which is undeliverable. If you look at /var/mail/root, do you see the same messages which are generating delivery problems as root@domain.name, or are these sets of messages entirely distinct from one another?

  3. #3
    Join Date
    Jan 2008
    Location
    Kansas
    Beans
    545
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: mail delivery errors

    Quote Originally Posted by SeijiSensei View Post
    What process is sending these messages? Are they coming from cron? If so, you can set the MAILTO environment variable at the top of a crontab to point to any address you want.
    Yes, they are coming from cron. My crontab doesn't have a MAILTO variable, but I assume I can just add one under the SHELL and PATH variables? If I add a MAILTO variable but leave it a blank string, will it stop trying to send emails entirely?

    It sounds like your exim implementation doesn't know how to handle local delivery, or else it's sending two copies of each message, one to the local user root and another to root@domain.name which is undeliverable. If you look at /var/mail/root, do you see the same messages which are generating delivery problems as root@domain.name, or are these sets of messages entirely distinct from one another?
    Yes, the messages are the same.

    Thanks.

  4. #4
    Join Date
    Nov 2008
    Location
    Metro Boston
    Beans
    9,041
    Distro
    Kubuntu 14.04 Trusty Tahr

    Re: mail delivery errors

    Cron mails error messages that aren't trapped by the commands it runs. The easiest way to stop these messages is to pipe any output, including most importantly error output, to a log file like this:

    Code:
    * * * * * /path/to/myscript >> /var/log/myscript.log 2>&1
    That sends any unexpected output from myscript to a log file; the "2>&1" item redirects error messages ("syserr") to the same file.

Tags for this Thread

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
  •