Thursday, November 23, 2006

HP-UX Sendmail without DNS

好像很多人因為系統裝了 sendmail
就以為 sendmail 只能當 mail server 來用
卻不知 sendmail 也可以直接寄信 - 如果你只想寄出去而已
甚至信寄不出去 就認定 sendmail 有問題
其實是 DNS 或是 HOSTS Files 沒設好而已

ex. mail -s "test1" user1@acty.com.tw < /tmp/somefile
它會去問 acty.com.tw 的 DNS 的 MX 或是 HOST File 的 IP
假設今天用 HOSTS FILE 也在裡面 acty.com.tw 的 IP
它就會寄到那個 IP 去

Step:
1)
use SAM for looking up "Name Service Switch"
for hosts (in Networking and Communications).
On the working 11.0 node i found /etc/hosts as first source,
in the 11.11 node there was DNS as first, NIS as second
and /etc/hosts as third source configured.

Please change /etc/hosts as first and none as second source.

don't reboot the machine but restarted sendmail

2) or
cp -p /etc/nsswitch.file /etc/nsswitch.conf

No comments:

Post a Comment