Operating System - HP-UX
1827294 Members
1177 Online
109960 Solutions
New Discussion

Re: How to setup to send emails from HP/UX 11 to windows 2000

 
Ferdie Banu_2
New Member

How to setup to send emails from HP/UX 11 to windows 2000

Hi guys,

I'm just new to HP/UX . Can you help me how to setup an emails in HP/UX 11. What I want to know is that everytime I backup my files in tape, i want the unix notify me if its successful or not thru emails.

Thanks In advance,


Ferdie Banu
5 REPLIES 5
Steven E. Protter
Exalted Contributor

Re: How to setup to send emails from HP/UX 11 to windows 2000

You can run the script like this:

backupscript | mailx -s "backup report" youremail@your.net

That will email the output

Same thing works great in cron.

On a basic level, mailx will do the job.

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

Re: How to setup to send emails from HP/UX 11 to windows 2000

hi ferdie,

also have a look at the following thread to get idea of what configuration tasks that you also have to perform...

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=348576

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=70999


hope this helps too!

regards
Yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
Gary Cooper_1
Esteemed Contributor

Re: How to setup to send emails from HP/UX 11 to windows 2000

Hi Ferdie,

Here's what I do...
Firstly check out the script (I'm sure there's loads of improvements that could be made, but it works for me).

Firstly, add area5.cgs.com (this is the domain for my Exchange server) to /etc/mail/sendmail.cf:

# my official domain name
# ... define this only if sendmail cannot automatically determine your domain
#Dj$w.Foo.COM

Changed to:

# my official domain name
# ... define this only if sendmail cannot automatically determine your domain
#Dj$w.area5.cgs.com

The following lines were added to /etc/mail/aliases:

# Local aliases
gcooper : gcooper@ntserver.area5.cgs.com
hdavies : hdavies@ntserver.area5.cgs.com
arazieh : arazieh@ntserver.area5.cgs.com

Rebuild the alias database:

# newaliases
/etc/mail/aliases: 10 aliases, longest 30 bytes, 199 bytes total
#

(Ntserver is my exchange server)

(Note the above e-mail addresses are fabricated, so they won't work if you try to use them).

Regards,

Gary
Muthukumar_5
Honored Contributor

Re: How to setup to send emails from HP/UX 11 to windows 2000

To successfully get mails then, hostname.domainname must be resolved there. If your having an account in local mail server domain called test.com then,

-- /etc/resolv.conf ----
domain test.com
nameserver xx.xx.xx.xx
nameserver xx.xx.xx.xx
------------------------

xx.xx.xx.xx --> ip-address of nameserver 1,2

Change resolvation order on /etc/nsswitch.conf as,

hosts: dns files

Try to resolve hostname as,

nslookup hostname.domainname.domainextension

Example:
nslookup test.test.com

It has to resolved there.

If you are having an account named as banu then,

echo "hai" | mailx -s "Testmail from `hostname`" banu@test.com

It will send mails to your banu account mail client there.


Check backup results with their results / log files and with the success send mails there.

if [[ result success ]]
then
echo "Filename $file get backuped" | mailx -s "Backup Success on`hostname`" banu@test.com

elif [[ result failure ]]
then
echo "Filename $file did not get backuped" | mailx -s "Backup failure on`hostname`" banu@test.com
fi


Put this script on cron to automate or execute during your execution of backup there.

HTH.
Easy to suggest when don't know about the problem!
Franky_1
Respected Contributor

Re: How to setup to send emails from HP/UX 11 to windows 2000

Hi,

just use mailx to get the desired output

Your_backup_script
.
.
.
output | mailx -s "Message"

Regards

Franky
Don't worry be happy