Koozali.org: home of the SME Server
Obsolete Releases => SME Server 7.x => Topic started by: festus on September 07, 2007, 01:32:36 AM
-
I have a need to run the mail server for a virtual domain on an external server and the web server for the virtual domain on the SME server. I have searched the wiki section and the forum and found the following information.
http://wiki.contribs.org/SME_Server:Documentation:Technical_Manual:Booklet#Setting_db_variables_to_default_values
Issue the command:
http://wiki.contribs.org/SME_Server:Documentation:Technical_Manual:Booklet#Setting_db_variables_to_default_values
Forum Entry:
http://forums.contribs.org/index.php?topic=32167.0
I have the following questions related to this.
a) Is this command applicable to SME 7.2 ?
b) After a period of time, I may have to move the external mail server also to my SME server. What command should I issue to revert back to using SME server as the mail server for this domain ?
Would appreciate advise from some experts in the community.
-
festus
> a) Is this command applicable to SME 7.2 ?
Yes
> b) What command should I issue to revert back to using SME server as the mail server for this domain ?
At the command prompt type
db
for a syntax listing of possibilities. Work it out from there.
eg
db domains delprop xxx yyy
or
db domains delete xxx
It's always good idea before making any changes, to review the current settings and make a note of them or save them to a file for later review. In case you do something wrong, you can always recreate the entries.
db domains show
db domains show > /path/filename
-
Dear Ray,
Thank you very much for your clear instructions. Exactly what I needed to know.
Festus
-
Based on my understanding and the instructions above, I have tried to view the files to do a backup and I have run into more questions. I am recording below all the attempts I have made to locate the files as per the document and what I have found so far. Would appreciate answers to the questions I have based on my attempts.
From the above documentation at contribs.org, I find the following services & files will be updated
if we issue the 'db domains setprop test.com MailServer a.b.c.d' command.
SERVICES: qpsmtpd; qmail; fetchmail
CONFIG FILES:
/var/service/qpsmtpd/config/goodrcptto;
/var/service/qpsmtpd/config/peers/local;
/var/service/qpsmtpd/config/peers/0;
/var/service/qpsmtpd/plugins;
/var/service/qmail/control/virtualdomains;
/var/service/qmail/control/smtproutes;
/etc/fetchmail
When I searched my sme 7.2 to backup these files, following are the files I found
in the path specified in the doc:
/var/service/qpsmtpd/config/goodrcptto;
/var/service/qpsmtpd/config/peers/local;
/var/service/qpsmtpd/config/peers/0;
/etc/fetchmail
I could not find the following files in the path specified in the doc.
(at least not in the path specified in the document)
/var/service/qpsmtpd/plugins;
/var/service/qmail/control/smtproutes;
/var/service/qmail/control/virtualdomains;
Instead by doing a search, I found the above files in the followin path:
/usr/share/qpsmtpd/plugins
/var/service/qpsmtpd/config/plugins
/etc/qpsmtpd/plugins
/var/qmail/control/smtproutes
/etc/e-smith/events/bootstrap-console-save/templates2expand/var/qmail/control/sm
tproutes
/var/qmail/control/virtualdomains
My question:
Which are the files I should backup if I want to be able to revert
to the saved copy, in case i run into problems ?
-----------------------------------------------------------------------
I tried to work out the syntax and issued the command:
# db domains delprop
and got the response:
/sbin/e-smith/db dbfile delprop key prop1 [prop2] [prop3] ...
My question:
How do I work out the exact syntax if I am trying to reset the config i had
done for the domain test.com ? The above prompt is not very clear to me.
--------------------------------------------------------------------------
I tried to view the settings in the 'domains' file.
But the file has no entry by deafult.
My Questions:
Does this mean that the domains file will have some entry only if I
specifically issue the 'db domain setprop ..' command ?
How do I make use of the command: db domains show > /path/filename
The 'filename' refers to which filename ?
In my 7.2 default install, the file 'domains' is located at: /home/e-emith/db/
Based on this, what is the exact command I should issue to view the config for
domains and to back up ?
Thanks again for the prompt clarifictions received in this Forum.
--------------------------------------------------------------------------
-
festus
I think you are overcomplicating it.
Just do
db domains show test.com
and make a note of the entries
or do
db domains show test.com > /path/filename
to save that information to a file
To delete the property
db domains delprop test.com Mailserver
db domains show test.com
signal-event email-update
Note that the command
db domains delete test.com
will delete all information in the domains db file about that domain, and something will not work right as a result of that, that's the reason I said to be careful.
If you get the syntax wrong & enter wrong db commands, then you can recreate all the correct entries by redoing the db commands (correctly) based on the information you saved earlier.
All the appropriate config files will change when you do the email-update event based on what is in the db file and the templates.
See the correct syntax for the db command by doing
db
-
festus
> I tried to work out the syntax and issued the command:
> # db domains delprop
I said to do
db
which gives
usage:
/sbin/e-smith/db dbfile keys
/sbin/e-smith/db dbfile print [key]
/sbin/e-smith/db dbfile show [key]
/sbin/e-smith/db dbfile get key
/sbin/e-smith/db dbfile set key type [prop1 val1] [prop2 val2] ...
/sbin/e-smith/db dbfile setdefault key type [prop1 val1] [prop2 val2] ...
/sbin/e-smith/db dbfile delete key
/sbin/e-smith/db dbfile printtype [key]
/sbin/e-smith/db dbfile gettype key
/sbin/e-smith/db dbfile settype key type
/sbin/e-smith/db dbfile printprop key [prop1] [prop2] [prop3] ...
/sbin/e-smith/db dbfile getprop key prop
/sbin/e-smith/db dbfile setprop key prop1 val1 [prop2 val2] [prop3 val3] ...
/sbin/e-smith/db dbfile delprop key prop1 [prop2] [prop3] ...
On a typical server I get
db domains show xyz.com
xyz.com=domain
Content=Primary
Description=Primary domain
Nameservers=localhost
Removable=no
SystemPrimaryDomain=yes
The dbfile is domains
The key is xyz.com
One of the properties ie prop1 is Nameservers
The value ie val1 for that property is localhost
Another property ie prop2 is SystemPrimaryDomain
The value ie val2 for that property is yes
Apply this reasoning to the other entries for that domain, and the same concepts also apply to all other db files
You can leave out the /sbin/e-smith/ part as there is a shortcut link.
-
Ray,
Before you posted the latest instructions, while trying out the configs, somehow I had overwritten the 'domains' file and it is blank now!
My questions:
a) The instructions on the header of the file that the domains file is autogenerated and should not be manually edited. If I now reboot the server, will this file be autogenerated with the correct entries for the various domains ? Or I should issue the various db setprop commands to recreate these entries in the 'domains' file ?
b) Since the 'Domains' menu in the 'server-manager' panel was used in the first place to create the domain and link to the appropriate ibays, if recreate the domain names from this panel, would it recreate the entries in all the relevant files, this being an alternative to creating the entries using setprop commands from the command line ?
c) For reverting the MailServer entry from external to the local server, could I use the 'Domain' menu in the 'server-manager' panel, delete the domain and create again ? Could this be the alternative to the command line setprop approach to move the Mail Server back to SME ?
Appreciate your advise. This should help me to recover the domains file config and also complete my understanding of all options with regard to this configuration.
Thanks for taking time to explain in detail the various commands.
This exercise has increased my understanding many times on this topic. I am sure many others will find the instructions useful as well and serve as a reference.
-
festus
I did say (twice) to make a note of the entries first !!!
You can easily recreate them manually using the db command if all else fails, and that's why I suggested that approach.
Rebooting the server does very little, except restart services.
Autogeneration only happens when you expand templates & then reboot, which rebuilds the config files based on a combination of the values in the db files and the template fragments.
As you now have wrong (ie no) values in the domains db, then these values will be retained, although in the absence of any keys or properties, default values from the template fragments will be put into the config files.
You need to do
rm /home/e-smith/db/domains
initialize-default-databases
signal-event post-upgrade
reboot
I think that should get default values back, and then you can tailor your domains to set the values you require using the server manager panel.
Configuring settings/values using the server manager panel or the command line, has the same result, except of course for any settings not supported by server manager GUI, which will then require command prompt intervention.