LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 04-26-2010, 11:57 AM   #1
natern
LQ Newbie
 
Registered: Apr 2010
Posts: 8

Rep: Reputation: 0
Send domain mail to offsite/external host from the webhost using sendmail Plesk 9


Hello all,
I am managing a Fedora dedicated server with Plesk 9 and just recently moved the email for one of the domains on the server to Google Apps for business. Unfortunately, I cannot get email messages from the website forms to deliver to addresses on this domain. For anyone familiar with Plesk, I have disabled mail in the hosting settings by un-checking the "Activate mail service on domain" checkbox and there are no accounts in the domain. (Other readings have indicated that this should be enough to allow mail to be directed to the appropriate server). My MX records correctly point to the google apps mail server.
I'm quite comfortable with command line, but I know almost nothing about the sendmail program or its alternatives and my attempts at researching how to set up this relay has been futile. I'm pretty sure I'm using sendmail and not qmail or anything else from what the red-hat style "alternatives" symlinks point to.
Oh, I've also checked the /etc/mail/access, domaintable, mailertable, sendmail.cf, virtusertable, local-host-names, sendmail.cf, and submit.cf and most of these files are empty (except the .cf files), and the sendmail.cf and submit.cf make no reference to the domain in question.
If it's of any help in resolving this problem, here is the output from a sendmail test that was was not received. (private data ommitted of course)

sendmail -v xxx@yyy.com
test email from yyy.com webserver. please ignore.
.
xxx@yyy.com... Connecting to [127.0.0.1] via relay...
220 my.server.com ESMTP
>>> EHLO my.server.com
250-my.server.com
250-STARTTLS
250-PIPELINING
250 8BITMIME
>>> STARTTLS
220 ready for tls
>>> EHLO my.server.com
250-my.server.com
250-PIPELINING
250 8BITMIME
>>> MAIL From:<root@my.server.com>
250 ok
>>> RCPT To:<xxx@yyy.com>
>>> DATA
250 ok
354 go ahead
>>> .
250 ok 1272296384 qp 10639
xxx@yyy.com... Sent (ok 1272296384 qp 10639)
Closing connection to [127.0.0.1]
>>> QUIT

Performing the same test and sending an email to a non-hosted domain works fine.
Any help would be greatly appreciated and I would love you forever.
Thanks,
Nathan
 
Old 04-26-2010, 01:04 PM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,216
Blog Entries: 1

Rep: Reputation: 2067Reputation: 2067Reputation: 2067Reputation: 2067Reputation: 2067Reputation: 2067Reputation: 2067Reputation: 2067Reputation: 2067Reputation: 2067Reputation: 2067
Hi,

Since /etc/mail/local-host-names is empty, you can use /etc/mail/mailertable to redirect mail to gmail:
Code:
yyy.com esmtp:mail.google.com
Of course you have to change mail.google.com with the actual google apps mail server.
After editing mailertable you have to run:
Code:
makemap hash /etc/mail/mailertable < /etc/mail/mailertable
Regards
 
Old 04-26-2010, 01:16 PM   #3
natern
LQ Newbie
 
Registered: Apr 2010
Posts: 8

Original Poster
Rep: Reputation: 0
Thank you for the quick response! I added that line with the correct domain name and google mail server, ran the makemap command as shown, but nothing seems to have changed. Do I have to restart any services? The verbose output from sendmail -v xxx@yyy.com still only showed my server in the connection output, nowhere did I see the google mail server. Needless to say I never received the message at the destination email.
 
Old 04-26-2010, 01:59 PM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,216
Blog Entries: 1

Rep: Reputation: 2067Reputation: 2067Reputation: 2067Reputation: 2067Reputation: 2067Reputation: 2067Reputation: 2067Reputation: 2067Reputation: 2067Reputation: 2067Reputation: 2067
You don't need to restart sendmail, even though a restart does no harm
Anyway, what is the output of:
Code:
sendmail -bv user@yyy.com
dig mx yyy.com
 
Old 04-26-2010, 04:15 PM   #5
natern
LQ Newbie
 
Registered: Apr 2010
Posts: 8

Original Poster
Rep: Reputation: 0
The output looks promising
Code:
[root@XXXX ~]# sendmail -bv xxx@yyy.com
xxx@yyy.com... deliverable: mailer esmtp, host mydomain.com.s9a1.psmtp.com, user xxx@yyy.com
[root@nnl069 mail]# dig mx yyy.com

; <<>> DiG 9.5.0-P2 <<>> mx yyy.com
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 3328
;; flags: qr rd ra; QUERY: 1, ANSWER: 5, AUTHORITY: 1, ADDITIONAL: 6

;; QUESTION SECTION:
;yyy.com.            IN    MX

;; ANSWER SECTION:
yyy.com.        63896    IN    MX    30 ASPMX3.GOOGLEMAIL.com.
yyy.com.        63896    IN    MX    10 ASPMX.L.GOOGLE.com.
yyy.com.        63896    IN    MX    20 ALT1.ASPMX.L.GOOGLE.com.
yyy.com.        63896    IN    MX    20 ALT2.ASPMX.L.GOOGLE.com.
yyy.com.        63896    IN    MX    30 ASPMX2.GOOGLEMAIL.com.

;; AUTHORITY SECTION:
yyy.com.        63896    IN    NS    ns.yyy.com.

