Operating System - HP-UX
1822826 Members
4613 Online
109645 Solutions
New Discussion юеВ

Re: Sending mail to MS Exchange

 
Alexander Laing
Advisor

Sending mail to MS Exchange

does anyone know how to send mail to MS Exchange from HPUX? On our LAN there are no SMTP servers I think all Exchange mail is transferred usin X.400?
10 REPLIES 10
Steven E. Protter
Exalted Contributor

Re: Sending mail to MS Exchange

sendmail will have no trouble talking to an exchange server so long as its configured to relay your mail. That is not so easily fine tuned on the exchange server, especially Exchange 5.5

vi /etc/mail/sendmail.cf

Find the DS directive

Change it from:

DS

To

DS
[IP_address_of_exchange_server]

I use the IP addy because I don't like to rely on DNS being up to get my mail off the box.

save the file

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

Test for reject/accept with:

sendmail -v -d8.99 -d38.99 someone@yourdomain.com

Type some text

.


You will see whether the handoff works the way it should.

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
Michael Tully
Honored Contributor

Re: Sending mail to MS Exchange

I disagree with SEP in regards to the IP address issue.

I would be placing the name in /etc/mail/sendmail.cf file as follows e.g.

DSmailsrv1

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

Make sure that the IP address is resolved in your local host file. (We have a copy of the master hosts file from DNS as our local /etc/hosts file anyway.
Anyone for a Mutiny ?
Fragon
Trusted Contributor

Re: Sending mail to MS Exchange

Hi,
If you use /etc/hosts as name service, it's a little complex! For example, you want to send a mail to abc@xyz.com through MS Exchange server(exmailsrv/192.168.1.100) from HP-UX.

1. You may first modify /etc/hosts, add an entry:
192.168.1.100 exmailsrv xyz.com
2. Modify /etc/mail/sendmail.cf:
DSexmailsrv
3. Restart the sendmail daemon:
# /sbin/init.d/sendmail stop
# /sbin/init.d/sendmail start

Now you can send mail to @xyz.com through the MS exchange server! Please pay attention to the first step.

-ux
Dave La Mar
Honored Contributor

Re: Sending mail to MS Exchange

Alex -
You have your answer in the above replies. Let me add my .02 in using a DNS instead of the ip address. Our lan group, nearly routinely, change ip addresses. At least in our environment, it makes sense to use name instead of IP. SEP's environment may be more rigid in this respect which makes his use, and argument to the fact, of ip address valid. If you have a DNS server that is "always" up then by name would be my choice.

Regards,

dl
"I'm not dumb. I just have a command of thoroughly useless information."
Kevin Wright
Honored Contributor

Re: Sending mail to MS Exchange

In addition to configuring your HP server to use DS, you need to add the hpux hostname to the MS exchange server configuration to relay.

BTW, always use the hostname, that's what DNS is for, if the IP of the xchange server changed, I wouldn't want to modify and test 50+ sendmail.cf files.
Brian Hackley
Honored Contributor

Re: Sending mail to MS Exchange

Folks,

Adding a sendmail tip for any situation:

Always save /etc/mail/sendmail.cf before modifying it, and start with a fresh copy from /usr/newconfig/etc/mail/sendmail.cf

The sendmail.cf file template provided by HP is subject to change between patch releases and sendmail version updates.

For those folks who gen_cf to create a more customized sendmail.cf file use the procedures documented in various ITRC docs, including KBRC00003597 and KBRC00011706 will create a freshly minted /etc/mail/sendmail.cf file with the latest updates.

HTH,
-> Brian Hackley
Ask me about telecommuting!
Alexander Laing
Advisor

Re: Sending mail to MS Exchange

I tried your suggestions but it still did not work the following output shows the result from sendmail.

************************************
# sendmail -v -d8.99 -d38.99 laing.alex@fcp.com.bs
;; res_querydomain(rpsvr01, , 1, 1)
;; res_query(rpsvr01., 1, 1)
;; Querying server (# 1) address = 0.0.0.0
;; Querying server (# 1) address = 0.0.0.0
;; Querying server (# 1) address = 0.0.0.0
;; Querying server (# 1) address = 0.0.0.0
;; res_query: send error
seq_map_parse(aliases.files, )
;; res_query(10.2.22.172.in-addr.arpa, 1, 12)
;; Querying server (# 1) address = 0.0.0.0
;; Querying server (# 1) address = 0.0.0.0
;; Querying server (# 1) address = 0.0.0.0
;; Querying server (# 1) address = 0.0.0.0
;; res_query: send error
;; res_query(10.8.200.129.in-addr.arpa, 1, 12)
;; Querying server (# 1) address = 0.0.0.0
;; Querying server (# 1) address = 0.0.0.0
;; Querying server (# 1) address = 0.0.0.0
;; Querying server (# 1) address = 0.0.0.0
;; res_query: send error
map_init(sequence:aliases.files, NULL, 0)
sequence:aliases.files NULL: valid
map_init(implicit:Alias0, /etc/mail/aliases, 0)
wrong pass (pass = 0, rebuildable = 1)
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
map_init(host:resolve, NULL, 0)
host:resolve NULL: valid
map_init(sequence:aliases.files, NULL, 1)
wrong pass (pass = 1, rebuildable = 0)
map_init(implicit:Alias0, /etc/mail/aliases, 1)
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, 1)
wrong pass (pass = 1, rebuildable = 0)
map_init(switch:aliases, aliases, 1)
wrong pass (pass = 1, rebuildable = 0)
map_init(dequote:dequote, NULL, 1)
wrong pass (pass = 1, rebuildable = 0)
map_init(host:resolve, NULL, 1)
wrong pass (pass = 1, rebuildable = 0)
getcanonname(fcp.com.bs), trying dns
dns_getcanonname(fcp.com.bs, trymx=1)
dns_getcanonname: trying fcp.com.bs. (ANY)
;; res_querydomain(fcp.com.bs, , 1, 255)
;; res_query(fcp.com.bs., 1, 255)
;; Querying server (# 1) address = 0.0.0.0
;; Querying server (# 1) address = 0.0.0.0
;; Querying server (# 1) address = 0.0.0.0
;; Querying server (# 1) address = 0.0.0.0
;; res_query: send error
NO: errno=239, h_errno=2
getcanonname(fcp.com.bs), failed, stat=75
fcp.com.bs: Name server timeout
laing.alex@fcp.com.bs... Transient parse error -- message queued for future delivery
test
.
laing.alex@fcp.com.bs... queued
closemaps: closing aliases.files (NULL)
closemaps: closing Alias0 (/etc/mail/aliases)
impl_map_close(Alias0, /etc/mail/aliases, 12a3)
db_map_close(Alias0, /etc/mail/aliases, 12a3)
closemaps: closing host (NULL)
closemaps: closing aliases (aliases)
closemaps: closing dequote (NULL)
closemaps: closing resolve (NULL)
***********************************************

I must also mention that there are no DNS servers on our network.
Steven E. Protter
Exalted Contributor

Re: Sending mail to MS Exchange

Okay, if there are not any DNS servers on your network you are going to have to relay mail as I noted in my first response.


in
/etc/sendmail.cf

DS
[IP_address_of_relay_server]

...

I find it hard to believe that there are no DNS servers in your environment. Do users connect to the Internet? If so, how do they do it? What internal server handles name to ip address translation?

I take what you are saying as truth and therefore note that Micahel's recommendations won't work.

Anyway, its important to understand that the server you are trying to pass mail to needs to accept relay.

Microsoft Exchange Servers have relay off by default due to spam concerns. To turn on relay for on HP-UX server according to our exchange guys would compromise security.

So how we do it, is we have our firewall handle smtp relay.

It authorizes relay by IP address and only relays from our 4 remaining HP-UX servers. It is a simple smtp relay server.

When you run my sendmail diagnostic command above, all you see is the smtp server accepting the mail. It decides where the mail goes after that and can't even bounce back error messages.

Our firewall is made by symmantec.

Hope this is helpful in some way.

Steve "I work for Points" Protter
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
Joerg Hinz
Occasional Advisor

Re: Sending mail to MS Exchange

Before doing *anything* with sendmail verify that the exchange server accepts mail via SMTP:

# telnet 25

If you receive "connection refused" there is no SMTP-Interface running.

Then enable the SMTP-Interface on the Exchange-Server.

To reach specific users on the Exchange with a seperate domain add to the sendmail-mailertable

dest.domain esmtp:

To forward all non-local mail to it configure the exchange-server as a smart host in sendmail.mc:

define(`SMART_HOST', `esmtp:[]')dnl

If you have as /etc/hosts or working DNS entry you can use the canonical name of course..

Joerg
-- quote?
Steven Sim Kok Leong
Honored Contributor

Re: Sending mail to MS Exchange

Hi,

As long as your MX records are correctly defined in your DNS records, you should be able to send emails out to the right mail server corresponding to the right domain.

To check your MX records, do this:

# nslookup
set type=mx
the_domain_of_recepient_email

The result should return the mail exchangers that are communicated for sending emails to the_domain_of_recepient_email.

As long as DNS entry is properly configured, no configuration changes is needed in your HP-UX server.

Hope this helps. Regards.

Steven Sim Kok Leong