LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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 10-27-2010, 09:39 PM   #1
raymwu
LQ Newbie
 
Registered: Jul 2007
Posts: 3

Rep: Reputation: 0
Setting up sendmail to relay to exchange server


newbie and first time poster tho am a HPUX guy - sorry, but at least trying to branch out...

Have read a whole bunch of threads from how and troubleshooting but still having problems.

Was thrown a box configured by someone who resigned today. Need to get mail from the box outbound via SMTP relay off our exchange server.

Had edited the existing sendmail.mc file's SMART_HOST definition to our smtp gateway (I can telnet to port 25 and talk to it) be:
/define(`SMART_HOST', `10.1.106.87')dnl

The resulting sendmail.cf failing the parse upon startup (there's a unknown configuration line "dn1 dn1" at line 63 which i have to manually delete and then sendmail starts up fine.

Sent a test mail and the maillog contains:

Oct 27 22:34:11 dmzweb01 sendmail[4266]: o9S2YBEe004266: from=root, size=34, class=0, nrcpts=1, msgid=<201010280234.o9S2YBEe004266@dmzweb01.mathesondirect.com>, relay=root@localhost
Oct 27 22:34:11 dmzweb01 sendmail[4267]: o9S2YBDF004267: from=<root@dmzweb01.mathesondirect.com>, size=355, class=0, nrcpts=1, msgid=<201010280234.o9S2YBEe004266@dmzweb01.mathesondirect.com>, proto=ESMTP, daemon=MTA, relay=localhost.localdomain [127.0.0.1]
Oct 27 22:34:11 dmzweb01 sendmail[4266]: o9S2YBEe004266: to=rwu@matheson-trigas.com, ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30034, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (o9S2YBDF004267 Message accepted for delivery)
Oct 27 22:36:11 dmzweb01 sendmail[4269]: o9S2YBDF004267: to=<rwu@matheson-trigas.com>, ctladdr=<root@dmzweb01.mathesondirect.com> (0/0), delay=00:02:00, xdelay=00:02:00, mailer=relay, pri=120355, relay=10.1.106.87. [67.215.65.132], dsn=4.0.0, stat=Deferred: Connection timed out with 10.1.106.87.

mailq shows:
/var/spool/mqueue (1 request)
-----Q-ID----- --Size-- -----Q-Time----- ------------Sender/Recipient-----------
o9S2YBDF004267 5 Wed Oct 27 22:34 <root@dmzweb01.mathesondirect.com>
(Deferred: Connection timed out with 10.1.106.87.)
<rwu@matheson-trigas.com>

Was thinking of starting from scratch and put back sendmail.mc.rpmnew but was hoping on something quicker?

Thanks for your help.
 
Old 10-28-2010, 02:40 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
Well despite you saying you can telnet to that relay, it's saying otherwise. What I don't really understand is "relay=10.1.106.87. [67.215.65.132]" as, AFAIK, that says that's it's resolving the 10 IP address as a domain name to the 67 address. You might want to do something like run tcpdump to see what network traffic is actually occurring between these IP addresses.
 
Old 10-28-2010, 03:47 AM   #3
feinbein
Member
 
Registered: Jan 2010
Location: Norway
Posts: 76

Rep: Reputation: 12
You said you could telnet to your relay and talk to it.
So does this:
Code:
telnet 10.1.106.87 25
.... answer from mail relay .....
helo dmzweb01.mathesondirect.com
mail from: root@dmzweb01.mathesondirect.com
rcpt to: <email test>@<something out>
data
mail test
.<hit return>
give you something like 'mail sent'?

Does your Exchangeserver also stand in the DMZ? You might want to tell the Exchangeserver to accept mails from dmzweb01 or the corresponding address for relaying. If the Exchangeserver is set up reasonably secure it want accept mails from just any host out of the box. I am just guessing here but I assume Exchange and dmzweb01 are NOT in the same subnet.
Otherwise, if your Exchangeserver is using a smarthost as well (which is a good idea), you might just use that same smarthost directly from dmzweb01.

Christian
 
Old 10-29-2010, 09:21 AM   #4
raymwu
LQ Newbie
 
Registered: Jul 2007
Posts: 3

Original Poster
Rep: Reputation: 0
Thanks Chris/Christian for the prompt reply.

I'm actually perplexed by some other behavior that might be related. Despite having the mail relay, 10.1.106.87 in the hosts file as smtp.matheson-trigas.com, the hosts line in nsswitch.conf to be "files dns", nslookup can't succesfully find smtp.matheson-trigas.com as it is in the hosts files but resolves out to the public DNS server which has the public facing address of smtp.matheson-trigas.com.

I actually saved off the current sendmail.cf and sendmail.mc, copied in new ones from the .rpmnew templates, made a simple change in the mc file for smart_host to point to 10.1.106.87, generated a new sendmail.cf - tios time w/o the error of a bad line and see this is the maillog now (there's no longer callout to the 67 address:

Oct 29 09:15:06 dmzweb01 sendmail[19711]: o9TDF1wx019711: to=root, ctladdr=root (0/0), delay=00:00:05, xdelay=00:00:00, mailer=relay, pri=30828, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (o9TDF6q4019722 Message accepted for delivery)
Oct 29 09:15:06 dmzweb01 sendmail[19723]: o9TDF6q4019722: to=<root@dmzweb01.mathesondirect.com>, ctladdr=<root@dmzweb01.mathesondirect.com> (0/0), delay=00:00:00, xdelay=00:00:00, mailer=local, pri=31379, dsn=2.0.0, stat=Sent
Oct 29 09:20:06 dmzweb01 sendmail[19751]: o9TDK1oM019751: from=root, size=828, class=0, nrcpts=1, msgid=<201010291320.o9TDK1oM019751@dmzweb01.mathesondirect.com>, relay=root@localhost
Oct 29 09:20:06 dmzweb01 sendmail[19765]: o9TDK6jR019765: from=<root@dmzweb01.mathesondirect.com>, size=1131, class=0, nrcpts=1, msgid=<201010291320.o9TDK1oM019751@dmzweb01.mathesondirect.com>, proto=ESMTP, daemon=MTA, relay=localhost.localdomain [127.0.0.1]
Oct 29 09:20:06 dmzweb01 sendmail[19751]: o9TDK1oM019751: to=root, ctladdr=root (0/0), delay=00:00:05, xdelay=00:00:00, mailer=relay, pri=30828, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (o9TDK6jR019765 Message accepted for delivery)
Oct 29 09:20:06 dmzweb01 sendmail[19766]: o9TDK6jR019765: to=<root@dmzweb01.mathesondirect.com>, ctladdr=<root@dmzweb01.mathesondirect.com> (0/0), delay=00:00:00, xdelay=00:00:00, mailer=local, pri=31379, dsn=2.0.0, stat=Sent
Oct 29 09:25:06 dmzweb01 sendmail[19809]: o9TDP1pZ019809: from=root, size=828, class=0, nrcpts=1, msgid=<201010291325.o9TDP1pZ019809@dmzweb01.mathesondirect.com>, relay=root@localhost
Oct 29 09:25:06 dmzweb01 sendmail[19819]: o9TDP6dE019819: from=<root@dmzweb01.mathesondirect.com>, size=1131, class=0, nrcpts=1, msgid=<201010291325.o9TDP1pZ019809@dmzweb01.mathesondirect.com>, proto=ESMTP, daemon=MTA, relay=localhost.localdomain [127.0.0.1]
Oct 29 09:25:06 dmzweb01 sendmail[19809]: o9TDP1pZ019809: to=root, ctladdr=root (0/0), delay=00:00:05, xdelay=00:00:00, mailer=relay, pri=30828, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (o9TDP6dE019819 Message accepted for delivery)
Oct 29 09:25:06 dmzweb01 sendmail[19820]: o9TDP6dE019819: to=<root@dmzweb01.mathesondirect.com>, ctladdr=<root@dmzweb01.mathesondirect.com> (0/0), delay=00:00:00, xdelay=00:00:00, mailer=local, pri=31379, dsn=2.0.0, stat=Sent
 
Old 10-29-2010, 09:28 AM   #5
raymwu
LQ Newbie
 
Registered: Jul 2007
Posts: 3

Original Poster
Rep: Reputation: 0
Here's the log of doing the email by hand. The smtp gateway is not in the DMZ along with this server and I have been assured by the Exchange people that they are set up to accept inbound requests from this box:

root@dmzweb01 ~]# telnet 10.1.106.87 25
Trying 10.1.106.87...
Connected to smtp.matheson-trigas.com (10.1.106.87).
Escape character is '^]'.
220 smtp.matheson-trigas.com Microsoft ESMTP MAIL Service, Version: 6.0.3790.3959 ready at Fri, 29 Oct 2010 10:22:17 -0400
HELO
250 smtp.matheson-trigas.com Hello [206.18.165.79]
mail from: root@dmzweb01.mathesondirect.com
250 2.1.0 root@dmzweb01.mathesondirect.com....Sender OK
rcpt to: rwu@matheson-trigas.com
250 2.1.5 rwu@matheson-trigas.com
data
354 Start mail input; end with <CRLF>.<CRLF>
Test message from telnet
.
250 2.6.0 <EXCHANGE1NV10Bjpvrq00010b6e@smtp.matheson-trigas.com> Queued mail for delivery
 
  


Reply



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
Using Sendmail to relay all mail to my Exchange Server TimothyBoggess Linux - Newbie 8 04-18-2017 07:41 AM
configure sendmail to relay mail to exchange server goldwing Red Hat 3 10-18-2008 04:07 PM
Relay mail to exchange with Sendmail slow keysorsoze Linux - Software 0 07-17-2007 07:00 PM
howto relay sendmail with exchange 2003 ioio Linux - General 1 10-25-2006 11:03 PM
sendmail to relay smtp to exchange inaki Linux - Software 1 04-02-2006 08:36 AM

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

All times are GMT -5. The time now is 12:02 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