Simpler Navigation for Servers and Operating Systems - Please Update Your Bookmarks
Completed: a much simpler Servers and Operating Systems section of the Community. We combined many of the older boards, so you won't have to click through so many levels to get at the information you need. Check the consolidated boards here as many sub-forums are now single boards.
If you have bookmarked forums or discussion boards in Servers and Operating Systems, we suggest you check and update them as needed.
General
cancel
Showing results for 
Search instead for 
Did you mean: 

Someone want to port this script to hp-ux?

SOLVED
Go to solution
Steven E. Protter
Exalted Contributor

Someone want to port this script to hp-ux?

Its a linux script that generates hash databases based on sendmail.mc and the /etc/mail text files.

newaliases
cd /etc/mail
makemap -r -v hash access.db < access
makemap -r -v hash domaintable.db < domaintable
makemap -r -v hash genericstable.db < genericstable
makemap -r -v hash mailertable.db < mailertable
makemap -r -v hash virtusertable.db < virtusertable
cp /etc/sendmail.cf /root
/etc/init.d/sendmail restart

I know the sendmail part won't work.

I'd make that

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

A rabbit for the a any tested, working port.

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
4 REPLIES
Christopher Caldwell
Honored Contributor
Solution

Re: Someone want to port this script to hp-ux?

If you're talking stock hp sendmail, the hp folks generally use dbm. You can tell by looking at the ruleset in sendmail.cf. e.g.
$grep domaintable sendmail.cf
Kdomaintable dbm /etc/mail/domaintable
says use dbm for domaintable

newaliases
cd /etc/mail
/usr/sbin/makemap dbm access < access
/usr/sbin/makemap dbm domaintable < domaintable
/usr/sbin/makemap dbm genericstable < genericstable
/usr/sbin/makemap dbm mailertable < mailertable
/usr/sbin/makemap dbm virtusertable < virtusertable

...

You don't have to restart sendmail - the databases are live. But if you prefer (as you noted),

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

The aforementioned assumes domaintable, genericstable mailertable and virtusertable exists. A good script would test for them, or better yet, derive them from sendmail.cf.

Jordan Bean
Honored Contributor

Re: Someone want to port this script to hp-ux?


#!/usr/bin/sh
newaliases
grep ^K /etc/mail/sendmail.cf |\
while read name type opt arg
do
file=${arg:-$opt}
case $type in
(dbm|btree|hash)
touch $file
makemap -rv $type $file < $file
;;
esac
done

Steven E. Protter
Exalted Contributor

Re: Someone want to port this script to hp-ux?

I like yours Jordon. Very slick..

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
Jordan Bean
Honored Contributor

Re: Someone want to port this script to hp-ux?


Thanks SEP.