Operating System - HP-UX
1826214 Members
2609 Online
109691 Solutions
New Discussion

Re: Sending mail through NT mail server

 
Abdullatif M. Abdulla
Frequent Advisor

Sending mail through NT mail server

I have HP 10.20 server and for security reasons I want to send mail through our NT mail server.

Please let me know (detailed) what are the required steps on both servers .

Urgent Urgent please.
19 REPLIES 19
Steven E. Protter
Exalted Contributor

Re: Sending mail through NT mail server

Very few steps.

Edit the sendmail.cf file probably in /etc or /etc/mail

search for DS directive

DS

Change to

DS
[hostname of nt server]

or DS
[ip address of nt server]

save the file

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

done

make sure the NT mail server allows relay from the IP address or hostname of the HP-UX box.

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
Abdullatif M. Abdulla
Frequent Advisor

Re: Sending mail through NT mail server

Thanks SEP

But i am getting an error like the following:
/etc/mail/sendmail.cf: line 106: unknown control line "mailserver"

That is after updating the DS to DSmailserver
Steven E. Protter
Exalted Contributor

Re: Sending mail through NT mail server

Try the IP address of the NT box.

You might get this if there are DNS problems or DNS is not properly configured on the HP box.

/etc/resolv.conf and make sure you can ping.

10.20 is old and you might need a newer sendmail.

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
Hoefnix
Honored Contributor

Re: Sending mail through NT mail server

A small addition on SEP's post:
Puting the IP addres of the mailserver in the /etc/hosts file will probable also do the trick for you.

Regards,
Peter
Donny Jekels
Respected Contributor

Re: Sending mail through NT mail server

while you're at it, aslo add your domain on which your desktop email account lifes.

in most case I have seen the unix boxes is on a domain seperate form your own id.

say your desktop email address is

myuser@company.com

and your unix box sits in a domain say

backend.mycompany.org

then you want mail sent from this unix box to masqurade as a user (this only works for regular users and not root).

modify the DM setting and add your company.com domain name in.

say the dba's want to send a page to their pager from the unix box, but the NT server(mial sever) does not allow any other domain(boxes) to route mail through it, then this is how to fix it.


enjoy.
Donny
"Vision, is the art of seeing the invisible"
Abdullatif M. Abdulla
Frequent Advisor

Re: Sending mail through NT mail server

I have done the updates suggested. and by verifying the /var/adm/syslog/mail.log file i found the following stat queued error, why it happens and what is the solution.

Feb 9 09:04:51 ccbs01 sendmail[25079]: JAA25079: to=abdullatif.abdulla@thuraya.com, delay=00:00:00, mailer=relay, stat=
queued.

Thanks for your help
Hoefnix
Honored Contributor

Re: Sending mail through NT mail server

I think you have to add thuraya.com to your /etc/hosts file.
Just give it a fake IP address will most times do the trick.
Sendmail on HP-UX likes to resolve the domain that its sending mail to.
Add next in /etc/hosts:
1.1.1.1 thuraya.com

Or make thuraya.com resolved by DNS server and your DNS configuration setup correctly on the HP-UX system.
Regards,
Peter
Steven E. Protter
Exalted Contributor

Re: Sending mail through NT mail server

diagnostic

sendmail -v -d8.99 -d 38.99 someone@aol.com

type some text

.


This will get you definitive diagnostics.

You did set up the NT box for relay, did you not?

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
Abdullatif M. Abdulla
Frequent Advisor

Re: Sending mail through NT mail server

This is the out put of the diagnos command and still I am having the same queing problem. every mail i send is qued.

/usr/sbin/sendmail -v -d8.99 -d38.99 abdullatif.abdulla@thuraya.com > mytest
testnig 123
.
t1:/etc/rc.config.d> cat mytest
seq_map_parse(aliases.files, )
map_init(sequence:aliases.files, NULL, 0)
sequence:aliases.files NULL: valid
map_init(implicit:Alias0, /etc/mail/aliases, 0)
impl_map_open(Alias0, /etc/mail/aliases, 0)
hash_map_open(Alias0, /etc/mail/aliases, 0)
impl_map_lookup(Alias0, @)
db_map_lookup(Alias0, @)
implicit:Alias0 /etc/mail/aliases: valid
map_init(host:host, NULL, 0)
host:host NULL: valid
map_init(switch:aliases, aliases, 0)
switch_map_open(aliases, aliases, 0)
switch_map_find => 1
files
map_stack[0] = sequence:aliases.files
switch:aliases aliases: valid
map_init(dequote:dequote, NULL, 0)
dequote:dequote NULL: valid
getcanonname(thuraya.com), trying files
text_getcanonname(thuraya.com)
getcanonname(thuraya.com), trying dns
dns_getcanonname(thuraya.com, trymx=1)
dns_getcanonname: trying thuraya.com. (ANY)
NO: errno=239, h_errno=2
getcanonname(thuraya.com), failed, stat=75
abdullatif.abdulla@thuraya.com... thuraya.com: Name server timeout
abdullatif.abdulla@thuraya.com... Transient parse error -- message queued for future delivery
abdullatif.abdulla@thuraya.com... queued
t1:/etc/rc.config.d>

