1834133 Members
1778 Online
110064 Solutions
New Discussion

Sendmail

 
SOLVED
Go to solution
Klaus Page
New Member

Sendmail

What changes need to be made to the "sendmail.cf" file to achieve sending of mail & SMS messages ?
Operating System : HP-UX B.11.23 U on an RX5670
No using DNS and all entries in the "etc/hosts" file are FQDN. Ex.

172.16.1.xxx jhb-misp.bankserv.co.za jhb-misp
172.16.1.xxx mailserver.bankserv.co.za mailserver

Kind regards
Klaus
6 REPLIES 6
Cesare Salvioni
Trusted Contributor

Re: Sendmail

If u connect directly internet from ur unix box you MUST configure DNS client (create the file /etc/resolv.conf) to send email.

If your unix host has to use a mail relay to get out, the simplest, usually enough, method is to define the DS (smart relay) macro in sendmail.cf. You should have a line with
DS
change it in
DSmailrelay.domain
where mailrelay.domain is the FQDN of your mail relay as seen from your side.
The stop/start sendmail to let it reread the config file.

This mail relay must accept SMTP connection from your host and must accept relaying. To check if the mail relay is working try

telnet mailrelay.domain 25
.... answer from mail relay .....
helo
mail from: root@
rcpt to: @
data
mail test from unix
.

mail server should answer something like mail sent. If this work you can try with a normal mail client like

mailx -s "subject" @
mail test from unix
.

To check if this has work look at /var/adm/syslog/mail.log
you should see a couple of lines stating the mail has been accepted locally and sent to the relay and accepted
Steven E. Protter
Exalted Contributor

Re: Sendmail

Once you have made your chanes, additional testing tools.

sendmail -v -d8.99 -d38.99 someone@your.net
type some text

.


Any config errors will be apparent.



mailq

Shows you any outbound mail that has not made it off your box.

sendmail -v -q

Verbose attempt to push the sendmail queue off the box. This will help you find issues.

I can't emphasize enough if the box you point your DS directive to does not accept relay, you will have a very frustrating time. That should be done and if possible verified prior to playing with the HP box.

The good news is most smtp software lets you allow relay by IP address so no matter what the admin says, its not a spam relay risk.

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
Klaus Page
New Member

Re: Sendmail

Hello Cesare,

The DS parameter has been changed in the "sendmail.cf" file. Also, telnetting works until u key the command "mail from..". It generates a "Syntax error".

Hello Steven,

Tried your suggestion of sendmail -v -d...etc. See the attached 'sendmail -v" file.

Thanks so far.
Klaus

NB. Telnetting and sendmail -v from a SCO Unixware platform works 100%
Klaus Page
New Member

Re: Sendmail

Hi Cesare,
See the attached portion of the "mail.log" file. I am getting "transient parse" errors.

Regards,
Klaus


Cesare Salvioni
Trusted Contributor
Solution

Re: Sendmail

I'm not sure, but it looks like ur sendmail is not resolving relay mail server.
First check you have the right resolution for mailserv.bankserv.... in /et/host.
Next edit /etc/nsswitch.conf (if you don't have it copy /etc/nsswitch.files or one example there) and change the line
host: files
(check the other lines if you copied it from a template)
also check the nsswitch.conf in /etc/mail (i'm not sure but in HP it could be that sendmail uses this one for resolving order)

There is also a ultimate test you can do, set DS macro to the IP address, instead hostname. To use IP you must surround it with [] like
DS[192.168.2.1]

Anyway connecting directly on port 25 must work, what kind of message do u have exactly from mailserver? Can u capture input and output from telnet host 25 and post it?


hope it helps
Klaus Page
New Member

Re: Sendmail

Hi Cesare,

That did the trick. Copying the "nsswitch.file" as "nsswitch.conf" resolved the mail relay issue.

Thanks a million.

The problem I had with telnetting is related to the terminal emulator that i am using. It does not accept the "@" ie. klausp@...........when key-ing it in. Initially i used the "!" and "%" and when i got a succesful response i used a script, and it works fine.
Kind regards
Klaus