LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-14-2013, 01:25 AM   #1
sachin.davra
Member
 
Registered: Jul 2013
Posts: 213

Rep: Reputation: Disabled
sendmail configuration


Hi,

I wanna configure sendmail in centos 6. I want to enable forward mails to mail relay. how to do it?
 
Old 11-14-2013, 02:29 AM   #2
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,475

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
Look in your sendmail.cf
Look for the lines:
Code:
# "Smart" relay host (may be null)
DS
Put the hostname of your relay host after the DS
If you are using an IP put it in []
Restart sendmail
 
Old 11-14-2013, 03:15 AM   #3
sachin.davra
Member
 
Registered: Jul 2013
Posts: 213

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by TenTenths View Post
Look in your sendmail.cf
Look for the lines:
Code:
# "Smart" relay host (may be null)
DS
Put the hostname of your relay host after the DS
If you are using an IP put it in []
Restart sendmail
sorry, i could not find this option in sendmail.mc
 
Old 11-14-2013, 03:18 AM   #4
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Gurgaon, India
Distribution: Cent OS 6/7
Posts: 4,631

Rep: Reputation: Disabled
He was asking you to look into sendmail.cf though I would like to disagree on changing sendmail.cf manually.
In sendmail.mc file, you should have something like this

Code:
define(`SMART_HOST', `[RELAY_HOST_IP]')dnl
You will need to generate a new sendmail.cf using m4 macro and restart the service for changes to take effect.
 
Old 11-14-2013, 03:27 AM   #5
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,475

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
Quote:
Originally Posted by linuxlover.chaitanya View Post
He was asking you to look into sendmail.cf though I would like to disagree on changing sendmail.cf manually.
I must be "old-school", I've never bothered with sendmail.mc You're prefectly right though, your method does make more sense.
 
Old 11-14-2013, 03:28 AM   #6
sachin.davra
Member
 
Registered: Jul 2013
Posts: 213

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by linuxlover.chaitanya View Post
He was asking you to look into sendmail.cf though I would like to disagree on changing sendmail.cf manually.
In sendmail.mc file, you should have something like this

Code:
define(`SMART_HOST', `[RELAY_HOST_IP]')dnl
You will need to generate a new sendmail.cf using m4 macro and restart the service for changes to take effect.
Thnx for quick reply.

i have done it but still not able to send mail.
 
Old 11-14-2013, 03:31 AM   #7
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Quote:
Originally Posted by sachin.davra View Post
Thnx for quick reply.

i have done it but still not able to send mail.
As stated in the other thread about this: You need to set up both side to make it work.
 
Old 11-14-2013, 03:34 AM   #8
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian sid
Posts: 2,683

Rep: Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783
have you restarted the sendmail service?

how are you testing it?
 
Old 11-14-2013, 03:38 AM   #9
sachin.davra
Member
 
Registered: Jul 2013
Posts: 213

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Firerat View Post
have you restarted the sendmail service?

how are you testing it?
Yes i have restarted the service after generating new sendmail.cf

for sending mail using mailx, i have configured sendmail.
installed sendmail and then define('SMART_HOST', '192.168.0.X')dnl
and
dnl # DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl

Please tell me if i have to change something else also.
 
Old 11-14-2013, 04:40 AM   #10
sachin.davra
Member
 
Registered: Jul 2013
Posts: 213

Original Poster
Rep: Reputation: Disabled
Below are the logs if i am trying to send mail using mailx. when i have configured sendmail in one system.
note:- i am using only one system to configure sendmail and sending the mail. mail relay is configured in remote host and i have done the entry in my sendmail.mc
define('SMART_HOST', '192.168.0.125')dnl

Please suggest something to work around this.

Nov 14 16:02:54 GAIDL-5001 sendmail[16907]: rAEAWs7v016907: from=root, size=1099, class=0, nrcpts=1, msgid=<201311141032.rAEAWs7v016907@GAIDL-5001.gai.net>, relay=root@localhost
Nov 14 16:02:54 GAIDL-5001 postfix/smtpd[16908]: connect from localhost[127.0.0.1]
Nov 14 16:02:54 GAIDL-5001 postfix/smtpd[16908]: C97FE1A05AF: client=localhost[127.0.0.1]
Nov 14 16:02:54 GAIDL-5001 postfix/cleanup[16911]: C97FE1A05AF: message-id=<201311141032.rAEAWs7v016907@GAIDL-5001.gai.net>
Nov 14 16:02:54 GAIDL-5001 postfix/qmgr[2614]: C97FE1A05AF: from=<root@GAIDL-5001.gai.net>, size=1578, nrcpt=1 (queue active)
Nov 14 16:02:54 GAIDL-5001 sendmail[16907]: rAEAWs7v016907: to=sachin.davra@gmail.com, ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=31099, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (Ok: queued as C97FE1A05AF)
Nov 14 16:02:54 GAIDL-5001 postfix/smtpd[16908]: disconnect from localhost[127.0.0.1]
Nov 14 16:02:56 GAIDL-5001 postfix/smtp[16912]: connect to gmail-smtp-in.l.google.com[2a00:1450:4008:c01::1b]:25: Network is unreachable
Nov 14 16:02:56 GAIDL-5001 postfix/smtp[16912]: connect to gmail-smtp-in.l.google.com[74.125.129.27]:25: Connection refused
Nov 14 16:02:56 GAIDL-5001 postfix/smtp[16912]: connect to alt1.gmail-smtp-in.l.google.com[2a00:1450:4008:c01::1b]:25: Network is unreachable
Nov 14 16:02:56 GAIDL-5001 postfix/smtp[16912]: connect to alt1.gmail-smtp-in.l.google.com[74.125.142.27]:25: Connection refused
Nov 14 16:02:56 GAIDL-5001 postfix/smtp[16912]: connect to alt2.gmail-smtp-in.l.google.com[2607:f8b0:4002:c01::1a]:25: Network is unreachable
Nov 14 16:02:56 GAIDL-5001 postfix/smtp[16912]: C97FE1A05AF: to=<sachin.davra@gmail.com>, relay=none, delay=1.3, delays=0.08/0/1.3/0, dsn=4.4.1, status=deferred (connect to alt2.gmail-smtp-in.l.google.com[2607:f8b0:4002:c01::1a]:25: Network is unreachable)
 
Old 11-14-2013, 04:54 AM   #11
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Gurgaon, India
Distribution: Cent OS 6/7
Posts: 4,631

Rep: Reputation: Disabled
Please check the last line in the logs. It says network is unreachable.
 
Old 11-14-2013, 04:54 AM   #12
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,475

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
Quote:
Originally Posted by sachin.davra View Post
i have done the entry in my sendmail.mc
define('SMART_HOST', '192.168.0.125')dnl
Did you re-build the sendmail.cf? Check in the sendmail.cf file and look for the DS line and ensure it has your relay host details.
 
Old 11-14-2013, 06:01 AM   #13
sachin.davra
Member
 
Registered: Jul 2013
Posts: 213

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by TenTenths View Post
Did you re-build the sendmail.cf? Check in the sendmail.cf file and look for the DS line and ensure it has your relay host details.
i checked my sendmail.cf but DS line has no ip or host name then i write ip address of relay host and restarted the service. but still i am getting same error. may be i am doing some less work to get it worked. if you need some more logs plz tell me i will provide it.
 
Old 11-14-2013, 06:18 AM   #14
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,475

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
Post the line that begins
Code:
DS
from your sendmail.cf
 
Old 11-14-2013, 07:03 AM   #15
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
I just noticed this:
Quote:
ov 14 16:02:54 GAIDL-5001 sendmail[16907]: rAEAWs7v016907: from=root, size=1099, class=0, nrcpts=1, msgid=<201311141032.rAEAWs7v016907@GAIDL-5001.gai.net>, relay=root@localhost
Nov 14 16:02:54 GAIDL-5001 postfix/smtpd[16908]: connect from localhost[127.0.0.1]
Nov 14 16:02:54 GAIDL-5001 postfix/smtpd[16908]: C97FE1A05AF: client=localhost[127.0.0.1]
.
.
.
Which MTA are you actually using?

I do believe that CentOS 6, like RHEL 6, uses postfix as the default MTA.
 
  


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
Sendmail M4 configuration base directory /usr/share/sendmail-cf was not found eliassal Linux - Server 15 11-04-2010 01:09 AM
Sendmail Configuration Linuxadmn Linux - Newbie 1 11-26-2007 09:14 PM
Sendmail configuration JailBreak Linux - Networking 2 09-05-2007 08:48 AM
Sendmail Configuration arshad Red Hat 3 12-14-2003 12:11 AM
Sendmail Configuration TheDude074 Linux - General 1 08-07-2003 08:41 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:57 PM.

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