Thanks for the help you are offering....
Hoefnix
Honored Contributor

Re: Sending mail through NT mail server


abdullatif.abdulla@thuraya.com... thuraya.com: Name server timeout
abdullatif.abdulla@thuraya.com... Transient parse error -- message queued for

It can not resolve the domain name.
As I suggested before, put thuraya.com in your /etc/hosts file(may have a fake IP) or fix the name-resolving to the DNS server.

Regards,
Peter
Steven E. Protter
Exalted Contributor

Re: Sending mail through NT mail server

As i noted, sendmail needs name resolution to work.

The best way is to get the DNS servers in /etc/resolv.conf to work.

The next best way if the mail is internal is to use /etc/hosts

Not that i need them Sir, but perhaps my colleagues could get points for their efforts to help you.

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
Abdullatif M. Abdulla
Frequent Advisor

Re: Sending mail through NT mail server

I put the following in /etc/hosts
192.192.10.10 thuraya.com as a fake IP then
got the following error and the mail is not sent. what is host name lookup failure?


t1:/etc/rc.config.d> cat mytest
seq_map_parse(aliases.files, )
map_init(sequence:aliases.files, NULL, 0)
sequence:aliases.files NULL: valid
map_init(implicit:Alias0, /etc/mail/aliases, 0)
impl_map_open(Alias0, /etc/mail/aliases, 0)
hash_map_open(Alias0, /etc/mail/aliases, 0)
impl_map_lookup(Alias0, @)
db_map_lookup(Alias0, @)
implicit:Alias0 /etc/mail/aliases: valid
map_init(host:host, NULL, 0)
host:host NULL: valid
map_init(switch:aliases, aliases, 0)
switch_map_open(aliases, aliases, 0)
switch_map_find => 1
files
map_stack[0] = sequence:aliases.files
switch:aliases aliases: valid
map_init(dequote:dequote, NULL, 0)
dequote:dequote NULL: valid
getcanonname(thuraya.com), trying files
text_getcanonname(thuraya.com)
getcanonname(thuraya.com), found
getmxrr(mailserver, droplocalhost=1)
getmxrr: res_search(mailserver) failed (errno=239, h_errno=2)
abdullatif.abdulla@thuraya.com... Deferred: Name server: mailserver: host name lookup failure
t1:/etc/rc.config.d>
Hoefnix
Honored Contributor

Re: Sending mail through NT mail server

That means that it could not resolve the IP address for the "mailserver".
Be sure that it is resolved by DNS or put it also in the /etc/hosts file, or put the IP-address in the sendmail.cf file DS

Regards,
Peter
Abdullatif M. Abdulla
Frequent Advisor

Re: Sending mail through NT mail server

What a strange error i am getting to stop the sendmail

t1:/sbin/init.d> /sbin/init.d/sendmail stop
/sbin/init.d/sendmail[114]: Syntax error at line 1 : `(' is not expected.
Hoefnix
Honored Contributor

Re: Sending mail through NT mail server

If it's still the default start/stop script (not editted??) It should contain next line.
(from line 111 - 115)
'stop')
if [ -f /etc/rc.config ] ; then
. /etc/rc.config
else


-leading spaces are deleted by the Forum.

Did you change the start/stop script, or is the error comming from teh file that it's trying to source: /etc/rc.config, did you change this one manual?

Regards,
Peter


Abdullatif M. Abdulla
Frequent Advisor

Re: Sending mail through NT mail server

No i didnt touch those files. even renamed the old one I copied the same /sbin/init.d/sendmail file from another indentical server but still geting the same error.
Abdullatif M. Abdulla
Frequent Advisor

Re: Sending mail through NT mail server

I started the mail using /usr/sbin/sendmail -bd -q30
The mail started and i found the q is empty now. and the mail.log shows stat=send.

But the error is still for the stop and start the sendmail .
Hoefnix
Honored Contributor

Re: Sending mail through NT mail server

Ok it's nice to hear that your mail-config problem is solved.

If you want to solve the stop-script problem you should check the files in the /etc/rc.config.d directory, because they are sourced by the /etc/rc.config
See if you changed files recent in this directory.

Regards,
Peter
Abdullatif M. Abdulla
Frequent Advisor

Re: Sending mail through NT mail server

I have found the error that is if you do the following command under /etc/rc.config.d/:-
usr/sbin/sendmail -v -d8.99 -d38.99 abdullatif.abdulla@thuraya.com > mytest
testnig 123
.

you will end up with the following error when ever you run /sbin/init.d/sendmail stop command:
/sbin/init.d/sendmail[108]: Syntax error at line 1 : `(' is not expected.


When I deleted the file mytest from the rc.config.d directory the start and stop command were succesfull.So take care dont create any thing under this directory.

Thanks for all your help