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 08-20-2013, 12:46 PM   #1
rtcary
Member
 
Registered: Dec 2004
Location: Petaluma, CA
Distribution: Centos 4 and RH 9
Posts: 83

Rep: Reputation: 15
How to set the DSN for sendmail


I am using Centos 5 on my server and when I try a test of sendmail

echo 'This is a test' | mail -s test-email todd@aristesoftware.com

I get the following lines in maillog:

Aug 20 10:26:14 localhost sendmail[14452]: r7KHQ6Rx014450: to=<todd@aristesoftware.com>, ctladdr=<root@localhost.localdomain> (0/0), delay=00:00:08, xdelay=00:00:08, mailer=esmtp, pri=120369, relay=mailin-02.mx.sonic.net. [69.12.208.76], dsn=5.0.0, stat=Service unavailable

Aug 20 10:26:14 localhost sendmail[14452]: r7KHQ6Rx014450: r7KHQERx014452: DSN: Service unavailable

Aug 20 10:26:14 localhost sendmail[14452]: r7KHQERx014452: to=<root@localhost.localdomain>, delay=00:00:00, xdelay=00:00:00, mailer=local, pri=31627, dsn=2.0.0, stat=Sent

I am not a Linux guru...especially about sendmail. Is there a place in the config file for sendmail where I should enter the IP of server provided by my ISP?

With appreciation...

Todd
 
Old 08-20-2013, 02:04 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by rtcary View Post
ctladdr=<root@localhost.localdomain> (0/0)
Use a domain name that resolves properly on the 'net?
 
Old 08-20-2013, 02:22 PM   #3
YankeePride13
Member
 
Registered: Aug 2012
Distribution: Ubuntu 10.04, CentOS 6.3, Windows 7
Posts: 262

Rep: Reputation: 55
Are you allowed to relay through mailin-02.mx.sonic.net. ?

---------- Post added 08-20-13 at 03:23 PM ----------

Quote:
Originally Posted by unSpawn View Post
Use a domain name that resolves properly on the 'net?
I agree with this also.
 
Old 08-20-2013, 02:43 PM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by YankeePride13 View Post
Are you allowed to relay through mailin-02.mx.sonic.net. ?
BTW you can answer that question yourself if you
Code:
dig mx aristesoftware.com
 
Old 08-21-2013, 01:56 PM   #5
rtcary
Member
 
Registered: Dec 2004
Location: Petaluma, CA
Distribution: Centos 4 and RH 9
Posts: 83

Original Poster
Rep: Reputation: 15
I did some researching on setting up sendmail so that it will relay to my ISP, however my ISP uses port 587 with "Password, transmitted insecurely". I do not believe my setup included the port setting or specified the type of authorization. Is this something simple in either the access file and/or the sendmail.mc file?

Here is my access file setting:

# Check the /usr/share/doc/sendmail/README.cf file for a description
# of the format of this file. (search for access_db in that file)
# The /usr/share/doc/sendmail/README.cf is part of the sendmail-doc
# package.
#
# by default we allow relaying from localhost...
# Connect:localhost.localdomain RELAY
# Connect:localhost RELAY
# Connect:127.0.0.1 RELAY

AuthInfo:mail.sonic.net "U:my_user_name" "P:my_password"

And I just changed this line in sendmail.mc:

