sendmail not able to send to specific e-mail address - php

I'm running an EC2 with (bitnami for wordpress) and have sendmail configured.
No matter if using my own php written forms or now contact form 7 plugin for wordpress there is one specific address (the clients mail address) that simply won't receive the mails from the forms.
I tested with multiple addresses of myself and I always get all the mails. As soon as I swith to the clients mail-address though they don't get the form mails, not even in the Spam-Folder.
What could be a potential reason?
I thought maybe the server doens't like the same sender and receiver address as the sending address in contact form 7 is info#website.at and the receiver is info#website.at … but I also changed that and tested, no difference.
here is the log file, but I'm unable to interpret that properly.

You should be very cautious about sending the email directly from an EC2, many email providers will actually block emails that come from the AWS EC2 ranges. This exists to prevent an EC2 host being used to send spam/spoof emails.
Additionally Bitnami mention in there documentation the below.
We recommend using an external SMTP server to send email from EC2 instances, due to AWS limitations on EC2 machines. For PHP applications, read the instructions on how to send emails using Gmail or using Amazon Simple Email Service (SES).
By using an external SMTP server combined with adding a valid SPF record you should be able to reduce the chance of emails not making it through to the client in addition to not being labelled as spam either.

Related

Is anybody able to send mails to gmail through AWS LAMP server using postfix, sendmail

I am using php mail function to send mails to gmail,yahoo accounts. I have a AWS LAMP instance, i have installed postfix and sendmail. I went through many forums infinite number of forums, still not able to send mails. After too many changes i was able to see Message accepted for delivery, but after some time got the same message.
stat=Deferred: Connection timed out with mta7.am0.yahoodns.net.
stat=Deferred: Connection timed out with alt4.gmail-smtp-in.l.google.com.
Just i am wondering is anyone able to send mails using the same scenario.
TLDR: Sending email is hard. Don't attempt final delivery yourself. Use AWS SES or another ESP.
As AWS is aware that spammers have, and will, try to send their mail from anywhere by any means, AWS explicitly prevents EC2 Instances from being able to send email without some effort. It is not in your best interest as a sender to attempt to send email directly, unless you understand very well the various mechanisms in place to securely send email, accurately identify yourself as a legitimate sender, and gain reputation on your EIP with ISPs. Primarily, AWS intends for you to use SES to send email outside your VPC.
How to use Sendmail with SES
How to request port 25 unblocked
I can't emphasize enough that businesses small and large choose to send their mail through a third party (an ESP, or Email Service Provider, like AWS SES) in order to resolve the many, many issues that will come up when attempting to do it all yourself. The various acronyms involved, all of which require their own research and understanding from various RFC's include: SPF, DKIM, and DMARC; there is also the regular maintenance required in monitoring whether or not your IP is currently, or in the future, blacklisted by the various RBL's that monitor Spam Traps; and, of course, list hygiene, or scrubbing your list for bounces (not doing these is a guaranteed path to staying in the spam folder, even if you finally succeed in sending email out port 25). Let an ESP do some of this for you.

What is the proper setup/architecture of postfix, phpmail, and and open mail relay service?

Setup:
Ubuntu 16.x, Postfix, PHPMailer
SocketLabs (mail relay service) - to send out server emails
Union Solution Exchange Server - to send and receive formal email from outlook
Im trying to send out emails from my ubuntu linux server that contain simple form data (name, message, phone etc).
I have been trying in vain to send emails from my PHP to emails, they send, but they get blocked as spam/junk.
I've recently switched mail services (from zoho to a solution union exchange server) and I cannot get past barracuda (even modifying whitelists / spam settings etc) with my own mail, but I can see them as junk in my hotmail. (cannot not send from mailserver#potlickers.com to support#potlickers.com). They get immediately canned and not delivered.
Solutions Union said I was spoofing the emails and I cannot whitelist my own domain I'm using and sending from? Ok. They suggested buying another domain. I now own potlickers.net.
They also mentioned I should take that domain and use it to send my emails via open relay (again socketlabs).
So, if my webserver is setup on a fqdm such as potlickers.com, and i send the mail from that server, how do i setup the correct architecture to send mails from potlickers.net to the open relayserver so my emails are free and clear and not spoofed?
Can i configure postfix to send mail from potlickers.net even though its hosting on blah.potlickers.com?
I understand to also add dkim and PTR.
Help stackoverflow1 - your my only hope. TIA much much mucho thanks.
So I think I got it.
Reconfigured postfix as a satellite. Pointed to smtp of relay mail server. Removed all SMTP settings in PHPmailer that point to server, and credentials.
Fire away - works like a charm.
Satellite server has the new domain potlickers.net versus the webserver domain potlickers.com
Seems to work ok for now. Will update moving forward.

WordPress on VPS running Plesk, no mail is being sent out

