Sponsored Content
Full Discussion: Sendmail & SMTP
Operating Systems Solaris Sendmail & SMTP Post 302102266 by KenLynch on Tuesday 9th of January 2007 09:45:22 AM
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?
 

10 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

5. 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

6. 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

7. 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

8. 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

9. 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

10. 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
All times are GMT -4. The time now is 05:18 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy