Operating System - HP-UX
1748112 Members
3347 Online
108758 Solutions
New Discussion юеВ

Re: sending mail to my exchange server

 
SOLVED
Go to solution
Jim Mickens
Frequent Advisor

sending mail to my exchange server

Is there any way to set up HP-UX v10.20 to send output from crontabs and HPDPS messages to my Exchange users, instead of having undeliverable messages pile up in root's elm box?
14 REPLIES 14
Tommy Brown
Respected Contributor

Re: sending mail to my exchange server

We use a ".forward" file in the users home directory to forwards mail to the Echange server. eg. user@mail. The sendmail.cf file must also be modified..
Tommy
I may be slow, but I get there !
Rick Garland
Honored Contributor

Re: sending mail to my exchange server

Define a "Smart Host". This way all e-mail from the HP system is sent to the Exchange server and Exchange does the name lookups. Also defined an alias for root so that mail comes to my personal mailbox with info as to which system sent it.
You may also want to look at the DLname_of_luser_relay. This says that I don't know anybody on the system and I am going to forward all e-mails to the DL.

These options exist in the /etc/mail/sendmail.cf file. Do make a copy of the original sendmail.cf file and once changes are in place, kill the sendmail daemon and restart it
This will reread the mail config file.
ps -ef | grep mail
kill
/usr/lib/sendmail -bd -q15m
Jim Mickens
Frequent Advisor

Re: sending mail to my exchange server

So to define the Smart Host, would I use the Exchange server's name (e.g. mauemail), or the SMTP connector's incoming mail name (e.g. mau.opinionresearch.com)? Or does it matter, as long as what I use is defined in the host table?

What if all users do not reside on the same Exchange server? Would the .forward option be the best way to go? I've never done this stuff before, so I'm going to need some more detailed information.
Rick Garland
Honored Contributor

Re: sending mail to my exchange server

The Smart Host would be defined as the exchange server's name
i.e., DShostname.domain.com - the luser_relay would also be the exchange server hostname.

If all users are not on this exchange server, is it setup to forward those e-mail boxes to the server they reside on? If so, the UNIX mail still does not know anybody on the UNIX system - all mail gets forwarded to the exchange server and the exchange server will do the name lookups and forward accordingly.

On the UNIX system, define the Smart Host at the least. Mail from the UNIX system will be forwarded to the exchange server.

After defining the Smart Host in the /etc/sendmail.cf file, be sure to stop and restart the mail daemon.
Rodwell B. Watson
New Member

Re: sending mail to my exchange server

You can set up the smart relay in /etc/mail/sendmail.cf by uncommenting the line

DS[xxx.xxx.xxx.xxx]

where you insert the IP address for your exchange server.

The easiest way, however, is to just to put an entry in /etc/hosts:

xxx.xxx.xxx.xxx companyname.com

where you supply the appropriate domain name. Then use the following shell script:

#!/usr/bin/sh
SUBJECT="Forward mail from HP-UX"
ACCOUNTS=`find /var/mail -mtime +1 -print`
for ACCOUNT in $ACCOUNTS; do
NAME=`echo $ACCOUNT|cut -c 11-`
EMAILTO="${NAME}@companyname.com"
if [[ -n $NAME ]];then
mailx - "$SUBJECT" "$EMAILTO" <"$ACCOUNT"
rm "$ACCOUNT"
fi;
done

This script is then executed maybe once an hour in crontab. You might adjust the script because the way it is now written it forwards all mail older than a day to the exchange server. It also assumes that user names are the same on the exchange server as on the the hp-ux. If this is not the case then you could set up a switch table to get the names.

In order to reference the exchange server in /etc/hosts only, you must set the line in /etc/mail/service.switch to:

hosts files

For more information on these issues look at the sendmail web site, www.sendmail.org
Rick Garland
Honored Contributor

Re: sending mail to my exchange server

Define the Smart Host as described. What I do is setup the /etc/mail/aliases file as well. Example, all of our mail goes through Exchange and the mail is produced on the individuals Outlook mail app. In using the aliases file, I have setup root mail to be aliased to me so I receive all of the mail that is directed to the root account.

I let few people know I have done this because I do not want to be maintaining the aliases file. There are only a couple of entries in there that are fairly static and do not require regular updating.

Re: sending mail to my exchange server

You can also add the following line at the beginning of /usr/mail/root:

Forward to user@exchange.company.com

(replace this with whatever user you want root's mail to go to).

I hope this helps.

Jim Mickens
Frequent Advisor

Re: sending mail to my exchange server

Thanks to everyone for all your help. I finally had the time to do this, and it appears to be working. The problem I have now is that all messages from HPDPS are coming into the Exchange server as attachments on a message that says: "This message uses a character set that is not supported by the Internet Service. To view the original message content...". I then have to open the message.txt attachment to read the original message.
Thierry Poels_1
Honored Contributor
Solution

Re: sending mail to my exchange server

hi,

edit /usr/share/lib/mailx.rc and add/change:
set charset=us-ascii

good luck,
Thierry.
All unix flavours are exactly the same . . . . . . . . . . for end users anyway.