Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Situation:

Email MX service is on example.com BUT using google mail service. A domain (web service) are on different IP address than google mail service on VPS host and on the same domain name example.com.

host example.com

   example.com has address xxx.xxx.xxx.xxx   <--- VPS server, WEB service
   example.com mail is handled by 5 alt2.aspmx.l.google.com.
   example.com mail is handled by 1 aspmx.l.google.com.
   example.com mail is handled by 5 alt1.aspmx.l.google.com.
   example.com mail is handled by 10 aspmx3.googlemail.com.
   example.com mail is handled by 10 aspmx2.googlemail.com.

host -t mx example.com

example.com mail is handled by 5 alt2.aspmx.l.google.com.
example.com mail is handled by 1 aspmx.l.google.com.
example.com mail is handled by 5 alt1.aspmx.l.google.com.
example.com mail is handled by 10 aspmx3.googlemail.com.
example.com mail is handled by 10 aspmx2.googlemail.com.

On a same domain example.com we are using MX service google mail service.

PROBLEM: On a VPS server example.com has address xxx.xxx.xxx.xxx a VPS server can't send an email to another something@example.com as a same domain.

WHAT I WANT? Using mail service MX from googlemail and VPS from another IP address.

And dig -t example.com

; <<>> DiG 9.9.2-P1 <<>> example.com ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 8318 ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION: ; EDNS: version: 0, flags:; udp: 512 ;; QUESTION SECTION: ;example.com. IN A

;; ANSWER SECTION: example.com. 7200 IN A xxx.xxx.xxx.xxx

;; Query time: 208 msec ;; SERVER: 127.0.1.1#53(127.0.1.1) ;; WHEN: Sun Jul 7 13:25:21 2013 ;; MSG SIZE rcvd: 52

Sending mail from google service can send to ALL. Send mail from VPS server can send to ALL EXCEPT on the example.com

Hint: CentOS using Plesk service with full VPS SSH access. What is best solution for working mail service on both and that can VPS send mail service on a same domain?

share|improve this question
add comment

2 Answers

Your vps should authenticate with gmail before sending the email. Configure your software to use gmail as a smarthost for delivery and you should be fine. You will need to provide gmail credentials in the configuration.

Look in the /var/log directory for recently the logs of what is happening. syslog and mail.log are likely to have details.

share|improve this answer
    
But what's about adding another MX record list in MX domain on VPS server? If google MX recored is primarly, another lists should try as MX 15 example.com ? There are not logs. I remembered that when I send from shell that tell me can't send mail from same domain, something like this, but when I send to another it works and sent. –  Marin Sagovac Jul 7 '13 at 13:14
1  
MX records indicate which server receives e-mail. MTA (which send email) don't need an MX record. You likely want all your MX records to point to Google servers. It sounds like you have not setup your server to use a smarthost, which should solve the failure to send to the same domain. –  BillThor Jul 7 '13 at 13:19
    
It's looks like I need to try these settings to change and point to google? cyberciti.biz/faq/configure-sendmail-as-a-smart-host –  Marin Sagovac Jul 7 '13 at 13:24
    
Those will work if you have sendmail as your email service. I suspect you may have postfix as your email service. It uses different configuration files, but the principle is the same. –  BillThor Jul 7 '13 at 13:32
add comment
up vote 0 down vote accepted

Solved using SMTP to connect another host and PHPMailer.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.