Operating System - HP-UX
1832777 Members
3395 Online
110045 Solutions
New Discussion

Re: sendmail not sending external mails

 
Alex Almaraz
Regular Advisor

sendmail not sending external mails

I'm working with B.11.11 U 9000/899, and I can not send external mail, someone know how to set this property? (The proper configuration to send external mail)

Currently I have the sendmail.cf with the DS macro already configured and I am able to receive internal mail.

Best regards
22 REPLIES 22
Rick Garland
Honored Contributor

Re: sendmail not sending external mails

Look in /var/adm/syslog/mail.log

What are some of the error messages?
Rick Garland
Honored Contributor

Re: sendmail not sending external mails

Also do the /usr/bin/mailq command. There will be some clues in that output as well.
mirco_1
Valued Contributor

Re: sendmail not sending external mails

hy,

the DNS is correct configured?

DM.
Cesare Salvioni
Trusted Contributor

Re: sendmail not sending external mails

Try
echo "TEST MAIL" | sendmail -v test.emal@address.out

see the output and the lines added to /var/adm/syslog/mail.log

if you still don't understan the problem post to the forum these outputs

hope it can helps
Sheriff Andy
Trusted Contributor

Re: sendmail not sending external mails

Is there something wrong with the sendmail process?

try the following;
# sendmail -q

This will force send from queue.

Andy
Bejoy C Alias
Respected Contributor

Re: sendmail not sending external mails

Is this working previously OR u want to setup a new mail server to send external mails ? Pls explain ur setup so we can give u a better solution.
If u are having a relay server which is connected to the outside world , then u need to set the DS macro in sendmail.cf to that relay server and that machine name should be resolvable . If ur machine is directly connected to the internet and u want to send the mails directly to the outside world , then ur machine should have dns configured and the DS macro should be empty .
Be Always Joy ......
Alex Almaraz
Regular Advisor

Re: sendmail not sending external mails

Thanks guys,

# mailx -s Test2 russian@hotmail.com (As root, becoming root from aalmaraz by switching user "su - ")

Here are some lines from mail.log

Aug 9 08:00:25 troll sendmail[8747]: IAA08747: from=aalmaraz, size=145, class=0, pri=30145, nrcpts=1, msgid=<200508091300.IAA08747@troll.tqmx.com>, relay=root@localhost
Aug 9 08:00:25 troll sendmail[8749]: IAA08747: to=russian@hotmail.com, ctladdr=aalmaraz (1000/4), delay=00:00:00, xdelay=00:00:00, mailer=relay, relay=srvmail.tqmx.com. [10.100.1.33], stat=User unknown
Aug 9 08:00:25 troll sendmail[8749]: IAA08747: forward /home/aalmaraz/.forward.troll+: World writable directory
Aug 9 08:00:25 troll sendmail[8749]: IAA08747: forward /home/aalmaraz/.forward+: World writable directory
Aug 9 08:00:25 troll sendmail[8749]: IAA08747: forward /home/aalmaraz/.forward.troll: World writable directory
Aug 9 08:00:25 troll sendmail[8749]: IAA08747: forward /home/aalmaraz/.forward: World writable directory
Aug 9 08:00:25 troll sendmail[8749]: IAA08747: IAA08749: DSN: User unknown
Aug 9 08:00:25 troll sendmail[8749]: IAA08749: to=aalmaraz, delay=00:00:00, xdelay=00:00:00, mailer=local, stat=Sent


# mailq
Mail queue is empty
#

Formerly it was working, but since I changed to the new mail server (srvmail.tqmx.com)I have the problemes.

Hoping your help ...


Rick Garland
Honored Contributor

Re: sendmail not sending external mails

Seems as if the problem may be with the new mail server. Note the line from the mail.log

relay=srvmail.tqmx.com. [10.100.1.33], stat=User unknown

Are you sure that the new mail server is setup correctly?

If you have the DS directive set to the mail server and the mail goes to that server, this is all you do. The mail server does the actual routing and resolving of the mail.

Alex Almaraz
Regular Advisor

Re: sendmail not sending external mails


The other commands:

# sendmail -q
#

Nothing


The other test:

# echo "TEST MAIL" | sendmail -v ruso@hotmail.com
ruso@hotmail.com... Connecting to srvmail.tqmx.com. via relay...
220 SRVMAIL.cyoptics.com Microsoft ESMTP MAIL Service, Version: 6.0.3790.0 ready at Tue, 9 Aug 2005 08:18:25 -0500
>>> EHLO troll.tqmx.com
250-SRVMAIL.cyoptics.com Hello [10.100.1.27]
250-TURN
250-SIZE
250-ETRN
250-PIPELINING
250-DSN
250-ENHANCEDSTATUSCODES
250-8bitmime
250-BINARYMIME
250-CHUNKING
250-VRFY
250-X-EXPS GSSAPI NTLM LOGIN
250-X-EXPS=LOGIN
250-AUTH GSSAPI NTLM LOGIN
250-AUTH=LOGIN
250-X-LINK2STATE
250-XEXCH50
250 OK
>>> MAIL From: SIZE=10
250 2.1.0 aalmaraz@srvdns.tqmx.com....Sender OK
>>> RCPT To:
550 5.7.1 Unable to relay for ruso@hotmail.com
ruso@hotmail.com... User unknown
>>> RSET
250 2.0.0 Resetting
aalmaraz... forward: /home/aalmaraz/.forward.troll+: World writable director y
aalmaraz... forward: /home/aalmaraz/.forward+: World writable directory
aalmaraz... forward: /home/aalmaraz/.forward.troll: World writable directory
aalmaraz... forward: /home/aalmaraz/.forward: World writable directory
/home/aalmaraz/dead.letter... Saved message in /home/aalmaraz/dead.letter
Closing connection to srvmail.tqmx.com.
>>> QUIT
221 2.0.0 SRVMAIL.cyoptics.com Service closing transmission channel


