Operating System - HP-UX
1748136 Members
3614 Online
108758 Solutions
New Discussion юеВ

Re: Configure sendmail with exchange to send locally and outside

 
SOLVED
Go to solution
YMJ
Frequent Advisor

Configure sendmail with exchange to send locally and outside

Hi guys

I know am writing this thread and there are plenty of threads out there regarding sendmail. but my question is that how to allow sendmail to send to local domain and other domains (ex. yahoo, hotmail) in same configuration.

I am being able to send locally when I set the DS directive in the sendmail.cf file but not outside.

when I comment the DS directive, I can send outside but not locally.

here is the error when the DS is set:

>>> MAIL From:
250 2.1.0 root@mdh01....Sender OK
>>> RCPT To:
550 5.7.1 Unable to relay for ymj@gmail.com
ymj@gmail.com... User unknown

the error when DS is not set:

>>> MAIL From: SIZE=6
504 : Sender address rejected: need fully-qualified address
Service unavailable

what do you suggest?
7 REPLIES 7
Steven E. Protter
Exalted Contributor

Re: Configure sendmail with exchange to send locally and outside

Shalom YMJ,

The error message tells all.

Do what I did.

vi /etc/mail/sendmail.cf

Change:

DS

to:

DShostname_of_exchange
example

DSexchangeserver

or

DS
[ip address of exchange]
example
[192.168.0.10]

Where 192.168.0.10 is the IP address of the Exchange server.

Note that the IP based configuration works even if DNS fails.

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

Solution by SEP

:-)

Have fun.

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
Steven E. Protter
Exalted Contributor
Solution

Re: Configure sendmail with exchange to send locally and outside

That wasn't a solution, that was a misake.

Try the

DM directive

or the

Dj directive.

I think the former will work.

Same restart procedure.

Mistakes happen when I get arrogant.

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
YMJ
Frequent Advisor

Re: Configure sendmail with exchange to send locally and outside

Hi SEP
I think the problem still there. however, I can't see any error when I run the sendmail -v , here is the output:

# sendmail -v -d8.99 -d38.99 ymj@mycom.com
;; res_querydomain(mdh01, , 1, 1)
;; res_query(mdh01., 1, 1)
;; Querying server (# 1) address = 10.1.10.13
;; Querying server (# 2) address = 10.1.10.14
;; res_query: send error
;; res_querydomain(mdh01, , 1, 1)
;; res_query(mdh01, 1, 1)
;; Querying server (# 1) address = 10.1.10.13
;; Querying server (# 2) address = 10.1.10.14
;; res_query: send error
getcanonname(mdh01), trying dns
dns_getcanonname(mdh01, trymx=1)
dns_getcanonname: trying mdh01. (ANY)
;; res_querydomain(mdh01, , 1, 255)
;; res_query(mdh01., 1, 255)
;; Querying server (# 1) address = 10.1.10.13
;; Querying server (# 2) address = 10.1.10.14
;; res_query: send error
NO: errno=238, h_errno=2
getcanonname(mdh01), failed, stat=75
seq_map_parse(aliases.files, )
;; res_query(19.11.4.10.in-addr.arpa, 1, 12)
;; Querying server (# 1) address = 10.1.10.13
;; rcode = 3, ancount=0
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(mycom.com), trying dns
dns_getcanonname(mycom.com, trymx=1)
dns_getcanonname: trying mycom.com. (ANY)
;; res_querydomain(mycom.com, , 1, 255)
;; res_query(mycom.com., 1, 255)
;; Querying server (# 1) address = 10.1.10.13
YES
dns_getcanonname: mycom.com
getcanonname(mycom.com), found
hi hi hooooooooooooooo
.
getmxrr(mycom.com., droplocalhost=1)
;; res_querydomain(mycom.com., , 1, 15)
;; res_query(mycom.com, 1, 15)
;; Querying server (# 1) address = 10.1.10.13
ymj@mycom.com... Connecting to rose.mycom.com. via esmtp...
;; res_querydomain(rose.mycom.com., , 1, 1)
;; res_query(rose.mycom.com, 1, 1)
;; Querying server (# 1) address = 10.1.10.13
220 sms1.mobily.lan ESMTP EEC
>>> EHLO mdh01.mycom.com
250-sms1.mobily.lan
250-PIPELINING
250-SIZE 10485760
250-VRFY
250-ETRN
250 8BITMIME
>>> MAIL From: SIZE=23
250 Ok
>>> RCPT To:
250 Ok
>>> DATA
354 End data with .
>>> .
250 Ok: queued as 92092F44
ymj@mycom.com... Sent (Ok: queued as 92092F44)
Closing connection to rose.mycom.com.
>>> QUIT
221 Bye
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)
YMJ
Frequent Advisor

Re: Configure sendmail with exchange to send locally and outside

SEP hi again

as in previous email I did what you told me and there is no error in the sendmail verbose mode, but there is no emails received in my exchange account.

I what know if there is a problem with configuration file, or it is microsoft issue as usual.

I want to close this thread and give your points

Thanks
Steven E. Protter
Exalted Contributor

Re: Configure sendmail with exchange to send locally and outside

Shalom,

I believe there still is a problem.

250 Ok: queued as 92092F44

Check mailq command on HP-UX.

I believe the problem is the Microsoft server is not permitting relay from the HP-UX server.

That has to be set up explicitly on Exchange.

I recommend checking with the Exchange Administrator on this issue.

If exchange has been set up, it could be a firewall or networking issue for your networking experts.

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
YMJ
Frequent Advisor

Re: Configure sendmail with exchange to send locally and outside

Thank you SEP for your full support
YMJ
Frequent Advisor

Re: Configure sendmail with exchange to send locally and outside

needs more investigation