Sendmail & SMTP


 
Thread Tools Search this Thread
Operating Systems Solaris Sendmail & SMTP
# 1  
Old 01-09-2007
Sendmail & SMTP

I have searched this forum extensively and can't seem to find a workable solution to my sendmail issue, but that could be down to my own lack of knowledge so please bear with me...

I am using a Sun Solaris 9 box to try and send e-mail to external addresses. The Unix box is not an e-mail server. Our e-mail is done through a third party ISP i.e. POP3 accounts, complete with user names and passwords.

I'm using sendmail version 8.12.2+Sun and I have made a number of changes (rightly or wrongly) to /etc/mail/sendmail.cf & /etc/init.d/sendmail based on details found on www.kempston.net.

The problem I'm having is this.

When I send a mail to my external address the mail is queued, I can see it in mailq, but it never gets sent.

I can telnet onto port 25 and can see sendmail is running.

I can also see send mail running when I us "ps".


root 5392 1 0 12:13:45 ? 0:00 /usr/lib/sendmail -bd -X /var/log/mail.log -oL9
smmsp 5393 1 0 12:13:45 ? 0:00 /usr/lib/sendmail -Ac -q15m


NOTE: I edited /etc/init.d/sendmail to add the "-X /var/log/mail.log" line ...

The changes to the /etc/mail/sendmail.cf are as follows:

! # "Smart" relay host (may be null)
! DSmailhost$?m.$m$.


Changed to read.....

! # "Smart" relay host (may be null)
! DSmail.mailhost.com


Where mail.mailhost.com is the SMTP server.

! # avoid connecting to "expensive" mailers on initial submission?
! O HoldExpensive=False


Changed to read ......

! # avoid connecting to "expensive" mailers on initial submission?
! O HoldExpensive=True


Added in an entry to read ......

- # Don't Use DNS
- O ResolverOptions=-DNSRCH


Also changed line .....

! Mrelay, P=[IPC], F=mDFMuXa8, S=EnvFromSMTP/HdrFromSMTP, R=MasqSMTP, E=\r\n, L=2040,

Added in "e" after "F=".....

! Mrelay, P=[IPC], F=emDFMuXa8, S=EnvFromSMTP/HdrFromSMTP, R=MasqSMTP, E=\r\n, L=2040,


And also added in rule S11 ....

- S11
- R$* $@ me@domain.com


Where me@domain.com is my actual e-mail address .....

I have also edited the /etc/hosts file to include:

xxx.xxx.x.x servername servername.domain loghost

Where the domain part is the text after the @ of my mail address, the IP is local.

And also added

xxx.xx.xx.x mail.mymailhost.com mailhost

Where the mymailhost is the SMTP server and the IP is the primary DNS IP

When I run the following command:

/usr/lib/sendmail -d0.1 -bt < /dev/null

I get the following output ...

# /usr/lib/sendmail -d0.1 -bt < /dev/null
Version 8.12.2+Sun
Compiled with: DNSMAP LDAPMAP LOG MAP_REGEX MATCHGECOS MILTER MIME7TO8 MIME8TO7 NAMED_BIND NDBM NETINET NETINET6 NETUNIX NEWDB NIS NISPLUS PIPELINING SCANF USERDB XDEBUG

============ SYSTEM IDENTITY (after readcf) ============
(short domain name) $w = servername
(canonical domain name) $j = servername.domain
(subdomain name) $m = domain
(node name) $k = servername
========================================================

ADDRESS TEST MODE (ruleset 3 NOT automatically invoked)
Enter <ruleset> <address>



I have been testing this with the following simple script:

# more send_mail

SUBJ="Send mail from Unix with file attachments"
TO=me@domain.com
(
cat << !
To : ${TO}
Subject : ${SUBJ}
!

cat << !
HOPE THIS WORKS
you got the mail from sendmail utility
!

uuencode test.txt test.txt

) | /usr/lib/sendmail -v ${TO} ${CC}
#


Which produces the following output:

