Email issues with Wordpress running on AWS Elastic Beanstalk - wordpress

I'm running Wordpress 4.2 on AWS Elastic Beanstalk. I'm using a plugin that sends emails using the WP email API, which uses the server's (i.e. Elastic Beanstalk's) internal mail system.
The problem: emails that the app attempts to send to my university email (let's call it .uni.edu) fail, and they do work when sent to my standard gmail.
What's interesting is that I have no issues running the same application locally. The emails associated with the app send fine -- so obviously there's some issue with the way Elastic Beanstalk in particular is attempting to relay the messages to the .uni.edu server. Perhaps the .uni.edu server is picking it up as spam (when sent from Elastic Beanstalk, not when being sent through my local system) and bouncing it back, but I'm not experienced enough to diagnose this.
Does anyone have suggestions for either directly applying some kind of fix to this problem, or creating some sort of setup that is a workaround (e.g. setting something up on Elastic Beanstalk to send emails in a non-default way that is less likely to have issues working with the university email server)?
Here's a log from /var/mail:
From MAILER-DAEMON#ip-172-31-41-109.ec2.internal Fri Apr 24 21:39:52 2015
Return-Path: <MAILER-DAEMON#ip-172-31-41-109.ec2.internal>
Received: from localhost (localhost)
by ip-172-31-41-109.ec2.internal (8.14.4/8.14.4) id t3OLdq1k026047;
Fri, 24 Apr 2015 21:39:52 GMT
Date: Fri, 24 Apr 2015 21:39:52 GMT
From: Mail Delivery Subsystem <MAILER-DAEMON#ip-172-31-41-109.ec2.internal>
Message-Id: <201504242139.t3OLdq1k026047#ip-172-31-41-109.ec2.internal>
To: <webapp#ip-172-31-41-109.ec2.internal>
MIME-Version: 1.0
Content-Type: multipart/report; report-type=delivery-status;
boundary="t3OLdq1k026047.1429911592/ip-172-31-41-109.ec2.internal"
Subject: Returned mail: see transcript for details
Auto-Submitted: auto-generated (failure)
This is a MIME-encapsulated message
--t3OLdq1k026047.1429911592/ip-172-31-41-109.ec2.internal
The original message was received at Fri, 24 Apr 2015 21:39:42 GMT
from localhost [127.0.0.1]
----- The following addresses had permanent fatal errors -----
<univstudent#uni.edu>
(reason: 553 5.1.8 <webapp#ip-172-31-41-109.ec2.internal>... Domain of sender address webapp#ip-172-31-41-109.ec2.internal does not exist)
----- Transcript of session follows -----
... while talking to apathy.uni.edu.:
>>> MAIL From:<webapp#ip-172-31-41-109.ec2.internal> SIZE=1191
<<< 553 5.1.8 <webapp#ip-172-31-41-109.ec2.internal>... Domain of sender address webapp#ip-172-31-41-109.ec2.internal does not exist
501 5.6.0 Data format error
--t3OLdq1k026047.1429911592/ip-172-31-41-109.ec2.internal
Content-Type: message/delivery-status
Reporting-MTA: dns; ip-172-31-41-109.ec2.internal
Received-From-MTA: DNS; localhost
Arrival-Date: Fri, 24 Apr 2015 21:39:42 GMT
Final-Recipient: RFC822; univstudent#uni.edu
Action: failed
Status: 5.1.8
Diagnostic-Code: SMTP; 553 5.1.8 <webapp#ip-172-31-41-109.ec2.internal>... Domain of sender address webapp#ip-172-31-41-109.ec2.internal does not exist
Last-Attempt-Date: Fri, 24 Apr 2015 21:39:52 GMT
--t3OLdq1k026047.1429911592/ip-172-31-41-109.ec2.internal
Content-Type: message/rfc822
Return-Path: <webapp#ip-172-31-41-109.ec2.internal>
Received: from ip-172-31-41-109.ec2.internal (localhost [127.0.0.1])
by ip-172-31-41-109.ec2.internal (8.14.4/8.14.4) with ESMTP id t3OLdg1k026045
for <univstudent#uni.edu>; Fri, 24 Apr 2015 21:39:42 GMT
Received: (from webapp#localhost)
by ip-172-31-41-109.ec2.internal (8.14.4/8.14.4/Submit) id t3OLdgcq026044;
Fri, 24 Apr 2015 21:39:42 GMT
To: univstudent#uni.edu
Subject: [classifiedads] Password Reset
X-PHP-Originating-Script: 498:class-phpmailer.php
Date: Fri, 24 Apr 2015 21:39:42 +0000
From: WordPress <wordpress#classifiedads-test.elasticbeanstalk.com>
Message-ID: <bace4f13cdc099117cd4ac9c70e2531c#classifiedads-test.elasticbeanstalk.com>
X-Priority: 3
X-Mailer: PHPMailer 5.2.7 (https://github.com/PHPMailer/PHPMailer/)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Someone requested that the password be reset for the following account:
http://classifiedads-test.elasticbeanstalk.com/
Username: univstudentseas
If this was a mistake, just ignore this email and nothing will happen.
To reset your password, visit the following address:
<http://classifiedads-test.elasticbeanstalk.com/wp-login.php?action=rp&key=dzaUvJpcjAe243gNOysZ&login=univstudentseas>
--t3OLdq1k026047.1429911592/ip-179-35-41-109.ec2.internal--

This sounds very similar to another recent question about email:
http://stackoverflow.com/questions/29808262/unable-to-send-emails-from-linux/29810884#29810884
Does your ec2 instance have an associated external DNS? Is there a public IP associated with it. You'll need to apply some type of fix so that your outgoing email message has a domain other than webapp#ip-172-31-41-109.ec2.internal

Related

Received-Spf: neutral

I have an Ubuntu-server with Wordpress installed. When sending out emails from the server I get the following header:
Received-Spf: neutral.
I did set the SPF-record in the following matter:
v=spf1 mx a include:_spf.google.com include:spf.gigahost.dk ~all
The a-record resolves to the IP of my server which is
46.101.199.65
When testing with http://vamsoft.com/support/tools/spf-policy-tester with the IP and email hello#kjottogblod.com it passes.
Any idea why Google is not marking emails send from the server as "pass"?
This is the complete header. I've replaced my email with xxx#xxx.com. But the receiving email is a Google Apps account.
Delivered-To: xxx#xxx.com
Received: by 10.157.38.140 with SMTP id l12csp352662otb;
Tue, 5 Jul 2016 06:42:16 -0700 (PDT)
X-Received: by 10.28.50.131 with SMTP id y125mr17192051wmy.94.1467726136065;
Tue, 05 Jul 2016 06:42:16 -0700 (PDT)
Return-Path: <www-data#ubuntu-2gb-fra1-01-tpk>
Received: from ubuntu-2gb-fra1-01-tpk ([46.101.199.65])
by mx.google.com with ESMTP id f66si16033wme.56.2016.07.05.06.42.15
for <xxx#xxx.com>;
Tue, 05 Jul 2016 06:42:16 -0700 (PDT)
Received-SPF: neutral (google.com: 46.101.199.65 is neither permitted nor denied by best guess record for domain of www-data#ubuntu-2gb-fra1-01-tpk) client-ip=46.101.199.65;
Authentication-Results: mx.google.com;
spf=neutral (google.com: 46.101.199.65 is neither permitted nor denied by best guess record for domain of www-data#ubuntu-2gb-fra1-01-tpk) smtp.mailfrom=www-data#ubuntu-2gb-fra1-01-tpk
Received: by ubuntu-2gb-fra1-01-tpk (Postfix, from userid 33)
id AF06414471B; Tue, 5 Jul 2016 09:42:15 -0400 (EDT)
To: xxx#xxx.com
Subject: =?UTF-8?Q?Your_Kj=C3=B8tt_og_Blod_order_receipt_from_July_5,_2016?=
X-PHP-Originating-Script: 33:class-phpmailer.php
Date: Tue, 5 Jul 2016 13:42:15 +0000
From: =?UTF-8?Q?Kj=C3=B8tt_og_Blod?= <hello#kjottogblod.com>
Message-ID: <9e947b8b46848b4f9fb10ff2e25ee2a1#kjottogblod.com>
X-Mailer: PHPMailer 5.2.14 (https://github.com/PHPMailer/PHPMailer)
MIME-Version: 1.0
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 8bit
It's the smtp.mailfrom address that is used in the SPF check. This is the so-called envelope sender. And since ubuntu-2gb-fra1-01-tpk is not a valid domain it can not have a SPF record, hence the Neutral result.
So you will have to set up your Wordpress installation to use a better envelope-sender. I'm no Wordpress expert, but it seems that there are several filters/plugins that allow you to change the mail settings.

Is it possible to get browser to cache OPTIONS result

I am trying to get the user's browser to stop making OPTIONS request once it learns that my api server allows for cross origin requests but it doesn't seem like adding the standard headers effects it. Is it possible to do this?
Access-Control-Allow-Credentials:true
Access-Control-Allow-Headers:Authorization,Content-Type,Request,Accept,Origin,User-Agent,DNT,Cache-Control,X-Mx-ReqToken,Keep-Alive,X-Requested-With,If-Modified-Since
Access-Control-Allow-Methods:POST,GET,OPTIONS,PUT,DELETE
Access-Control-Allow-Origin:http://example.com
Cache-Control:max-age=31536000
Connection:keep-alive
Content-Length:0
Content-Type:text/plain charset=UTF-8
Date:Thu, 13 Aug 2015 18:25:42 GMT
Expires:Fri, 12 Aug 2016 18:25:42 GMT
Server:nginx/1.4.6 (Ubuntu)
http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.2:
9.2 OPTIONS
[…]
Responses to this method are not cacheable.

Nexus Remote User Token authorization when deploying

I have a question regarding Nexus RUT capability. After setting it up, getting http header read, adding this user name to security.xml and mapping the role to this user, I am able to authorize in Sonatype Nexus GUI.
Question is, how can I authorize when trying to deploy artifact to Nexus repository using, lets say, Maven?
curl -I http://localhost:8080/nexus/service/local/status
returns
HTTP/1.1 401 Unauthorized
Date: Thu, 11 Jun 2015 10:41:59 GMT
Server: Nexus/2.11.3-01
X-Frame-Options: SAMEORIGIN
X-Content-Type-Options: nosniff
WWW-Authenticate: BASIC realm="Sonatype Nexus Repository Manager API"
Content-Length: 0
but
curl -I -H "X-Forwarded-User: admin" http://localhost:8080/nexus/content/
returns
HTTP/1.1 200 OK
Date: Thu, 11 Jun 2015 10:44:35 GMT
Server: Nexus/2.11.3-01
X-Frame-Options: SAMEORIGIN
X-Content-Type-Options: nosniff
Accept-Ranges: bytes
Last-Modified: Thu, 11 Jun 2015 10:44:35 GMT
Content-Length: 0
Using credentials in maven project and trying to deploy site after this tutorial, I am getting error
Uploading: .//project-summary.html to https://my.site.com/nexus/content/sites/site/
[WARNING] Required credentials not available for BASIC <any realm>#federation-sts.site.com:443
[WARNING] Preemptive authentication requested but no default credentials available
https://federation-sts.site.com/adfs/ls/?SAMLRequest=fZJdT4Mw........... - Status code: 200
Transfer finished. 5671 bytes copied in 0.404 seconds
Transfer error: java.io.IOException: Unable to create collection: https://my.site.com/nexus/; status code = 302
I would really appreciate your help, thanks!

Twice daily mysterious test emails from Sendmail.exe / WAMP server

A few months ago I set up WAMP server on my Windows 7 machine to develop a Wordpress site locally. I added Sendmail.exe to make Contact Form 7 (a contact form which sends out an email from me, to me) work properly. All was well. But, on a once or twice daily basis, I receive, to the Gmail account I set up with sendmail, a "testing sendmail.exe" email. Even when my computer (running WAMP) is off. How can this be?
Once the development of the website was complete and ready to go live, I uploaded it using the Wordpress Duplicator (https://wordpress.org/plugins/duplicator/) plugin. I have searched (using ftp) through the live site, and cannot find any kind of sendmail files there.
For client approval, I uploaded the site (again using the Worpdress Duplicator plugin) to a subdirectory on my own site, but since then I have deleted all the files from that directory.
So my question is: How on earth are theses emails getting sent? Does the sendmail application actually use some other server somewhere out there (not my WAMP "server") to send the emails, and it's got stuck in the habit of sending out this test email?
Thanks in advance for any help on this!
Here's the full header (I've changed my email to "xxxxxxx#gmail.com"):
Delivered-To: xxxxxxx#gmail.com Received: by 10.25.214.135 with
SMTP id p7csp302451lfi; Sat, 13 Dec 2014 06:57:18 -0800 (PST)
X-Received: by 10.181.12.17 with SMTP id em17mr16780659wid.45.1418482637935; Sat, 13 Dec 2014 06:57:17 -0800 (PST)
Return-Path: <xxxxxxx#gmail.com> Received: from mout.kundenserver.de (mout.kundenserver.de. [212.227.126.131])
by mx.google.com with ESMTPS id gf8si8194056wib.61.2014.12.13.06.57.17 for <xxxxxxx#gmail.com>
(version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 13 Dec 2014 06:57:17 -0800 (PST)
Received-SPF: softfail (google.com: domain of transitioning xxxxxxx#gmail.com does not designate 212.227.126.131 as permitted sender)
client-ip=212.227.126.131; Authentication-Results: mx.google.com; spf=softfail
(google.com: domain of transitioning xxxxxxx#gmail.com does not designate 212.227.126.131 as permitted sender) smtp.mail=xxxxxxx#gmail.com;
dmarc=fail (p=NONE dis=NONE) header.from=gmail.com
Received: from icpu1054.kundenserver.de
(infong247.kundenserver.de [212.227.29.151]) by mrelayeu.kundenserver.de
(node=mreue007) with ESMTP (Nemesis) id 0LbCQQ-1XXwAh0AAM-00kyHa; Sat, 13 Dec 2014 15:57:17 +0100
Received: from 72.167.159.8 (IP may be forged by CGI script) by icpu1054.kundenserver.de with HTTP id 49vAEC-1XsTpZ40PF-017nps; Sat, 13 Dec 2014 15:57:16 +0100
X-Sender-Info: <264661319#icpu1054.kundenserver.de> Date: Sat, 13 Dec 2014 15:57:16 +0100 Message-Id: <49vAEC-1XsTpZ40PF-017nps#icpu1054.kundenserver.de> Precedence:
Paul

How do I prevent GAE from ungzipping a gzipped xml feed?

I have a script on GAE that requests an XML feed from a partner that's typically 40MB but only 5MB gzipped. GAE is automatically unzipping this content and throwing an error that the response is too big:
HTTP response was too large: 46677241. The limit is: 33554432.
The script is setup to uncompress the response itself. How do I prevent GAE from getting in the way and breaking?
Here's the response header from my partner:
HTTP/1.0 200 OK
Expires: Wed, 27 Jun 2012 05:42:07 GMT
Cache-Control: max-age=10368000
Content-Type: application/x-gzip
Accept-Ranges: bytes
Last-Modified: Wed, 22 Feb 2012 11:06:09 GMT
Content-Length: 5263323
Date: Tue, 28 Feb 2012 05:42:07 GMT
Server: lighttpd
X-Cache: MISS from static01
X-Cache-Lookup: MISS from static01:80
Via: 1.0 static01:80 (squid)
Most likely your partner's server responds with plain XML, because it thinks that http-client sending requests (i.e. GAE URL Fetch service) does not support gzipping. Hence "response was too large" error.
To announce that you actually want to receive gzipped content you need to set Accept-Encoding: gzip header when using URL fetch service.

Resources