I have a VPS server running PLESK(12.5.30) and all of the WordPress forms we have that are supposed to send to people who fill out forms, are not being sent. They are just sitting in the mail queue as 'deferred'.
I think it has to do with php mail, but I can't seem to get this to work and my host is literally no help at all. I even called Plesk and they did not help.
Any ideas?
Thanks!
For more information you can check system mail log somewhere in in /var/logs/
Take in account that setting up working server of outbound mail is a real pain. In two words you need to setup SPF and DKIM or such mail services like Gmail will mark all emails from your server as spam by default.
In your case I can suggest to SendGrid service which has a WordPress plug-in https://wordpress.org/plugins/sendgrid-email-delivery-simplified/
(You need to register SendGrid account, it's free)
If your contact forms using default wp_mail() you mail will be send through SendGrid mail servers.
Also you can setup you Postfix/sendmail with using SendGrid's mail server: https://sendgrid.com/docs/Integrate/Mail_Servers/postfix.html

Sending mail from webserver to external mail server with local domain name

This is an issue I've encountered several time and haven't yet found a decent solution for:
Sending an e-mail from a webserver on e.g. "domain.com", to info#domain.com which is hosted on an external mail server e.g. Google Mail
In my case I always send from PHP over Apache and often on shared hosting, but I can imagine this is the same case on other frameworks.
These e-mails always seem to be delivered to the local mail server, even if I set the MX records on that server to point to the right external mail server.
A solution for this is to use an external SMTP server, but this isn't always easy when you're working with clients that either need to set-up a new e-mail account on their server and provide the SMTP details or sign-up for a third-party SMTP server.
What is the solution for this? Is there no way around SMTP?
Most emai/MTA server "autoconfigure" themselves. They guess list of local email domains (doimans with locally hosted mailboxes).
In sendmail case you can turn it off adding the following line in sendmail.mc:
define(`confDONT_PROBE_INTERFACES', `True')
Documentation : cf/README - confDONT_PROBE_INTERFACES
I have had the same issue many many times (in my case using PHP on a LAMP stack).
Try/check the following.
If you are using cPanel or similar, set the MX records to the external mailserver (Google apps etc).
Set up an SPF record to allow your hosting website to send email (this way no need to configure SMTP).
This may not be applicable but if you are using something like phpmailer. Set the property $mail->isMail(); so it tries to use your SPF allowed local mail() function to send the email. Sorry for going off into very specific advice, but might help in your particular situation.
Worth checking there are not similarly named local mailboxes on your hosting box.
Hope this helps!

A couple problems re: CodeIgniter emailer

I have some problems with the email system for CodeIgniter:
First, the emails I send out (registration, confirmations) are getting caught in standard spam filters in gmail and other mail clients. How do I get around this? How do companies like Facebook get their emails through consistently?
Second, the mailer is working locally but once we deploy it it no longer runs (doesn't send emails) but all the other forms run just fine. Anyone ever run into a problem like this?
Thanks for all the help!
I can't really answer your first question - it's not specific to CodeIgniter. You just need to make sure your email doesn't look like spam. In short - there's no way of guaranteeing your e-mail will not end up in a spam filter.
As for the second question, I expect your production server needs to be configured properly for email. You probably need to configure CodeIgniter to send email properly. I would suggest setting up an SMTP server (or using an existing one) rather than using the standard PHP mail which I think CodeIgniter uses by default.
Regarding spam, most organisations are very secretive about how they prevent spam (not wanting to publish information which helps the spammers) and in some cases they don't actually know - an obvious examlpe of this is bayesian filtering - but, for example, hotmail use a completely unaccountable army of volunteers to manually classify emails.
Do and get a copy of spamassassin and try to reverse engineer how the standard rules work. Obvious things to check are:
1) AVOIDING LOTS OF CAPITALS
2) don't mention the 'V' word
3) make sure you've got a current and restrictive SPF 1.0 policy published
4) make sure your sending from an address which has A and PTR DNS records
5) Do provide a reply-to and from email address which use your domain in the address
the mailer is working locally but once we deploy it it no longer runs
doesn't send emails
Which? These are 2 totally seperate things. If the code is falling over (if so why have you not provided the error details) then its likely a PHP version issue or a problem with the connection to the MTA (or the PHP mail config).
The latter is a problem with the MTA itself.
99.9% of problems reported as PHP mail failures have nothing to do with PHP and are problems with the MTA.
Enabled detailled error reporting for your MTA and see where it is failing.
C.
You may have to configure the email on your server differently than your local development environment. I've had to in the past.
There are two basic ways that PHP can send mail:
Via a UNIX program called "sendmail" (only on non-Windows servers and only if it is installed - check with your hosting provider)
Via a SMTP server.
If you've configured CodeIgniter to use SENDMAIL, check to ensure that the Sendmail path is correct. Your hosting provider usually provides this somewhere in their online documentation.
If you're using SMTP, you need to make sure that your server can contact the SMTP server. You can do this by logging into the server via SSH and typing "telnet your.smtpserver.com 25". If you get an error message about not being able to connect, you know you have a problem with your hosting provider connecting to your mail server.
I've been able to diagnose this problem by enabling logging on my production server (http://bit.ly/4pprd6) and adding log_message('error', $this->email->print_debugger()) right after I attempt to send a message.

Categories