x
all questions login
General DNS & Domains Dyn Email Update Clients Dyn Developer

I'm trying to send email from an Amazon EC2 instance (hosting http://Parcelspace.com) using the php mail() function as below

mail("********@gmail.com", "subject", "test", "From:info@parcelspace.com")

However the maillog gives me the following error;

Oct 20 10:43:41 ip-10-228-106-7 postfix/qmgr[7778]: 9D88140924: from=<root@ip-10-228-106-7.eu-west-1.compute.internal>, size=2568, nrcpt=1 (queue active)
Oct 20 10:43:41 ip-10-228-106-7 postfix/qmgr[7778]: BDA8940925: from=<root@ip-10-228-106-7.eu-west-1.compute.internal>, size=1175, nrcpt=1 (queue active)
Oct 20 10:43:41 ip-10-228-106-7 postfix/qmgr[7778]: C28594099E: from=<root@ip-10-228-106-7.eu-west-1.compute.internal>, size=3260, nrcpt=1 (queue active)
Oct 20 10:43:43 ip-10-228-106-7 postfix/smtp[7796]: 9D88140924: to=<root@ip-10-228-106-7.eu-west-1.compute.internal>, relay=outbound.mailhop.org[204.13.248.72]:2525, delay=294642, delays=294640/0.09/1.1/0.17, dsn=5.0.0, status=bounced (host http://outbound.mailhop.org[204.13.248.72] said: 550 Sender verify failed (in reply to MAIL FROM command))
Oct 20 10:43:43 ip-10-228-106-7 postfix/smtp[7798]: C28594099E: to=<root@ip-10-228-106-7.eu-west-1.compute.internal>, relay=outbound.mailhop.org[204.13.248.72]:2525, delay=189539, delays=189538/0.17/1.1/0.18, dsn=5.0.0, status=bounced (host http://outbound.mailhop.org[204.13.248.72] said: 550 Sender verify failed (in reply to MAIL FROM command))
Oct 20 10:43:43 ip-10-228-106-7 postfix/cleanup[7800]: 3FF424032E: message-id=<20101020144343.3FF424032E@www.parcelspace.com>
Oct 20 10:43:43 ip-10-228-106-7 postfix/cleanup[7802]: 41D4E4032F: message-id=<20101020144343.41D4E4032F@www.parcelspace.com>
Oct 20 10:43:43 ip-10-228-106-7 postfix/bounce[7799]: 9D88140924: sender non-delivery notification: 3FF424032E
Oct 20 10:43:43 ip-10-228-106-7 postfix/qmgr[7778]: 41D4E4032F: from=<>, size=5293, nrcpt=1 (queue active)
Oct 20 10:43:43 ip-10-228-106-7 postfix/qmgr[7778]: 9D88140924: removed
Oct 20 10:43:43 ip-10-228-106-7 postfix/qmgr[7778]: 3FF424032E: from=<>, size=4601, nrcpt=1 (queue active)
Oct 20 10:43:43 ip-10-228-106-7 postfix/bounce[7801]: C28594099E: sender non-delivery notification: 41D4E4032F
Oct 20 10:43:43 ip-10-228-106-7 postfix/qmgr[7778]: C28594099E: removed
Oct 20 10:43:43 ip-10-228-106-7 postfix/smtp[7797]: BDA8940925: to=<root@ip-10-228-106-7.eu-west-1.compute.internal>, relay=outbound.mailhop.org[204.13.248.72]:2525, delay=294581, delays=294580/0.12/1.1/0.28, dsn=5.0.0, status=bounced (host http://outbound.mailhop.org[204.13.248.72] said: 550 Sender verify failed (in reply to MAIL FROM command))
Oct 20 10:43:43 ip-10-228-106-7 postfix/cleanup[7800]: 627164030B: message-id=<20101020144343.627164030B@www.parcelspace.com>
Oct 20 10:43:43 ip-10-228-106-7 postfix/qmgr[7778]: 627164030B: from=<>, size=3208, nrcpt=1 (queue active)
Oct 20 10:43:43 ip-10-228-106-7 postfix/bounce[7799]: BDA8940925: sender non-delivery notification: 627164030B
Oct 20 10:43:43 ip-10-228-106-7 postfix/qmgr[7778]: BDA8940925: removed
Oct 20 10:43:44 ip-10-228-106-7 postfix/smtp[7797]: 627164030B: to=<root@ip-10-228-106-7.eu-west-1.compute.internal>, relay=outbound.mailhop.org[204.13.248.72]:2525, delay=1.2, delays=0.01/0/0.71/0.5, dsn=5.0.0, status=bounced (host http://outbound.mailhop.org[204.13.248.72] said: 550-root@ip-10-228-106-7.eu-west-1.compute.internal failed recipient 550 verification (in reply to RCPT TO command))
Oct 20 10:43:44 ip-10-228-106-7 postfix/smtp[7796]: 41D4E4032F: to=<root@ip-10-228-106-7.eu-west-1.compute.internal>, relay=outbound.mailhop.org[204.13.248.72]:2525, delay=1.4, delays=0.03/0/0.76/0.61, dsn=5.0.0, status=bounced (host http://outbound.mailhop.org[204.13.248.72] said: 550-root@ip-10-228-106-7.eu-west-1.compute.internal failed recipient 550 verification (in reply to RCPT TO command))
Oct 20 10:43:44 ip-10-228-106-7 postfix/smtp[7798]: 3FF424032E: to=<root@ip-10-228-106-7.eu-west-1.compute.internal>, relay=outbound.mailhop.org[204.13.248.72]:2525, delay=1.4, delays=0.03/0/0.84/0.53, dsn=5.0.0, status=bounced (host http://outbound.mailhop.org[204.13.248.72] said: 550-root@ip-10-228-106-7.eu-west-1.compute.internal failed recipient 550 verification (in reply to RCPT TO command))
Oct 20 10:43:44 ip-10-228-106-7 postfix/qmgr[7778]: 627164030B: removed
Oct 20 10:43:44 ip-10-228-106-7 postfix/qmgr[7778]: 41D4E4032F: removed
Oct 20 10:43:44 ip-10-228-106-7 postfix/qmgr[7778]: 3FF424032E: removed
Oct 20 10:43:48 ip-10-228-106-7 sendmail[7805]: o9KEhmJb007805: from=apache, size=90, class=0, nrcpts=1, msgid=<201010201443.o9KEhmJb007805@ip-10-228-106-7.eu-west-1.compute.internal>, relay=apache@localhost
Oct 20 10:43:48 ip-10-228-106-7 postfix/smtpd[7806]: connect from localhost.localdomain[127.0.0.1]
Oct 20 10:43:48 ip-10-228-106-7 postfix/smtpd[7806]: EDBA94032E: client=localhost.localdomain[127.0.0.1]
Oct 20 10:43:49 ip-10-228-106-7 postfix/cleanup[7802]: EDBA94032E: message-id=<201010201443.o9KEhmJb007805@ip-10-228-106-7.eu-west-1.compute.internal>
Oct 20 10:43:49 ip-10-228-106-7 postfix/qmgr[7778]: EDBA94032E: from=<apache@ip-10-228-106-7.eu-west-1.compute.internal>, size=598, nrcpt=1 (queue active)
Oct 20 10:43:49 ip-10-228-106-7 sendmail[7805]: o9KEhmJb007805: to=********@gmail.com, ctladdr=apache (48/48), delay=00:00:01, xdelay=00:00:01, mailer=relay, pri=30090, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (Ok: queued as EDBA94032E)
Oct 20 10:43:49 ip-10-228-106-7 postfix/smtpd[7806]: disconnect from localhost.localdomain[127.0.0.1]
Oct 20 10:43:50 ip-10-228-106-7 postfix/smtp[7797]: EDBA94032E: to=<********@gmail.com>, relay=outbound.mailhop.org[204.13.248.71]:2525, delay=1.5, delays=0.39/0/1/0.1, dsn=5.0.0, status=bounced (host http://outbound.mailhop.org[204.13.248.71] said: 550 Sender verify failed (in reply to MAIL FROM command))
Oct 20 10:43:50 ip-10-228-106-7 postfix/cleanup[7800]: B31644032B: message-id=<20101020144350.B31644032B@www.parcelspace.com>
Oct 20 10:43:50 ip-10-228-106-7 postfix/qmgr[7778]: B31644032B: from=<>, size=2537, nrcpt=1 (queue active)
Oct 20 10:43:50 ip-10-228-106-7 postfix/bounce[7803]: EDBA94032E: sender non-delivery notification: B31644032B
Oct 20 10:43:50 ip-10-228-106-7 postfix/qmgr[7778]: EDBA94032E: removed
Oct 20 10:43:51 ip-10-228-106-7 postfix/smtp[7796]: B31644032B: to=<apache@ip-10-228-106-7.eu-west-1.compute.internal>, relay=outbound.mailhop.org[204.13.248.72]:2525, delay=1.2, delays=0.01/0/0.68/0.49, dsn=5.0.0, status=bounced (host http://outbound.mailhop.org[204.13.248.72] said: 550-apache@ip-10-228-106-7.eu-west-1.compute.internal failed recipient 550 verification (in reply to RCPT TO command))
Oct 20 10:43:51 ip-10-228-106-7 postfix/qmgr[7778]: B31644032B: removed
Oct 20 10:45:30 ip-10-228-106-7 postfix/scache[7804]: statistics: start interval Oct 20 10:43:43
Oct 20 10:45:30 ip-10-228-106-7 postfix/scache[7804]: statistics: domain lookup hits=0 miss=3 success=0%

I'm sure that my settings in http://main.cf, sasl-passwords, transport are correct for using MailHop Outbound, and that sasl-passwords.db and transport.db are there, but clearly it's not working. Any help much appreciated! Thanks.

more ▼

asked Oct 20 at 11:06 PM

pspace\'s gravatar image

pspace
3 1 1 2

10|600 characters needed characters left

2 answers:
So presumably the sender address should be info@parcelspace.com? I have added the space after 'From:' but still it still has the '.internal' address as the sender. Might you know of any other way to change the sender address?

A known problem. This is an excerpt from some PHP code I wrote once after having had the exact same issue:

  $to = "recipient@censored-domain-name.net";
  $subject = "Censored";
  $body = "Censored";

  //...

  $from = "Censored App Name <webmaster@censored-domain-name.net>";
  $mailer = "Censored App Name vCensored-version-number";

  //...

  $headers = "From: $from\r\n";
  $headers .= "X-Mailer: $mailer";

  ini_set("sendmail_from", $from);
  $bResult = mail($to, $subject, $body, $headers, "-f $from");

Note the use of the ini_set() command and the "-f $from" as the last argument in the mail() command.


This didn't work initially, so I changed '$from' to just 'info@parcelspace.com' and it worked!

The use of the variable $from in this situation requires that you have assigned a value (an e-mail address) to it. Specifying the e-mail address directly is fine too, of course.

Thank you so much!

Happy to hear you got it working.

more ▼

answered Oct 21 at 05:42 PM

VikingTiger\'s gravatar image

VikingTiger ♦
11.6k 2 10 124

This didn't work initially, so I changed '$from' to just 'info@parcelspace.com' and it worked! Thank you so much!

Oct 22 at 10:44 AM pspace
10|600 characters needed characters left

Your problem looks to be your sender address:

from=<root@ip-10-228-106-7.eu-west-1.compute.internal>

There is no .internal TLD so the sender address is invalid. This may be due to a lack of a space after From: in the header you set (see the manual page examples for mail()), since all headers require a space between the header name and the value.


The From address should be the one you set. As to how you make that work, I don't use Postfix so can't help. The Postfix mailing lists will probably be a good place to start, though I'd check the log first to see if anything is logged about why the From value hasn't been set (I'm guessing that changing the From header doesn't change the envelope address).

more ▼

answered Oct 21 at 06:05 AM

Cry Havok\'s gravatar image

Cry Havok ♦
52.2k 13 26 222

So presumably the sender address should be info@parcelspace.com? I have added the space after 'From:' but still it still has the '.internal' address as the sender. Might you know of any other way to change the sender address?

Oct 21 at 10:54 AM pspace
10|600 characters needed characters left
Your answer
osqa.question.ask.tags.preview.show

© 1998-2012  Dynamic Network Services Inc.  -  Legal Notices  -  Privacy Policy  -  Contacts     

Powered by AnswerHub - Enterprise Social Q&A