Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

    THIS IS A WARNING MESSAGE ONLY.

    YOU DO NOT NEED TO RESEND YOUR MESSAGE.

    Delivery to the following recipient has been delayed:

        root@mydomain.is-a-geek.com

    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 10.210.89.7 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.06.28.03.39.59
           (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 -----
share|improve this question
    
What is the full text of the Delivery Status Notification? –  Jeff Widmer Jun 29 '09 at 14:06
add comment

2 Answers

up vote 2 down vote accepted

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.

share|improve this answer
    
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
add comment

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.

share|improve this answer
    
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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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