LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 01-06-2010, 01:36 PM   #1
seabro
LQ Newbie
 
Registered: Jan 2010
Posts: 26

Rep: Reputation: 0
configuring sendmail question


hi,

I want to edit my sendmail.mc so that mail is sent via a smarthost.

I know I must uncomment/change the line

dnl #define(`SMART_HOST',`mail.isp.com')dnl

but the server I wish to use requires me to authenticate.

Is this possible? Where would I put the credentials?

Thanks

seabro
 
Old 01-06-2010, 02:49 PM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,636

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by seabro View Post
hi,
I want to edit my sendmail.mc so that mail is sent via a smarthost.

I know I must uncomment/change the line
dnl #define(`SMART_HOST',`mail.isp.com')dnl
but the server I wish to use requires me to authenticate.

Is this possible? Where would I put the credentials?
Very possible, lots on Google related to this, too.

First, set your authorization informations by adding following line to /etc/mail/access file:
Code:
AuthInfo:my.mailrelay.com "U:USERNAME" "P:PASSWORD" "M:PLAIN"
Obviously, replace USERNAME and PASSWORD with the right values. Set the mail host name accordingly, too.

Then, add the following lines to /etc/mail/sendmail.mc, if they're not there already. You've mentioned the smart_host line already.
Code:
define(`SMART_HOST', `my.mailrelay.com')  
FEATURE(`access_db')
If you don't enable the access_db feature, it WON'T WORK. Update the sendmail.mc file, and restart sendmail. Check out sendmail config docs, to change the authentication method. Here, it's Method:PLAIN (for clear text), but there are other values it can take.
 
1 members found this post helpful.
Old 01-07-2010, 06:08 AM   #3
seabro
LQ Newbie
 
Registered: Jan 2010
Posts: 26

Original Poster
Rep: Reputation: 0
Hey TB0ne,

Thanks very much for the reponse.

I have a small problem.

I implemented the changes suggested in /etc/mail/access then I looked at /etc/mail/sendmail.mc and I saw:

dnl #
FEATURE(local_procmail,`',`procmail -t -Y -a $h -d $u')dnl
FEATURE(`access_db',`hash -T<TMPF> -o /etc/mail/access.db')dnl
FEATURE(`blacklist_recipients')dnl
EXPOSED_USER(`root')dnl
dnl #


So I did:

m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf

then

service sendmail restart.

I tried sending a mail from the command line then I checked /var/log/maillog and I see:

Jan 7 11:59:24 [213 sendmail[18683]: o07BxO5M018683: to=xx@xxx.com, ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30060, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (o07BxORC018684 Message accepted for delivery)
Jan 7 11:59:44 [213 sendmail[18686]: o07BxORC018684: to=<xx@xxx.com>, ctladdr=<root@213.xxx.xxx.188> (0/0), delay=00:00:20, xdelay=00:00:20, mailer=esmtp, pri=120333, relay=mx0.123-reg.co.uk. [194.154.164.157], dsn=5.0.0, stat=Service unavailable
Jan 7 11:59:44 [213 sendmail[18686]: o07BxORC018684: o07BxiRC018686: DSN: Service unavailable

(and the email did not arrive).

So I went ahead and added:

FEATURE(`access_db')

right below the existing:
dnl define(`SMART_HOST',`mail.authsmtp.com')dnl

then I:

m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
service sendmail restart

and tried again unsuccessfully.


If I am not mistaken, I thought I should see evidence of use of smart host in the log file? but I am not.

Your help is appreciated.

Seabro
 
Old 01-07-2010, 01:05 PM   #4
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,636

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by seabro View Post
Hey TB0ne,

Thanks very much for the reponse.

I have a small problem.

I implemented the changes suggested in /etc/mail/access then I looked at /etc/mail/sendmail.mc and I saw:
Whoops...I don't think I mentioned the part where you have to generate a new access.db file. My bad:
Code:
makemap hash /etc/mail/access.db < /etc/mail/access
Then restart Sendmail, and give it another shot.
 
1 members found this post helpful.
Old 01-07-2010, 01:31 PM   #5
seabro
LQ Newbie
 
Registered: Jan 2010
Posts: 26

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by TB0ne View Post
Whoops...I don't think I mentioned the part where you have to generate a new access.db file. My bad:
Code:
makemap hash /etc/mail/access.db < /etc/mail/access
Then restart Sendmail, and give it another shot.
Thanks TBOne, I will give it a try.
 
  


Reply

Tags
sendmail, smarthost



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
configuring sendmail manoj.linux Linux - Enterprise 3 06-16-2008 05:40 AM
configuring sendmail.. piyushiitk Linux - Newbie 2 08-20-2005 10:40 AM
need help configuring sendmail blish_blash Linux - Software 0 10-29-2004 07:38 AM
help with configuring sendmail bluestorm Linux - General 5 12-05-2003 10:30 AM
configuring sendmail rameshks Linux - General 3 05-20-2001 02:56 AM

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

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