dnl #
define(`SMART_HOST', `mail.sonic.net')dnl
dnl #

The maillog gives these lines for my test message:

Aug 21 11:27:16 localhost sendmail[19449]: alias database /etc/aliases rebuilt by todd

Aug 21 11:27:16 localhost sendmail[19449]: /etc/aliases: 76 aliases, longest 10 bytes, 765 bytes total

Aug 21 11:27:16 localhost sendmail[19454]: starting daemon (8.13.8): SMTP+queueing@01:00:00

Aug 21 11:27:16 localhost sm-msp-queue[19463]: starting daemon (8.13.8): queueing@01:00:00

Aug 21 11:27:22 localhost sendmail[19455]: STARTTLS=client, relay=mail.sonic.net., version=TLSv1/SSLv3, verify=FAIL, cipher=DHE-RSA-AES256-SHA, bits=256/256

Aug 21 11:27:22 localhost sendmail[19455]: r7LI2kkd019355: AUTH=client, available mechanisms do not fulfill requirements

Aug 21 11:27:22 localhost sendmail[19455]: AUTH=client, relay=mail.sonic.net., temporary failure, connection abort

Aug 21 11:27:22 localhost sendmail[19455]: r7LI2kkd019355: to=<todd@aristesoftware.com>, ctladdr=<root@localhost.localdomain> (0/0), delay=00:24:36, xdelay=00:00:06, mailer=relay, pri=210367, relay=mail.sonic.net. [64.142.7.162], dsn=4.0.0, stat=Deferred: Temporary AUTH failure

Aug 21 11:27:28 localhost sendmail[19468]: r7LIRRrU019468: from=root, size=64, class=0, nrcpts=1, msgid=<201308211827.r7LIRRrU019468@localhost.localdomain>, relay=root@localhost

Aug 21 11:27:28 localhost sendmail[19469]: r7LIRSFL019469: from=<root@localhost.localdomain>, size=367, class=0, nrcpts=1, msgid=<201308211827.r7LIRRrU019468@localhost.localdomain>, proto=ESMTP, daemon=MTA, relay=localhost.localdomain [127.0.0.1]

Aug 21 11:27:28 localhost sendmail[19468]: r7LIRRrU019468: to=todd@aristesoftware.com, ctladdr=root (0/0), delay=00:00:01, xdelay=00:00:00, mailer=relay, pri=30064, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (r7LIRSFL019469 Message accepted for delivery)

Aug 21 11:27:29 localhost sendmail[19471]: STARTTLS=client, relay=mail.sonic.net., version=TLSv1/SSLv3, verify=FAIL, cipher=DHE-RSA-AES256-SHA, bits=256/256

Aug 21 11:27:29 localhost sendmail[19471]: r7LIRSFL019469: AUTH=client, available mechanisms do not fulfill requirements

Aug 21 11:27:29 localhost sendmail[19471]: AUTH=client, relay=mail.sonic.net., temporary failure, connection abort

Aug 21 11:27:29 localhost sendmail[19471]: r7LIRSFL019469: to=<todd@aristesoftware.com>, ctladdr=<root@localhost.localdomain> (0/0), delay=00:00:01, xdelay=00:00:01, mailer=relay, pri=120367, relay=mail.sonic.net. [64.142.7.162], dsn=4.0.0, stat=Deferred: Temporary AUTH failure
 
Old 08-21-2013, 04:08 PM   #6
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by rtcary View Post
ctladdr=<root@localhost.localdomain> (0/0)
Use a domain name that resolves properly on the 'net?
 
Old 08-21-2013, 05:06 PM   #7
rtcary
Member
 
Registered: Dec 2004
Location: Petaluma, CA
Distribution: Centos 4 and RH 9
Posts: 83

Original Poster
Rep: Reputation: 15
I am not sure what to put into ctladdr=<root@localhost.localdomain>. The address of the sender (me) is

todd@aristesoftware.com

My local server is www.toddcary.com while my domain name on my ISP's server is aristesoftware.com

Needless to say, I am confused about what to change and where.

What parameter in which file should be modified?

Todd
 
Old 08-21-2013, 05:39 PM   #8
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by rtcary View Post
The address of the sender (me) is todd@aristesoftware.com
No, you're not. You're sending email as "root@localhost.localdomain". Your domain name may be toddcary.com or aristesoftware.com but not both as they currently point to separate IP addresses.


Quote:
Originally Posted by rtcary View Post
My local server is www.toddcary.com
When Sendmail (or any MTA) starts up it tries to determine the fully qualified domain (FQDN) name by reading /etc/hosts and your server is known as "localhost" or "localhost.localdomain" in full. What you need is to do is enable the MTA to resolve the IP address b****9.b****e.com resolves to to www.toddcary.com in /etc/hosts.
 
Old 08-21-2013, 06:16 PM   #9
rtcary
Member
 
Registered: Dec 2004
Location: Petaluma, CA
Distribution: Centos 4 and RH 9
Posts: 83

Original Poster
Rep: Reputation: 15
Thank you for your patience. My Centos server has been running for years as a place to test my website development, so outside of doing backups and minor file maintenance, I NEVER have to touch the server (wish I could say that about Windows). Now I am doing some work with Concrete5 that requires sendmail (my mail object in php gets me by otherwise).

So, here is my hosts file:

# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6
127.0.0.1 localhost.localdomain localhost centos5

What line should I add to it? My IP is 216.228.174.9 .

With appreciation...

Todd

P.S. What does the ::1 mean?
 
Old 08-21-2013, 06:22 PM   #10
rtcary
Member
 
Registered: Dec 2004
Location: Petaluma, CA
Distribution: Centos 4 and RH 9
Posts: 83

Original Poster
Rep: Reputation: 15
Just in case these entries in the sendmail.mc could have an adverse effect, here they are

define(`SMART_HOST', `mail.sonic.net')dnl
LOCAL_DOMAIN(`localhost.localdomain')dnl
MASQUERADE_AS(`toddcary.com')dnl
MASQUERADE_DOMAIN(`toddcary.com')dnl
FEATURE(masquerade_entire_domain)dnl
FEATURE(masquerade_envelope)dnl

Todd
 
Old 08-24-2013, 03:15 AM   #11
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Sorry for the late reply.

Quote:
Originally Posted by rtcary View Post
I did some researching on setting up sendmail so that it will relay to my ISP, however my ISP uses port 587 with "Password, transmitted insecurely". I do not believe my setup included the port setting or specified the type of authorization. Is this something simple in either the access file and/or the sendmail.mc file?
SMTP traditionally uses port TCP/25. The MSA uses port TCP/587, see http://en.wikipedia.org/wiki/Mail_submission_agent for a short intro (and reason why your ISP should adhere to RFCs and allow port TCP/25) and /etc/mail/submit.mc for local config (which you never should have to change anyway) and if you would want to verify open ports: 'pgrep sendmail | xargs -iX lsof -Pwlnp 'X' -a -i;'.


Quote:
Originally Posted by rtcary View Post
AuthInfo:mail.sonic.net "U:my_user_name" "P:my_password"
No idea where this should go.


Quote:
Originally Posted by rtcary View Post
And I just changed this line in sendmail.mc
Often restarting Sendmail would be enough but if and when you edit .mc files please ensure the corresponding .cf gets rebuilt.


Quote:
Originally Posted by rtcary View Post
Aug 21 11:27:29 localhost sendmail[19471]: r7LIRSFL019469: to=<todd@aristesoftware.com>, ctladdr=<root@localhost.localdomain> (0/0), delay=00:00:01, xdelay=00:00:01, mailer=relay, pri=120367, relay=mail.sonic.net. [64.142.7.162], dsn=4.0.0, stat=Deferred: Temporary AUTH failure
After fixing your 'root@localdomain' issue this should be the next one to work on.


Quote:
Originally Posted by rtcary View Post
My local server is www.toddcary.com while my domain name on my ISP's server is aristesoftware.com Needless to say, I am confused about what to change and where.
When Sendmail starts up it tries to determine the fully qualified domain (FQDN) name by reading /etc/hosts. If you MASQUERADE_AS(`www.toddcary.com')dnl then add the correct IP + host name entry for www.toddcary.com in /etc/hosts and restart Sendmail.
 
Old 08-24-2013, 11:20 AM   #12
rtcary
Member
 
Registered: Dec 2004
Location: Petaluma, CA
Distribution: Centos 4 and RH 9
Posts: 83

Original Poster
Rep: Reputation: 15
What is the correct syntax for adding "...then add the correct IP + host name entry for www.toddcary.com in /etc/hosts and restart Sendmail." to hosts?

Todd
 
Old 08-24-2013, 12:46 PM   #13
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Just like the rest of the file. One IP address, one or more tabs or spaces, one fully qualified domain name, one or more tabs or spaces, one alias, one return.
Code:
cat -A /etc/hosts
shows "^I" for tabs and displays $ at end of each line.
 
Old 08-24-2013, 03:01 PM   #14
rtcary
Member
 
Registered: Dec 2004
Location: Petaluma, CA
Distribution: Centos 4 and RH 9
Posts: 83

Original Poster
Rep: Reputation: 15
I believe I am missing something in the hosts file syntax:

# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6
127.0.0.1 localhost.localdomain localhost centos5
216.228.174.9 toddcary.com localhost

sendmail log file after restarting sendmail:

https://dl.dropboxusercontent.com/u/..._20130824A.txt
 
Old 08-26-2013, 11:58 PM   #15
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
hosts file looks OK but
Code:
Aug 24 12:47:23 localhost sendmail[2327]: STARTTLS=client, relay=mail.sonic.net., version=TLSv1/SSLv3, verify=FAIL, cipher=DHE-RSA-AES256-SHA, bits=256/256
Aug 24 12:47:23 localhost sendmail[2327]: r7OJlHS4002325: AUTH=client, available mechanisms do not fulfill requirements
Aug 24 12:47:23 localhost sendmail[2327]: AUTH=client, relay=mail.sonic.net., temporary failure, connection abort
points to another type of error. Just a hunch but check if the same happens with sending email as unprivileged user?
 
  


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 error: user unknown dsn=5.1.1 raphael75 Linux - Newbie 5 01-16-2014 12:47 PM
Sendmail dsn=4.0.0, stat=Deferred: Invalid argument error stephen_davies Linux - Software 1 07-03-2009 04:22 AM
sendmail dsn codes tajamari Linux - General 2 09-18-2007 10:34 PM
dsn=5.0.0 sendmail dcexplorer Linux - General 3 11-12-2003 09:06 PM
DSN=5.0.0 Sendmail joseph Linux - General 1 09-03-2003 03:27 AM

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

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