The last:

the DNS is correct configured?

DM

-- Not formerly, but I changed after your recommendation but still not working.

Regards
Alex Almaraz
Regular Advisor

Re: sendmail not sending external mails

Bejoy,

After leaving the DS macro empty, I am able to send mail to internet.

But, my necessities are to be able to send internal and external mail, have you an idea how to make this?

somebody?

Regards
Rick Garland
Honored Contributor

Re: sendmail not sending external mails

The mail server srvmail.tqmx.com
needs additional configuration. What kind of box is it?



Alex Almaraz
Regular Advisor

Re: sendmail not sending external mails

it's and old server, it's a K class
Rick Garland
Honored Contributor

Re: sendmail not sending external mails

Fix the world writable dirs
Steven E. Protter
Exalted Contributor

Re: sendmail not sending external mails

Your relay server is not properly relaying mail to the Internet.

This conclusion is based on the fact that when you take the DS directive out of your server, you can get mail to the Internet.

That also means that you have adequate access and DNS service to the Internet to send mail.

If you need to relay you need to make sure the relay server will accept and relay the mail. Based on other parts of this post, specifically that the mail queue is empty.

The problem with relaying mail appears not to be on this server.

550 5.7.1 Unable to relay for ruso@hotmail.com
ruso@hotmail.com... User unknown

BTW means that ruso@hotmail.com is not a known user. This does not remind me of the response I get when I get a bounce from hotmail so it appears the relay server may have problems resolving hostnames.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Cem Tugrul
Esteemed Contributor

Re: sendmail not sending external mails

How about these steps?

1- go to /etc/nsswitch.conf
and put these lines;

hosts: files
aliases: files

2-move /etc/resolv.conf as /etc/resolv.conf_org
(means no DNS)

3-add /etc/hosts file your mail server address

4-go to /etc/mail/sendmail.cf
and find a line like DS then change it like;
DSmailserver_name

5-Finally;
/sbin/init.d/sendmail stop
/sbin/init.d/sendmail start

Does it work?


Our greatest duty in this life is to help others. And please, if you can't
Alex Almaraz
Regular Advisor

Re: sendmail not sending external mails

Cem,
After the test you gave me, only internal mail works.

Rick Garland
Honored Contributor

Re: sendmail not sending external mails

You are working with an old K class. What version of the OS? What version of sendmail do you have?

A very good resource for sendmail issues is www.sendmail.org You can get updates,
patches, and the latest versions of sendmail.

Initial steps would be to fix the world writable directories, get the mail server able to resolve external address (DNS), then have your client point to the 'SMART HOST' by using the DS directive in the sendmail.cf file.

On the mail server, get you resolve external address? Example, what is output of 'nslookup hotmail.com'?

Do the # echo "TEST MAIL" | sendmail -v ruso@hotmail.com but do not send to ruso. We already know this user does not exist at hotmail.

You can quickly, easily, and free setup an external email account to do the testing.



Alex Almaraz
Regular Advisor

Re: sendmail not sending external mails

Hi all,

The problem was solved, I leave the DS macro empty and added another dns in the /etc/resolv.conf (because the email server was on another DNS). The formward also was failing (/home/user/.forward) but, I changed the file permissions and folder to 755 and the issue was solved.

Rick,

The ruso@hotmail.com was just a sample, since I thougth a malicious person (not of this forum) could use it to spam.

Thanks so much all

Alex Almaraz
Regular Advisor

Re: sendmail not sending external mails

Hi all,

The problem was solved, I leave the DS macro empty and added another dns in the /etc/resolv.conf (because the email server was on another DNS). The formward also was failing (/home/user/.forward) but, I changed the file permissions and folder to 755 and the issue was solved.

Thanks so much all
Basheer_2
Trusted Contributor

Re: sendmail not sending external mails

Hi Alex

I have the same problem.
works internal, Does NOT work external.

if you dont mind, pl can you share all the steps needed to configure this.

Thanks
Basheer
Alex Almaraz
Regular Advisor

Re: sendmail not sending external mails

Hi Basheer,

Here are the steps I followed:

1.Add another DNS to the /etc/resolv.conf (Since I are managing 3 domains for this server, the one I added was regarding to the SMTP server)

2. I left the sendmail DS macro empty (/etc/mail/sendmail.cf)

3. For the problems with the forwards, I changed the permissions of the user home folders:

e.g.
/home/user

#chmod 755 /home/user
#chmod 755 /home/user/.forward (you can try for this)

4. You must have enable the DNS in your /etc/nsswitch.conf:
e.g.
hosts: files [NOTFOUND=continue] dns

5. Send a HUP signal to sendmail

#ps -ef | grep sendmail
#kill -HUP PID

or

#/sbin/init.d/sendmail stop
#/sbin/init.d/sendmail start

6. Ready

Hope this helps