LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 08-18-2005, 04:48 AM   #1
cdhgee
Member
 
Registered: Oct 2003
Location: St Paul, MN
Distribution: Fedora 8, Fedora 9
Posts: 513

Rep: Reputation: 30
Sendmail authentication for SMART_HOST relay


I'm trying to configure sendmail to send e-mail through my ISP's SMTP gateway. I've found the SMART_HOST directive in /etc/mail/sendmail.mc and set it thus:

Code:
dnl # Uncomment and edit the following line if your outgoing mail needs to
dnl # be sent out through an external mail server:
dnl #
define(`SMART_HOST',`smtp.my.isp.com')
This works when I connect when I am actually dialed up to my ISP. However I occasionally dial into work and when I do I can't send e-mails via my ISP's smtp gateway any more because it rejects it.

I believe the problem will be resolved if I can turn on SMTP authentication when sendmail forwards e-mail using the SMART_HOST directive, but I can't see how to do that. Can anyone point me in the right direction?
 
Old 08-18-2005, 02:04 PM   #2
Pete M
Member
 
Registered: Aug 2003
Location: UK
Distribution: Redhat 9 FC 3 SUSE 9.2 SUSE 9.3 Gentoo 2005.0 Debian Sid
Posts: 657

Rep: Reputation: 30
cdhgee

Depends what version of sendmail you are using

Before sendmail-8.12

Add to sendmail.mc
Code:
FEATURE(`authinfo',`hash /etc/mail/auth/client-info')dnl
Create directories and files
Code:
#cd /etc/mail
#mkdir auth
#chmod 700 auth
#cd auth
#touch client-info
Insert into client-info
Code:
AuthInfo:your.isp.net "U:smmsp" "I:user" "P:password"
Use your ISP, leave "U:smmsp" as is, insert your user and password

Then
Code:
# makemap hash client-info < client-info
Set permissions
Code:
# chmod 644 client-info
# chmod 640 client-info.db
Which should look like

Code:
auth# ls -a -l
total 24
drwx------  2 root  root  4096 Aug  5 22:23 .
drwxr-xr-x  4 root  root  4096 Aug  5 22:24 ..
-rw-r--r--  1 root  root    65 Aug  5 22:23 client-info
-rw-r-----  1 smmsp root 12288 Aug  5 22:23 client-info.db
Make sendmail.cf from sendmail.mc, restart sendmail

As of sendmail-8.12 "authinfo" is built into sendmail.cf so all you have to do is add your "AuthInfo" statement to /etc/mail/access

Insert into /etc/mail/access

Code:
AuthInfo:your.isp.net "U:smmsp" "I:user" "P:password"
Use your ISP, leave "U:smmsp" as is, insert your user and password

Then
Code:
# makemap hash /etc/mail/access.db < /etc/mail/access
Restart sendmail

Hope it helps

Pete
 
Old 09-01-2005, 06:58 PM   #3
diven
LQ Newbie
 
Registered: May 2005
Distribution: FC2/FC3
Posts: 9

Rep: Reputation: 0
I'm trying to do something similar. Is it possible to encrypt the password in the /etc/mail/access file? (edit: so that someone browsing the file can't read it)

Sorry major newb!

Last edited by diven; 09-01-2005 at 07:04 PM.
 
Old 09-01-2005, 07:10 PM   #4
tonyfreeman
Member
 
Registered: Sep 2003
Location: Fort worth, TX
Distribution: Debian testing 64bit at home, EL5 32/64bit at work.
Posts: 187

Rep: Reputation: 30
No ... That's why the poster had you (the root user) change the permission on the auth folder to 700

Code:
#chmod 700 auth
This means that the root user has full permission to access this directory and everyone else will be rejected.

-- Tony
 
Old 09-01-2005, 07:22 PM   #5
diven
LQ Newbie
 
Registered: May 2005
Distribution: FC2/FC3
Posts: 9

Rep: Reputation: 0
sorry I was refering to method 2: using sendmail 8.12 or greater. Which doesn't say anything about chmoding the /etc/mail/access file. Since access must be built into a database I suppose I might be able to simply change the password to something else after the database is mapped. But that could cause a problem if someone else maps the database without changing the access file. I guess just chmodding that file is best.

Thanks.
 
Old 09-07-2005, 05:22 PM   #6
diven
LQ Newbie
 
Registered: May 2005
Distribution: FC2/FC3
Posts: 9

Rep: Reputation: 0
Sorry, I'm still having problems.
I'm running sendmail on Fedora Core 2, the version is 8.12.11-4.6 for i386.

I added the line:
Code:
AuthInfo:smtp.domain.com "U:smmsp" "I:user" "P:password"
I've tried using both username and username@domain.com for Identity field. Used username in this example.
I make the access.db map and restart sendmail like so:
Code:
[root@localhost mail]# makemap hash /etc/mail/access.db < /etc/mail/access
[root@localhost mail]# /etc/init.d/sendmail restart
Shutting down sendmail:                                    [  OK  ]
Shutting down sm-client:                                   [  OK  ]
Starting sendmail:                                         [  OK  ]
Starting sm-client:                                        [  OK  ]
Then I tested out sendmail using the following mail command:
Code:
[root@localhost mail]# mail -s "test" recipient@domain.com
this is a test
Cc:
Which resulted in me receiving this returned message:
Code:
From MAILER-DAEMON@localhost.localdomain  Wed Sep  7 14:47:24 2005
Return-Path: <MAILER-DAEMON@localhost.localdomain>
Received: from localhost (localhost)
	by localhost.localdomain (8.12.11/8.12.11) id j87LlOLB006159;
	Wed, 7 Sep 2005 14:47:24 -0700
Date: Wed, 7 Sep 2005 14:47:24 -0700
From: Mail Delivery Subsystem <MAILER-DAEMON@localhost.localdomain>
Message-Id: <200509072147.j87LlOLB006159@localhost.localdomain>
To: <root@localhost.localdomain>
MIME-Version: 1.0
Content-Type: multipart/report; report-type=delivery-status;
	boundary="j87LlOLB006159.1126129644/localhost.localdomain"
Subject: Returned mail: see transcript for details
Auto-Submitted: auto-generated (failure)
Status: RO
Content-Length: 1808
Lines: 49

This is a MIME-encapsulated message

--j87LlOLB006159.1126129644/localhost.localdomain

The original message was received at Wed, 7 Sep 2005 14:47:24 -0700
from localhost.localdomain [127.0.0.1]

   ----- The following addresses had permanent fatal errors -----
<recipient@domain.com>
    (reason: 572 root@localhost.localdomain host name is unknown)

   ----- Transcript of session follows -----
... while talking to mail.server.address.com.:
>>> MAIL From:<root@localhost.localdomain> SIZE=379
<<< 572 root@localhost.localdomain host name is unknown
554 5.0.0 Service unavailable

--j87LlOLB006159.1126129644/localhost.localdomain
Content-Type: message/delivery-status

Reporting-MTA: dns; localhost.localdomain
Received-From-MTA: DNS; localhost.localdomain
Arrival-Date: Wed, 7 Sep 2005 14:47:24 -0700

Final-Recipient: RFC822; recipient@domain.com
Action: failed
Status: 5.0.0
Diagnostic-Code: SMTP; 572 root@localhost.localdomain host name is unknown
Last-Attempt-Date: Wed, 7 Sep 2005 14:47:24 -0700

--j87LlOLB006159.1126129644/localhost.localdomain
Content-Type: message/rfc822

Return-Path: <root@localhost.localdomain>
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
	by localhost.localdomain (8.12.11/8.12.11) with ESMTP id j87LlOLB006157
	for <recipient@domain.com>; Wed, 7 Sep 2005 14:47:24 -0700
Received: (from root@localhost)
	by localhost.localdomain (8.12.11/8.12.11/Submit) id j87LlOWs006156
	for recipient@domain.com; Wed, 7 Sep 2005 14:47:24 -0700
Date: Wed, 7 Sep 2005 14:47:24 -0700
From: root <root@localhost.localdomain>
Message-Id: <200509072147.j87LlOWs006156@localhost.localdomain>
To: recipient@domain.com
Subject: test

this is a test

--j87LlOLB006159.1126129644/localhost.localdomain--
I also thought that perhaps the SMART_HOST line from sendmail.mc had to be changed as the original poster did. (This is actually what I tried first). This method results in no returned message.. but the message doesn't get through either. I have also tried different adding thing for Realm and Mechanism tokens but still get a similar return message. I will try the method listed here http://www.sendmail.org/~ca/email/auth.html#smtpclient which is basically Pete M's method for pre 8.12 with a couple additions to the sendmail.mc file. I will also perhaps try another smtp server I have to see if results are different.

Last edited by diven; 09-07-2005 at 05:31 PM.
 
Old 09-07-2005, 07:18 PM   #7
diven
LQ Newbie
 
Registered: May 2005
Distribution: FC2/FC3
Posts: 9

Rep: Reputation: 0
I get a message back when I use the other smtp server with smart host.

Here is the reply:
Code:
From MAILER-DAEMON@localhost.localdomain  Wed Sep  7 16:12:16 2005
Return-Path: <MAILER-DAEMON@localhost.localdomain>
Received: from localhost (localhost)
	by localhost.localdomain (8.12.11/8.12.11) id j87NCGGb006488;
	Wed, 7 Sep 2005 16:12:16 -0700
Date: Wed, 7 Sep 2005 16:12:16 -0700
From: Mail Delivery Subsystem <MAILER-DAEMON@localhost.localdomain>
Message-Id: <200509072312.j87NCGGb006488@localhost.localdomain>
To: <root@localhost.localdomain>
MIME-Version: 1.0
Content-Type: multipart/report; report-type=delivery-status;
	boundary="j87NCGGb006488.1126134736/localhost.localdomain"
Subject: Returned mail: see transcript for details
Auto-Submitted: auto-generated (failure)
Status: RO
Content-Length: 1767
Lines: 49

This is a MIME-encapsulated message

--j87NCGGb006488.1126134736/localhost.localdomain

The original message was received at Wed, 7 Sep 2005 16:12:16 -0700
from localhost.localdomain [127.0.0.1]

   ----- The following addresses had permanent fatal errors -----
<recipient@domain.com>
    (reason: 553 localhost.localdomain does not exist)

   ----- Transcript of session follows -----
... while talking to smtp.new-domain.net:
>>> MAIL From:<root@localhost.localdomain> SIZE=388
<<< 553 localhost.localdomain does not exist
501 5.6.0 Data format error

--j87NCGGb006488.1126134736/localhost.localdomain
Content-Type: message/delivery-status

Reporting-MTA: dns; localhost.localdomain
Received-From-MTA: DNS; localhost.localdomain
Arrival-Date: Wed, 7 Sep 2005 16:12:16 -0700

Final-Recipient: RFC822; recipient@domain.com
Action: failed
Status: 5.1.3
Diagnostic-Code: SMTP; 553 localhost.localdomain does not exist
Last-Attempt-Date: Wed, 7 Sep 2005 16:12:16 -0700

--j87NCGGb006488.1126134736/localhost.localdomain
Content-Type: message/rfc822

Return-Path: <root@localhost.localdomain>
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
	by localhost.localdomain (8.12.11/8.12.11) with ESMTP id j87NCGGb006486
	for <recipient@domain.com>; Wed, 7 Sep 2005 16:12:16 -0700
Received: (from root@localhost)
	by localhost.localdomain (8.12.11/8.12.11/Submit) id j87NCGoG006485
	for recipient@domain.com; Wed, 7 Sep 2005 16:12:16 -0700
Date: Wed, 7 Sep 2005 16:12:16 -0700
From: root <root@localhost.localdomain>
Message-Id: <200509072312.j87NCGoG006485@localhost.localdomain>
To: recipient@domain.com
Subject: the subject

the message body

--j87NCGGb006488.1126134736/localhost.localdomain--
The ----- Transcript of session follows ----- section differs as the ...while talking to address is now the smtp server instead of the receiving mail server. This actually kind of makes sense. But why am I still being identified as root@localhost.localdomain.
 
Old 05-24-2011, 10:15 AM   #8
gda2004
LQ Newbie
 
Registered: Feb 2010
Posts: 10

Rep: Reputation: 0
Solution ?

Has anyone got a solution that works for this as I am having the very same issue I have done a lot of searching on the net and nothing is comming up. I have looked at the sendmail man pages I came away more confused.

Cheers,

GDA2004
 
  


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
what is the role of SMART_HOST and MAIL_HUB in sendmail? mohit_garg Linux - Software 2 08-28-2005 03:05 PM
Sendmail SMART_HOST + SMTP AUTH Howto SiegeX Slackware 15 09-06-2004 01:42 AM
relay mail to sendmail relay server??? lemay_jeff Linux - Newbie 0 07-06-2004 04:54 PM
using postfix to send through a relay server that requires authentication surban99 Linux - Software 1 04-27-2004 06:16 PM
smart_host configuration in sendmail.mc sln Linux - General 5 12-02-2003 03:36 AM


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration