I am running an Ubuntu 10.04 LTS server and Amazon EC2. Just booted the community, installed apache2, php5, sendmail... thats about it.

Didn't change anything in the configurations. Last night I send a newsletter to about 2000 recipients.

mail.log shows that the messages are accepted for delivery, like this:

Jan 27 16:40:42 ip-10-48-213-66 sendmail[24725]: p0RGefNE024725: to=quatember@zoovienna.at, ctladdr=www-data (33/33), delay=00:00:01, xdelay=00:00:01, mailer=relay, pri=67364, relay=[] [], dsn=2.0.0, stat=Sent (p0RGefKv024726 Message accepted for delivery)

But it seems to get bounced back like this:

Jan 27 16:40:42 ip-10-48-213-66 sm-mta[24728]: p0RGefKv024726: to=<quatember@zoovienna.at>, ctladdr=<www-data@ip-10-48-213-66.eu-west-1.compute.internal> (33/33), delay=00:00:01, xdelay=00:00:00, mailer=esmtp, pri=157483, relay=smtp.zoovienna.at. [], dsn=4.0.0, stat=Deferred: 450 4.1.8 <www-data@ip-10-48-213-66.eu-west-1.compute.internal>: Sender address rejected: Domain not found

or this

Jan 27 20:13:39 ip-10-48-213-66 sm-mta[10058]: p0RH5QCC032505: to=<inga.bertram@online.de>, ctladdr=<www-data@ip-10-48-213-66.eu-west-1.compute.internal> (33/33), delay=03:08:13, xdelay=00:00:01, mailer=esmtp, pri=1777483, relay=mx00.kundenserver.de. [], dsn=4.0.0, stat=Deferred: 421 invalid sender domain 'ip-10-48-213-66.eu-west-1.compute.internal' (misconfigured dns?)

or this

Jan 27 20:13:39 ip-10-48-213-66 sm-mta[10058]: p0RH2CUw031458: to=<urs.nueesch@bluewin.ch>, ctladdr=<www-data@ip-10-48-213-66.eu-west-1.compute.internal> (33/33), delay=03:11:27, xdelay=00:00:00, mailer=esmtp, pri=1777483, relay=mxzhb.bluewin.ch. [], dsn=4.0.0, stat=Deferred: 451 MAIL FROM: <www-data@ip-10-48-213-66.eu-west-1.compute.internal> Unable to verify MX-Record for domain ip-10-48-213-66.eu-west-1.compute.internal

always multiple times and still running...

I noticed that /etc/mail/trusted-users is empty. But as the email seems to go out that should be ok.

/etc/mail/local-host-names looks like


now if i send a mail using the following php command:

var_dump(mail('joehopf@gmail.com','subject!','body!','From: from@blah.com','-f from@flimmit.com'));

i recieve the following mail:

Delivered-To: joehopf@gmail.com
Received: by with SMTP id hs8cs55591icb;
        Fri, 28 Jan 2011 03:28:51 -0800 (PST)
Received: by with SMTP id q17mr4059475ebd.53.1296214129940;
        Fri, 28 Jan 2011 03:28:49 -0800 (PST)
Return-Path: <from@flimmit.com>
Received: from ip-10-48-213-66.eu-west-1.compute.internal (flimmit.com [])
        by mx.google.com with ESMTPS id u13si41731903eeh.3.2011.
        (version=TLSv1/SSLv3 cipher=RC4-MD5);
        Fri, 28 Jan 2011 03:28:49 -0800 (PST)
Received-SPF: pass (google.com: best guess record for domain of from@flimmit.com designates as permitted sender) client-ip=;
Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of from@flimmit.com designates as permitted sender) smtp.mail=from@flimmit.com
Received: from ip-10-48-213-66.eu-west-1.compute.internal (localhost [])
    by ip-10-48-213-66.eu-west-1.compute.internal (8.14.3/8.14.3/Debian-9.1ubuntu1) with ESMTP id p0SBRYQF000694
    for <joehopf@gmail.com>; Fri, 28 Jan 2011 11:27:34 GMT
Received: (from www-data@localhost)
    by ip-10-48-213-66.eu-west-1.compute.internal (8.14.3/8.14.3/Submit) id p0SBRYCv000693;
    Fri, 28 Jan 2011 11:27:34 GMT
Date: Fri, 28 Jan 2011 11:27:34 GMT
Message-Id: <201101281127.p0SBRYCv000693@ip-10-48-213-66.eu-west-1.compute.internal>
X-Authentication-Warning: ip-10-48-213-66.eu-west-1.compute.internal: www-data set sender to from@flimmit.com using -f
To: joehopf@gmail.com
Subject: subject!
X-PHP-Originating-Script: 1000:test.php
From: from@blah.com


i also noticed that sending the mail takes quite a long time, which i know is an issue if there is something wrong with resolving adresses.

my sendmail path is not configured in php.ini but php info shows the following which should be correct: /usr/sbin/sendmail -t -i

This is an email from the newsletter tool (phplist) which got through and does not show the x-authentication-warning header.

Can I somehow fix this or is there a way to identifiy who got the mails and who did not so I can re send?

Any help is a appriciated.


I just noticed that the mailing tool probably did not set the -f parameter. I fixed this. Now the local address still shows up but this is the same case in other emails from professional lists like golem.

So in the email above I produced with the -f paramter. Is this okay now or still problematic?

  • because the newsletter mail does not show the warning header i guess that the newsletter program just did not add the envelope address at all?? would that match with the rest of the information? if info is needed please just ask i check this questino regularely! – The Shurrican Jan 28 '11 at 11:45

Your sendmail is misconfigured. It's using the internal EC2 domain name, ip-10-48-213-66.eu-west-1.compute.internal, as the sender domain, and since this can't be looked up and checked, the emails are being rejected. You need to put an actual real Internet domain name in there that has a reverse DNS lookup to the IP address you're sending from -- you have to apply to Amazon for permission to send email from EC2 in order to get them to configure the reverse DNS for you.

Sending email from EC2 servers can be tricky in any case, as lots of EC2 IP addresses are in blacklists. You're probably better off looking into the new Simple Email Service that Amazon have just launched.

  • i did that, they set up the everything for my elastic ip. i confirmed it using arpa lookups. can i compensate that mis configuration when correctly setting the -f parameter? – The Shurrican Jan 28 '11 at 12:09
  • I'd start by changing the hostname of the server to flimmit.com instead of ip-10-48-213-66.eu-west-1.compute.internal. That should fix it, although you'll still have the issue of EC2 IP addresses being in blacklists. – Mike Scott Jan 28 '11 at 12:17

A good method to check who gets your emails is by generating a unique bounce address per recipient using the Return-Path header, this way you can parse your bounces mailbox and match exactly one by one who bounced the email back to you.

I see you're using EC2, it's really not recommended to run your mail service directly from EC2 since the deliverability rate is very low and variable (exactly your problem), I had this problem with EC2 as well and I just decided to contract an external SMTP provider in order to get all the deliverability and bouncing sorted out, it's cheap enough to justify the cost specially at such low volumes.

I'm using AuthSMTP (http://www.authsmtp.com/) for this, they're cheap and very reliable.


I solve this problem when I do this steps :

# vi /etc/mail/sendmail.mc


# m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf

# yum install sendmail-cf

# /etc/init.d/sendmail restart

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.