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 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=[127.0.0.1] [127.0.0.1], 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. [83.64.127.201], 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. [212.227.15.150], 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. [195.186.18.144], 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

localhost
ip-10-48-213-66.eu-west-1.compute.internal

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 10.42.219.8 with SMTP id hs8cs55591icb;
        Fri, 28 Jan 2011 03:28:51 -0800 (PST)
Received: by 10.213.35.209 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 [79.125.4.119])
        by mx.google.com with ESMTPS id u13si41731903eeh.3.2011.01.28.03.28.20
        (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 79.125.4.119 as permitted sender) client-ip=79.125.4.119;
Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of from@flimmit.com designates 79.125.4.119 as permitted sender) smtp.mail=from@flimmit.com
Received: from ip-10-48-213-66.eu-west-1.compute.internal (localhost [127.0.0.1])
    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

body!

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.

update:

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?

share|improve this question
    
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

3 Answers 3

up vote 3 down vote accepted

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.

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

share|improve this answer

I solve this problem when I do this steps :

# vi /etc/mail/sendmail.mc

MASQUERADE_AS(domain.com)dnl
FEATURE(masquerade_envelope)dnl
FEATURE(masquerade_entire_domain)dnl
MASQUERADE_DOMAIN(domain.com)dnl

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

# yum install sendmail-cf

# /etc/init.d/sendmail restart
share|improve this answer

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.