开发者

Email to be sent out from a dedicated server with different IP

开发者 https://www.devze.com 2022-12-27 06:11 出处:网络
We have three domains hosted on one dedicated server each with its own dedicated IP. Domain A - Has the server primary IP address (default server IP)

We have three domains hosted on one dedicated server each with its own dedicated IP.

Domain A - Has the server primary IP address (default server IP)

Domain B - Has its own IP address

Domain C - has its own IP address

If an email goes out from Domain B then it uses the Domain A IP address in outgoing and this makes emails from Domain B using PHP go st开发者_JAVA百科raight to spam box of Gmail etc.

Is there any way to change the source IP depending on where the email originates from in PHP? What should we change to fix this?


This is nothing to do with PHP.

No you can't spoof addresses in the way you suggest - but the reason that emails are being classified as spam is because you've only got Host A published in your SPF. Just add the others to the permitted senders list:

"v=spf1 a:hostA.example.com a:hostB.example.com a:hostC.example.com"

C.


You're not giving any details about your server setup so this can't really be answered. PHP can, however, use a SMTP server of your liking. The easiest way to set this up is a tool like PHPMailer.

If you can't change the IP you're sending from, you need to change domain B's MX record making Domain A (or its IP) the mail server for that domain. I'm pretty sure spam filters like Google mail look for the MX record only. Of course, you would have to have both E-Mail sending and receiving facilities on Domain A for this to work.


PHP is usually set up to drop mail onto the localhost MTA, which will always send it on from its own bound IP address. So, no.

To reduce the chances of being marked as spam because your mail comes from an address that doesn't tie up with the DNS records (MX or fallback A) for a domain, add an SPF record to the DNS for all the domains saying that mail from the sending IP address is fine.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号