me@domain.com... Connecting to localhost via relay...
220 servername.domain ESMTP Sendmail 8.12.2+Sun/8.12.2; Tue, 9 Jan 2007 14:30:09 GMT
>>> EHLO servername.domain
250-servername.domain Hello localhost [xxx.x.x.x], pleased to meet you
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-EXPN
250-VERB
250-8BITMIME
250-SIZE
250-DSN
250-ETRN
250-DELIVERBY
250 HELP
>>> MAIL From:<me@servername.domain> SIZE=194
250 2.1.0 <me@servername.domain>... Sender ok
>>> RCPT To:<me@domain.com>
>>> DATA
250 2.1.5 <me@domain.com>... Recipient ok
354 Enter mail, end with "." on a line by itself
>>> .
250 2.0.0 l09EU9aE007093 Message accepted for delivery
me@comain.com... Sent (l09EU9aE007093 Message accepted for delivery)
Closing connection to localhost
>>> QUIT
221 2.0.0 servername.domain closing connection


The mailq produces the following:

# mailq
/var/spool/mqueue (1 request)
-----Q-ID----- --Size-- -----Q-Time----- ------------Sender/Recipient-----------
l09EU9aE007093 122 Tue Jan 9 14:30 <me@servername.domain>
<me@domain.com>
Total requests: 1
#


The log file /var/log/mail.log looks like this:

# more mail.log