;; ADDITIONAL SECTION:
ASPMX.L.GOOGLE.com.    244    IN    A    74.125.113.27
ALT1.ASPMX.L.GOOGLE.com. 193    IN    A    209.85.229.27
ALT2.ASPMX.L.GOOGLE.com. 193    IN    A    209.85.129.114
ASPMX2.GOOGLEMAIL.com.    1968    IN    A    209.85.135.27
ASPMX3.GOOGLEMAIL.com.    2388    IN    A    72.14.213.27
ns.yyy.com.        63896    IN    A    206.248.146.145

;; Query time: 25 msec
;; SERVER: 216.139.240.43#53(216.139.240.43)
;; WHEN: Mon Apr 26 16:05:02 2010
;; MSG SIZE  rcvd: 271
The mydomain.s9a1.psmtp.com is the highest priority mx server stored locally on the server for our google apps postini mail server while the a*.google*.com servers are what's currently stored in our registrar's dns, but google will receive mail on either one. (We're going to be transferring domain ownership as soon as we get this mail issue sorted, hence why the local mx records don't match the 'live' records. The records did match a few days ago and the mail wasn't sending then)
 
Old 04-26-2010, 05:58 PM   #6
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,216
Blog Entries: 1

Rep: Reputation: 2067Reputation: 2067Reputation: 2067Reputation: 2067Reputation: 2067Reputation: 2067Reputation: 2067Reputation: 2067Reputation: 2067Reputation: 2067Reputation: 2067
Hi,

If mydomain.com.s9a1.psmtp.com knows how to handle mail for xxx@yyy.com, I guess it works.

You should try to send an email and watch /var/log/maillog to see what happens
 
Old 04-27-2010, 09:15 AM   #7
natern
LQ Newbie
 
Registered: Apr 2010
Posts: 8

Original Poster
Rep: Reputation: 0
Sorry to bug you again,
but I watched /var/log/maillog, and all the date-stamped maillog files in the /var/log folder, but they are all empty. I'm not sure if loggin is disabled for mail, or how to go about enabling it if it is, but I still can't receive mail from the server on this domain. I also made sure that the server's ip was set as an incoming gateway to prevent it from being blocked by google, but still nothing. Any other suggestions for me? So far you've been much more helpful than my server host.
 
Old 04-27-2010, 09:36 AM   #8
natern
LQ Newbie
 
Registered: Apr 2010
Posts: 8

Original Poster
Rep: Reputation: 0
Good news! This morning's email went through, it just got picked up as spam! Bathroy, you rule! As a king of men, or at the very least, linux servers. Thank you
 
Old 04-27-2010, 02:21 PM   #9
natern
LQ Newbie
 
Registered: Apr 2010
Posts: 8

Original Poster
Rep: Reputation: 0
Okay, another question for ya. Email is sending from the server to real accounts as expected now, all thanks to you. But aliases such as info@domain.com are not directing email to the address it should and I'm trying to figure out on which end this problem is happening. (Sending from my own mail account to this alias works) I'm thinking google, but I just wanted to confirm before I open a ticket with google. I'm interpretting the output of this sendmail -bv command to mean that my server seems to be finding that alias on my domain so shouldn't be having any problems directing mail to it.
Code:
[root@place ~]# sendmail -bv info@domain.com
info@domain.com... deliverable: mailer esmtp, host aspmx.l.google.com, user info@domain.com
Thanks again!
 
Old 04-27-2010, 04:05 PM   #10
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,216
Blog Entries: 1

Rep: Reputation: 2067Reputation: 2067Reputation: 2067Reputation: 2067Reputation: 2067Reputation: 2067Reputation: 2067Reputation: 2067Reputation: 2067Reputation: 2067Reputation: 2067
Hi,

The output of sendmail -bv ... means that your server knows that it has to deliver the mail for info@domain.com to aspmx.l.google.com. Then it's up to aspmx.l.google.com to deliver. So I guess you have to contact them.

Btw, from what I've read, the mail logs for plesk could be located at /usr/local/psa/var/log/maillog, so you can look there for hints on this.

Regards
 
Old 04-27-2010, 04:17 PM   #11
natern
LQ Newbie
 
Registered: Apr 2010
Posts: 8

Original Poster
Rep: Reputation: 0
Okay, thanks again for all the help. I'll check out that log and get in touch with google to figure out what's going on. Thanks!
Nathan
 
Old 12-07-2010, 08:16 AM   #12
archtoad6
Senior Member
 
Registered: Oct 2004
Location: Houston, TX (usa)
Distribution: MEPIS, Debian, Knoppix,
Posts: 4,727
Blog Entries: 15

Rep: Reputation: 234Reputation: 234Reputation: 234
What was Google's answer? -- A brand new Postini admin. wants to know.

TIA
 
Old 03-13-2011, 08:00 AM   #13
archtoad6
Senior Member
 
Registered: Oct 2004
Location: Houston, TX (usa)
Distribution: MEPIS, Debian, Knoppix,
Posts: 4,727
Blog Entries: 15

Rep: Reputation: 234Reputation: 234Reputation: 234
natern,

Did you ever hear from Google?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to send mail to outer domain using SMART_HOST in sendmail.mc adhar Linux - General 8 12-22-2009 07:17 AM
How to configure sendmail only to send mail to external mail account Nivix Linux - Newbie 2 10-23-2008 01:46 AM
Solaris DHCP server doesn't send host/domain name to clients crisostomo_enrico Solaris / OpenSolaris 0 08-29-2008 07:52 PM
Restrict users of a domain to send/receive mail from one particular domain tanveer Linux - Server 0 09-02-2007 03:01 AM
Sendmail sending as host.domain.com, i want it to be from just domain.com. PlatinumRik Linux - Software 5 10-07-2004 05:32 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 06:46 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration