[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cobalt-users] [RaQ 4] HOWTO: Restore mail server aliases lost when site admin pages disappear



> I've got the procedure I sent David Griffith posted at
> http://www.cobaltfaqs.com/wiki/index.php/RestoringMailServerAliases.
>
> A Perl script is envisioned to do the grunt work automatically (a la
> fixsite.pl for the admin UI pages), but it will have to wait until I have
> some free time.
>
> In the meantime, I list the steps needed to make the appropriate entries
> manually via the site admin UI.
>
> -- Bruce


Doing it via the UI will take over an hour for 100 sites.

 Using the method below will take 5 minutes. (adapted from)
http://list.cobalt.com/pipermail/cobalt-users/2003-February/086552.html



#the 2 lines below actually add the domain name,
#and then the mail.domainname back to the /etc/mail/local-host-names
#note there are only 2 lines below so if they are
#wrapped in your display you will need to recombine them

#one line below
ls /home/sites/|awk -F '.' ' {if ($0 ~ /www/) {print $2"."$3}}' >>
/etc/mail/local-host-names

#one line below
ls /home/sites/|awk -F '.' ' {if ($0 ~ /www/) {print "mail."$2"."$3}}'
>>  /etc/mail/local-host-names


#the 2 lines below create the entries you'll need to paste in the the
route section of the virtuesertable
#one line below
ls /home/sites/ |awk -F '.' ' {if ($0 ~ /www/) {print
"@"$2"."$3"\t%1@www."$2"."$3}}' > /tmp/newvirt
#one line below
ls /home/sites/ |awk -F '.' ' {if ($0 ~ /www/) {print
"@mail."$2"."$3"\t%1@www."$2"."$3}}' >> /tmp/newvirt

#copy the text from the newvirt file to the route section of the
/etc/mail/virtusertable
cat /tmp/newvirt
pico -w /etc/mail/virtusertable

makemap hash /etc/mail/virtusertable < /etc/mail/virtusertable
/etc/rc.d/init.d/sendmail stop
killall -9 sendmail
/etc/rc.d/init.d/sendmail start


To prevent this problem in the future,
1. before deleting a site always go to the Site Settings for that site
and click Save. (Also it should not be suspended when you delete it.)

2. Then go back to the Main Menu and delete it.


----
Ken Marcus
Precision Web Hosting
ken@xxxxxxxxxxxxxxxx
http://www.precisionweb.net