07093 >>> 220 servername.domain ESMTP Sendmail 8.12.2+Sun/8.12.2; Tue, 9 Jan 2007 14:30:
09 GMT
07093 <<< EHLO servername.domain
07093 >>> 250-servername.domain Hello localhost [xxx.x.x.x], pleased to meet you
07093 >>> 250-ENHANCEDSTATUSCODES
07093 >>> 250-PIPELINING
07093 >>> 250-EXPN
07093 >>> 250-VERB
07093 >>> 250-8BITMIME
07093 >>> 250-SIZE
07093 >>> 250-DSN
07093 >>> 250-ETRN
07093 >>> 250-DELIVERBY
07093 >>> 250 HELP
07093 <<< MAIL From:<me@servername.domain> SIZE=194
07093 >>> 250 2.1.0 <me@servername.domain>... Sender ok
07093 <<< RCPT To:<me@domain.com>
07093 >>> 250 2.1.5 <me@domain.com>... Recipient ok
07093 <<< DATA
07093 >>> 354 Enter mail, end with "." on a line by itself
07093 <<< Received: (from root@localhost)
07093 <<< by servername.domain (8.12.2+Sun/8.12.2/Submit) id l09EU9h8007089
07093 <<< for me@domain.com; Tue, 9 Jan 2007 14:30:09 GMT
07093 <<< Date: Tue, 9 Jan 2007 14:30:09 GMT
07093 <<< From: me@servername.domain
07093 <<< Message-Id: <200701091430.l09EU9h8007089@servername.domain>
07093 <<< To: me@domain.com
07093 <<< Subject: Send mail from Unix with file attachments
07093 <<<
07093 <<< HOPE THIS WORKS
07093 <<< you got the mail from sendmail utility
07093 <<< begin 444 test.txt
07093 <<< >5&AI<R!I<R!A('1E<W0@;6%I;"!F<F]M($ME;BX*
07093 <<<
07093 <<< end
07093 <<< .
07093 >>> 250 2.0.0 l09EU9aE007093 Message accepted for delivery
07093 <<< QUIT
07093 >>> 221 2.0.0 servername.domain closing connection


I can see the message in queued in /var/spool/mqueue

So why is it not reaching the destination e-mail account?

What am I missing?
# 2  
Old 01-09-2007
In your post above you stated :
Quote:
Our e-mail is done through a third party ISP i.e. POP3 accounts, complete with user names and passwords.
From what I see, there are no errors, or wrong configs, if I'm wrong, please correct me.
If the above is true, is this mail being sent to another SMTP for outgoing delivery ? If yes, you may check with the ISP. Otherwise i'm out of suggestions...for now...Eventhough you've provided every piece of information that you can obtain.
Idea : can you send mails locally ? like "mail postmaster@your-domain.com" or mailx ?
# 3  
Old 01-09-2007
Thanks for the reply sysgate.

We do not have an e-mail server on site. All mails are handled via an ISP in this case netsource.ie. Mails come in via POP3 and are directed from the PC's to the outside world via SMTP, through a firewall and router. The mail server is mail.netsource.ie.

I'm not interested in taking mail in, I'm trying to send mail out.

Does that make it any easier?

It seems as though I'm missing a vital stage in this thing. It looks like the mails are being generated and queued okay but then hit a brick wall i.e. can't access the outside world.
# 4  
Old 01-09-2007
Actually I've just noticed ...

me@domain.com... Connecting to localhost via relay...

Should that not be connecting to the mailhost?

If so what do I need to change to get it to use the mailhost instead of the localhost?

Cheers...
# 5  
Old 01-10-2007
uh, it really depends....The strangest thing is that you don't receive any errors, so that we can trooubleshoot and give some suggestions...
This "Connecting to localhost via relay" I had fixed with another trick a while ago, with making a symbolic link between "sendmail.cf" and "submit.cf", but the error message was different. In your case I would ask you to check for relevant info in your .mc file : at the bottom there should be two lines :
MAILER(local) and MAILER(smtp). Also you may check in your source files for any obvious errors, and alternatively, try to rebuild the sendmail using macros options. The other thing is the ISP's mail server, can you ask them for more logs ? Did you try other mail recepients where you can verify for sure that your mail is not being received ? Otherwise I'm afraid I'm out of ideas for now, but I'm willing to help with mail issues, knowing my bitter experience when started administering mail servers few years ago.
# 6  
Old 01-10-2007
I's been a long time since I last dealt with sendmail, but I rememeber a couple of things that might help you to "find the path" Smilie
The problem, to me, is either of these:
- Your ISP mail server has to accept that you use it as "relay host", or
- Your ISP mail server needs authentication.
I would try to focus on the second one...
Regads.
# 7  
Old 01-10-2007
Hi Guys,

After much scratching of head I edited the /etc/mail/submit.cf file and changed the default MTA host from localhost to mailhost.

Changed from:

D{MTAHost}localhost

To ....

D{MTAHost}mailhost

I tried my script again and this time while it does appear to be trying to connect to the mailhost it is throwing up some new messages.


me@domain.ie... Connecting to mailhost via relay...
220 gran.netsource.ie ESMTP Spammers are not welcome here! Wed, 10 Jan 2007 11:34:10 +0000
>>> EHLO servername.domain
250-gran.netsource.ie Hello servername.domain [xxx.xx.xx.x]
250-SIZE 62914560
250-PIPELINING
250 HELP
>>> MAIL From:<root@servername.domain> SIZE=194
250 <root@servername.domain> is syntactically correct
>>> RCPT To:<me@domain.ie>
>>> DATA
250 <me@domain.ie> verified
354 Enter message, ending with "." on a line by itself
>>> .
550-Could not verify sender
550 rejected: cannot route to sender <root@servername.domain>
>>> RSET
250 Reset OK
root... Using cached ESMTP connection to mailhost via relay...
>>> MAIL From:<> SIZE=1218
250 <> is syntactically correct
>>> RCPT To:<root@servername.domain>
>>> DATA
550 Cannot route to <root@servername.domain>
503 Valid RCPT TO <recipient> must precede DATA
>>> RSET
250 Reset OK
>>> RSET
250 Reset OK
postmaster... Using cached ESMTP connection to mailhost via relay...
>>> MAIL From:<> SIZE=2242
250 <> is syntactically correct
>>> RCPT To:<postmaster@servername.domain>
>>> DATA
550 Cannot route to <postmaster@servername.domain>
503 Valid RCPT TO <recipient> must precede DATA
>>> RSET
250 Reset OK
Jan 10 11:36:39 servername sendmail[6017]: [ID 801593 mail.alert] l0ABabrN006017: Losing ./qfl0ABabrN006017: savemail panic
Closing connection to mailhost
>>> QUIT
221 gran.netsource.ie closing connection


Any ideas on where to go from here?

Cheers muckers ....
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

Configure sendmail with SMTP

Hello, I'm trying to configure sendmail with SMTP authentication on a SunOS 5.11 operating system. I have been read various documentation / tutorials and unfortunately is not working. I need help from someone who has configured smtp on this operating system. When I try to send a mail, I have... (2 Replies)
Discussion started by: d4rkm4nx99
2 Replies

2. Solaris

How to make smtp:sendmail online from maintenance mode?

Hi Everyone, when i type "svcs -a | grep sendmail" it is giving the below output. $ svcs -a | grep sendmail disabled Nov_05 svc:/network/sendmail-client:default maintenance 10:31:52 svc:/network/smtp:sendmail Can anyone help me that how to bring svc:/network/smtp:sendmail in... (10 Replies)
Discussion started by: Sun4Oracle
10 Replies

3. Red Hat

How to setup Sendmail as SMTP Relay?

Hi Guys, I want to setup sendmail using my username and password on my ISP to be able to send out messages. I'm using Linux. So far, what I've done is modified the sendmail.mc with the following changes: define(`SMART_HOST',`myispsmtpoutgoingserver') FEATURE(authinfo)dnl In my... (0 Replies)
Discussion started by: adshocker
0 Replies

4. UNIX for Dummies Questions & Answers

Can't configure sendmail to send mails to external SMTP Server

Hi all,I know, that this is very common issue, but I can't find where is the problem... I have Solaris 10 installed.I want to send mail to external SMTP server, like:echo "letter body"| mailx -s "subject" test@test.comBut I donno what kind of changes I have to do in /etc/hosts and sendmail.cf or... (5 Replies)
Discussion started by: nypreH
5 Replies

5. Shell Programming and Scripting

Send email from sendmail on AIX using exchange server as SMTP server

i am new in AIX i am trying to write a script to take a backup for specific files on server to and check error log if backup success send email to administrator , script done except for sending mail , i try to configure sendmail on aix to use our exchange server to send emails but still get error... (0 Replies)
Discussion started by: ahmed_salah
0 Replies

6. UNIX for Dummies Questions & Answers

Using Sendmail (& attachment)

Hi, This is my first thread. Iam trying the following: OS: Sun Database: DB2, Informix, Oracle * Get the status of the database (using database command line options) * pipe to a text file * send mail of the text file to receiptents. TODO1: First step i tried to send a test message.... (3 Replies)
Discussion started by: kenkanya
3 Replies

7. UNIX for Dummies Questions & Answers

Sendmail? Mailx? SMTP?

We require e-mails to come from one of our Solaris 10 boxes ASAP and have found that when using such things as Sendmail and Mailx all the mail goes to a Q that only fires every 15 minutes. We have tried everything we could think of to adjust this to force the Q to go every 1 minute but so far no... (3 Replies)
Discussion started by: LRoberts
3 Replies

8. SCO

SCO 5.0.7 Sendmail. Need help on how to configure SMTP

Did anyone know or can provide some instructions on how to setup smtp for sendmail. All I need to do is email files from sco thru my ISP smtp provider. please help (3 Replies)
Discussion started by: miles556
3 Replies

9. Solaris

Enabling sendmail with SMTP

Hi all, I want to send mails through Sendmail using SMTP server, Pls how to set that A.S.A.P. Regards (2 Replies)
Discussion started by: adel8483
2 Replies

10. IP Networking

SMTP with sendmail

Hi, I have a solaris 9 box, and 2 domains A.com and B.net. the machine is on B.net. I am not able to send emails to @A.com using mail or mailx. after reading on sendmail, there was something about relaying and editing the file /etc/mail/relay-domains. Please let me know if this is what i... (1 Reply)
Discussion started by: 0ktalmagik
1 Replies
Login or Register to Ask a Question