I have set up an Ubuntu box with EXIM4 for handling my email, for now I only care about outgoing email. My router manages my DynDNS.com psuedo static-IP addressing. Port forwarding for port 25 is open and shows up with a port-scan. The firestarter firewall on the box shows access attempts and I have added a permit rule.

Outgoing email seems to work as I wanted, and it is configured to send through my gmail account. The problem is that GMail is spamming me every 10-20 minutes with a Delivery Status Notification message complaining about connection refused. It seems to be that Google is trying to email my root@<dyndns-account> account.

How should I overcome this problem? How could I set up complete in/out email access? What is the best course of action for a private web-site that needs minimal email support (e.g. the MediaWiki I'm hosting, etc).

EDIT - added an anonymous copy of the email

    This is an automatically generated Delivery Status Notification



    Delivery to the following recipient has been delayed:


    Message will be retried for 2 more day(s)

    Technical details of temporary failure:
    The recipient server did not accept our requests to connect. Learn more at http://mail.google.com/support/bin/answer.py?answer=7720
    [mydomain.is-a-geek.com (1): Connection refused]

      ----- Message header follows -----

    Received: by with SMTP id m7mr1107333ebb.14.1246185600392;
           Sun, 28 Jun 2009 03:40:00 -0700 (PDT)
    Return-Path: <me@gmail.com>
    Received: from MyMachine (isp.com [xx.xx.xx.xxx])
           by mx.google.com with ESMTPS id 10sm7080189eyz.31.2009.
           (version=TLSv1/SSLv3 cipher=RC4-MD5);
           Sun, 28 Jun 2009 03:39:59 -0700 (PDT)
    Received: from smmsp by MyMachine with local (Exim 4.69)
           (envelope-from <smmsp@mydomain.is-a-geek.com>)
           id 1MKrnl-00075G-Oe
           for root@mydomain.is-a-geek.com; Sun, 28 Jun 2009 11:40:01 +0100
    From: Cron Daemon <me@gmail.com>
    To: root@mydomain.is-a-geek.com
    Subject: Cron <smmsp@MyMachine> test -x /etc/init.d/sendmail && /usr/share/sendmail/sendmail cron-msp
    Content-Type: text/plain; charset=UTF-8
    X-Cron-Env: <MAILTO=root>
    X-Cron-Env: <SHELL=/bin/sh>
    X-Cron-Env: <HOME=/var/lib/sendmail>
    X-Cron-Env: <PATH=/usr/bin:/bin>
    X-Cron-Env: <LOGNAME=smmsp>
    Message-Id: <E1MKrnl-00075G-Oe@MyMachine>
    Date: Sun, 28 Jun 2009 11:40:01 +0100

      ----- Message body suppressed -----
  • What is the full text of the Delivery Status Notification? Jun 29 '09 at 14:06

Wait... Is mail to local users going out to gmail's smtp servers and then coming back to your server? That's something you want to avoid. You need to tell exim that all mail to your domain(s) should be delivered locally, and all other mail can then go via gmail as a smarthost (definitely not as a delivery agent).

Edit: These instructions may help.

  • There shouldn't be any 'internal' email as the box is simply a web-server but I want the hosted sites to have email functionality (e.g. notifications to subscribed users)
    – Ray Hayes
    Jun 29 '09 at 15:35
  • Well, local mail (cron -> root in your example message) is getting sent, and it gets as far as gmail, which tries (and fails) to send it back to your server. Where do you want to read that mail? Locally? then get local delivery sorted out. Gmail? Set up google apps to accept email for your domain.
    – pgs
    Jun 30 '09 at 1:14
  • At the moment, I'm more concerned about stopping the torrent of messages from Google - so I don't really care about email. Is that cron something left over from sendmail (removed from my machine). Where would I find that task?
    – Ray Hayes
    Jun 30 '09 at 6:58
  • It will be the output from from normal system housekeeping from any number of package you may have installed. Look at the output from 'crontab -l' as root, and also look at '/etc/cron*'.
    – pgs
    Jun 30 '09 at 12:23
  • In the end, I reran the exim4-config and changed to a smarthost and routed outgoing emails through my ISP's SMTP. It wasn't what I was originally aiming for, but it probably should have been! Lesson learnt, "if what you're trying to do is hard or not working, you might be trying to do the wrong thing".
    – Ray Hayes
    Jul 1 '09 at 18:56

Did you check if you correctly set your domain's MX record?

DynDNS.com Support - E-mail, Mail Exchangers, and DNS

A wrong configuration would explain that you "see" port 25 when you connect from outside to your IP address, but not the sending SMTP service which is unable to resolve your domain's MX record.

  • I was looking at that page yesterday but most of it went over my head... to many years of being a programmer on Windows! Where do I do that? When filling in the exim4 config, I used my domain address and have since set up the backup MX info in my account details at DynDNS.com.
    – Ray Hayes
    Jun 29 '09 at 14:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.