I'll try to explain the problem we have at my company the best I can :
So I have several forms across different servers. All are sent up to send emails with the mail() function in PHP to the email address email#ourcompany.fr
Now I've noticed a weird behavior : when the forms are hosted on our server (I'm talking about our apache server, the mails are handled by an exchange server) they arrive fine at the address up there.
But when the forms are hosted anywhere else on the internet, the emails arrive at the address email#ourcompany.es
What could the problem be ? SMTP configuration ? A set of rules at the exchange server ?
I am pretty much a newbie when it comes to emails and how they're handled when they're sent...
Thank you for your help.
EDIT: As per MarcB recommendation I tried the following in the shell :
XXXX:~$ nslookup -type=mx securitasdirect.es
Server: 10.40.144.166
Address: 10.40.144.166#53
securitasdirect.es mail exchanger = 10 smtp.securitasdirect.es.
XXXX:~$ host -t mx securitasdirect.fr
securitasdirect.fr has no MX record
XXXX:~$ host -t mx securitasdirect.es
securitasdirect.es mail is handled by 10 smtp.securitasdirect.es.
Alright so based on your update... and running dig from my local machine to confirm, your securitasdirect.fr domain has no MX records setup on the publicly accessible DNS servers.
Internally in your network, it's possible (likely even) you use different DNS servers which have MX records and hence internally you can deliver email to #fr while externally it's not working.
Update not sure if you're changing things as I write this answer, but it seems like I'm now getting a valid MX return for securitasdirect.fr.
Beyond that, securitasdirect.fr fails the rDNS test (see: http://www.mxtoolbox.com) while securitasdirect.es passes. It's possible this is also interfering with mail delivery.
Related
Is it possible to send mail from two valid sources?
To expand on this, I run an online shop web app, to separate concerns (and servers) I'm now using a 3rd party to handle mailboxes, (zoho.com) so as you can imagine, my mx records point to their provided names, and spf looks as follows: v=spf1 mx include:zoho.com ~all everything with zoho works smoothly.
Now, at the end of each day we need to notify each of our customers about their orders, plus other various automated mails during the day.
These mails come from the server, and are all sent using PHPMailer, but knowingly not using SMTP because I would very quickly fill zoho's queues and quotas for outgoing mail.
And more importantly, I cannot don't receive mail from my own domain sent from the server, but all other users seem to get the server produced mails just fine.
So the question is, what can I do to make my server a verified sender for my domain without removing zoho of course, some change in the SPF?
You can include multiple domain names, and your ~all should be -all
v=spf1 mx include:zoho.com include:myotherdomain.com -all
The actual problem here was the MTA settings with Exim, where my own domain name was set as a localdomain, hence the mail wasn't even leaving the server, by changing it to remotedomain mails started working normally.
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!
I'm using the mail(); function and it's working but sometimes it returns an error 553. I heard it could be because of:
You are attempting to send email to a domain that is not recognized by this server
You are attempting to relay email through this server, and have not authenticated
(source: http://www.error-553.net/)
Since it is sometimes working I guess the domain is unrecognizable but how do I overcome this error?
EDIT: I think the problem doesn't come from any of this source, first as I said it is sometimes working AND it is also sometimes working with the domain I'm trying to send email to.
Thanks.
Before sending your mail, check that the domain:
Exists
Has an MX record that is valid
Is not blacklisted
And in addition, that your local mailserver allows you to relay emails to the outside.
Points 1 and 2 are solved in an easy fashion: getmxrr("domain.name.com",$arrayOfHosts) will return true if it finds MX records.
Point 3 depends on which blacklist you want to use. I personally like SBL, which just requires a reverse DNS lookup.
We are having a problem with a web application delivering emails. Suppose the site lives on domain.com. Emails sent to manager#domain.com aren't being recieved by the client, but when we set it to developer#developersdomain.com or manager#aliasdomain.com they are received by the developer and the manager, respectively.
Is php's mail() command delivering email addresses to the location domain to localhost, instead of routing it through a mail server?
Sadly, this is the way that the mailserver itself works. It knows the machine it's on is domain.com and assumes the mailbox should be a local box.
This is why it's a good idea to have your server's domain name actually be a subdomain, even if it's just www.domain.com. That way, mail addressed to manager#domain.com is sent on to the mail server specified by domain.com's MX record.
That'll be a setting on your mail software at the serverside I guess! Check your software settings.
I have a server setup "myserver.com" and I'm trying to send emails from a PHP/Apache application on this server. The host name is set to "myserver.com" and I can send emails to anyone outside of the myserver.com domain.
We are using a separate server/service and the problem is when I try to send emails to anyone on the myserver.com domain they don't get the email.
This also happens when I try to send via command line, I get a:
dead.letter... Saved message in /home/username/dead.letter
It seems that the MX record is being ignored... how can I force it to respect the MX record?
Thanks.
how can I force it to respect the MX record?
By setting a proper hostname. If the server in question does not provide every single service for myserver.com, it needs to use a subdomain.