General discussion on installation and configuration of SOGo

Text archives Help


Re: [SOGo] defaults write domains syntax


Chronological Thread 
  • From:
  • To:
  • Subject: Re: [SOGo] defaults write domains syntax
  • Date: Fri, 10 Dec 2010 10:21:32 -0900

Quoting Martin Rabl
< >:

Am 10.12.2010 18:31, schrieb
:
Never did figure out the correct syntax for the 'defaults' command but
I did figure out how to add multiple domains to my GNUstepDefaults
config.
Would you be so kind to tell us your solution?


Yeah, sorry Martin and list I thought about that just after hitting Send. :(

It's a hack so make a backup of your working .GNUstepDefaults file if you haven't already because it has the potential to wipe it out.


So there is apparently an old style config for .GNUstepDefaults that is not xml and I had read on the list that you can throw the old style in and then run your 'defaults write' commands and it would convert it to xml. It does.

So here is what I do:

---> AS THE SOGO USER <---

1. Make a backup of your .GNUstepDefaults file.
2. See step 1.
3. Create a new empty .GNUstepDefaults file
4. Insert the following into the new .GNUstepDefaults file


{
"sogod" = {
SOGoProfileURL =

"postgresql://sogo: :5432/sogo/sogo_user_profile";
OCSFolderInfoURL =

"postgresql://sogo: :5432/sogo/sogo_folder_info";
SOGoAppointmentSendEMailNotifications = YES;
SOGoCalendarDefaultRoles = (
PublicViewer,
ConfidentialDAndTViewer
);
SOGoLanguage = English;
SOGoMailingMechanism = smtp;
SOGoSMTPServer = 127.0.0.1;
SOGoSentFolderName = Sent;
SOGoTimeZone = America/Montreal;
SOGoTrashFolderName = Trash;
SOGoIMAPServer = localhost;
domains = {
acme.com = {
SOGoMailDomain = acme.com;

SOGoDraftsFolderName = Drafts;
SOGoUserSources = (
{
type = ldap;
CNFieldName = cn;
IDFieldName = mail;
UIDFieldName = mail;
baseDN = "ou=users,dc=acme,dc=com";
bindDN = "uid=sogo,ou=users,dc=acme,dc=com";
bindPassword = sogopassword;
canAuthenticate = YES;
displayName = "Shared Addresses";
hostname = localhost;
id = public;
isAddressBook = YES;
port = 389;
}
);
};
dcoyote.com = {
SOGoMailDomain = coyote.com;
SOGoUserSources = (
{
type = ldap;
CNFieldName = cn;
IDFieldName = uid;
UIDFieldName = uid;
baseDN = "ou=users,dc=coyote,dc=com";
bindDN = "uid=sogo,ou=users,dc=coyote,dc=com";
bindPassword = sogopassword;
canAuthenticate = YES;
displayName = "Shared Addresses";
hostname = localhost;
id = coyote;
isAddressBook = YES;
port = 389;
}
);
}
};
};
}


5. I then created a little script to run all of my 'defaults write' commands, shown below.

cat resetSogo.sh
#!/bin/bash

#rm /home/sogo/GNUstep/Defaults/.G*

defaults write NSGlobalDomain 'Local Time Zone' 'US/Alaska'
defaults write sogod SOGoTimeZone "America/Anchorage"
defaults write sogod SOGoLanguage English
defaults write sogod SOGoAppointmentSendEMailNotifications YES
defaults write sogod SOGoFoldersSendEMailNotifications YES
defaults write sogod SOGoACLsSendEMailNotifications YES
defaults write sogod SOGoProfileURL 'mysql://sogo: :3306/sogo/sogo_user_profile'
defaults write sogod OCSFolderInfoURL 'mysql://sogo: :3306/sogo/sogo_folder_info'
defaults write sogod SOGoMailingMechanism smtp
defaults write sogod SOGoSMTPServer localhost
defaults write sogod SOGoDraftsFolderName INBOX/Drafts
defaults write sogod SOGoSentFolderName INBOX/Sent
defaults write sogod SOGoTrashFolderName INBOX/Trash
defaults write sogod SOGoOtherUsersFolderName "Other Users"
defaults write sogod SOGoSharedFolderName "Shared Folders"
defaults write sogod SOGoIMAPServer localhost


6. Copy step 5 into a file and 'chmod +x <filename>' then run it and it will convert the old style into a xml file.


You will obviously need to fix it up to your specific domain and once it is converted you can just edit the new .GNUstepDefaults file by hand using your favorite editor. If you need more domains add them into Step 4 and lather, rinse, repeat.

I would really like to know how to do this using the 'defaults write ...' command, so if anybody knows how please share.

Hope that helps someone else,

Jon







Archive powered by MHonArc 2.6.16.

Top of page