diff --git a/createlinks b/createlinks index c6d2dac..13702e5 100755 --- a/createlinks +++ b/createlinks @@ -5,11 +5,9 @@ use esmith::Build::CreateLinks qw(:all); service_link_enhanced("memcached-sogo", "S55", "7"); service_link_enhanced("sogod", "S85", "7"); -templates2events("/etc/e-smith/sql/init/30sogo_mysql_create_database", qw(email-update bootstrap-console-save)); -templates2events("/etc/e-smith/sql/init/31sogo_mysql_update_privileges", qw(email-update bootstrap-console-save)); -templates2events("/home/sogo/smeserver/sogo_mysql_update_privileges.sql", qw(email-update bootstrap-console-save)); +templates2events("/etc/e-smith/sql/init/sogo", qw(email-update bootstrap-console-save)); templates2events("/etc/cron.d/sogo-alarm", qw(email-update bootstrap-console-save)); -templates2events("/home/sogo/GNUstep/Defaults/.GNUstepDefaults", qw(email-update bootstrap-console-save pre-backup)); +templates2events("/var/lib/sogo/GNUstep/Defaults/.GNUstepDefaults", qw(email-update bootstrap-console-save pre-backup)); templates2events("/etc/sysconfig/sogo", qw(email-update bootstrap-console-save)); templates2events("/etc/logrotate.d/sogo", qw(email-update bootstrap-console-save)); @@ -21,6 +19,7 @@ event_link("sogo-delete-backup", "pre-backup", "60"); event_link("sogo-delete-backup", "post-backup", "60"); event_link("sogo-backup", "pre-backup", "70"); event_link("sogo-delete-user", "user-delete", "10"); +event_link("sogo-upgrade", "email-update", "20"); panel_link("sogo", "manager"); diff --git a/root/etc/e-smith/events/actions/sogo-backup b/root/etc/e-smith/events/actions/sogo-backup index aedf906..531499e 100644 --- a/root/etc/e-smith/events/actions/sogo-backup +++ b/root/etc/e-smith/events/actions/sogo-backup @@ -1,4 +1,4 @@ #!/bin/bash -su - sogo -c "/usr/sbin/sogo-tool backup /home/e-smith/db/sogo ALL" > /dev/null 2>&1 +su -l -s /bin/bash sogo -c "/usr/sbin/sogo-tool backup /home/e-smith/db/sogo ALL" > /dev/null 2>&1 diff --git a/root/etc/e-smith/events/actions/sogo-delete-user b/root/etc/e-smith/events/actions/sogo-delete-user index 9733f85..7ea545c 100644 --- a/root/etc/e-smith/events/actions/sogo-delete-user +++ b/root/etc/e-smith/events/actions/sogo-delete-user @@ -12,5 +12,5 @@ if [ -z "$USER" ]; then exit 1 fi -su - sogo -c "/usr/sbin/sogo-tool remove $USER" > /dev/null 2>&1 +su -l -s /bin/bash sogo -c "/usr/sbin/sogo-tool remove $USER" > /dev/null 2>&1 diff --git a/root/etc/e-smith/events/actions/sogo-upgrade b/root/etc/e-smith/events/actions/sogo-upgrade new file mode 100644 index 0000000..2dfd531 --- /dev/null +++ b/root/etc/e-smith/events/actions/sogo-upgrade @@ -0,0 +1,6 @@ +#!/bin/bash + +/usr/bin/getent passwd sogo | grep -q '/home/sogo' +if [ $? -eq 0 ]; then + /usr/sbin/usermod -d /var/lib/sogo -m -s /sbin/nologin -c "SOGo daemon" sogo 2>/dev/null +fi diff --git a/root/etc/e-smith/templates.metadata/etc/e-smith/sql/init/31sogo_mysql_update_privileges b/root/etc/e-smith/templates.metadata/etc/e-smith/sql/init/31sogo_mysql_update_privileges deleted file mode 100644 index 6a29f37..0000000 --- a/root/etc/e-smith/templates.metadata/etc/e-smith/sql/init/31sogo_mysql_update_privileges +++ /dev/null @@ -1 +0,0 @@ -PERMS=0540 diff --git a/root/etc/e-smith/templates.metadata/etc/e-smith/sql/init/31sogo_upgrade b/root/etc/e-smith/templates.metadata/etc/e-smith/sql/init/31sogo_upgrade deleted file mode 100644 index 6a29f37..0000000 --- a/root/etc/e-smith/templates.metadata/etc/e-smith/sql/init/31sogo_upgrade +++ /dev/null @@ -1 +0,0 @@ -PERMS=0540 diff --git a/root/etc/e-smith/templates.metadata/etc/e-smith/sql/init/30sogo_mysql_create_database b/root/etc/e-smith/templates.metadata/etc/e-smith/sql/init/sogo similarity index 100% rename from root/etc/e-smith/templates.metadata/etc/e-smith/sql/init/30sogo_mysql_create_database rename to root/etc/e-smith/templates.metadata/etc/e-smith/sql/init/sogo diff --git a/root/etc/e-smith/templates.metadata/home/sogo/GNUstep/Defaults/.GNUstepDefaults b/root/etc/e-smith/templates.metadata/var/lib/sogo/GNUstep/Defaults/.GNUstepDefaults similarity index 100% rename from root/etc/e-smith/templates.metadata/home/sogo/GNUstep/Defaults/.GNUstepDefaults rename to root/etc/e-smith/templates.metadata/var/lib/sogo/GNUstep/Defaults/.GNUstepDefaults diff --git a/root/etc/e-smith/templates/etc/e-smith/sql/init/30sogo_mysql_create_database b/root/etc/e-smith/templates/etc/e-smith/sql/init/30sogo_mysql_create_database deleted file mode 100644 index f5ef3fb..0000000 --- a/root/etc/e-smith/templates/etc/e-smith/sql/init/30sogo_mysql_create_database +++ /dev/null @@ -1,3 +0,0 @@ -#! /bin/sh - -exec mysql < /home/sogo/smeserver/sogo_mysql_create_database.sql diff --git a/root/etc/e-smith/templates/etc/e-smith/sql/init/31sogo_mysql_update_privileges b/root/etc/e-smith/templates/etc/e-smith/sql/init/31sogo_mysql_update_privileges deleted file mode 100644 index e614329..0000000 --- a/root/etc/e-smith/templates/etc/e-smith/sql/init/31sogo_mysql_update_privileges +++ /dev/null @@ -1,3 +0,0 @@ -#! /bin/sh - -exec mysql < /home/sogo/smeserver/sogo_mysql_update_privileges.sql diff --git a/root/etc/e-smith/templates/etc/e-smith/sql/init/31sogo_upgrade b/root/etc/e-smith/templates/etc/e-smith/sql/init/31sogo_upgrade deleted file mode 100644 index 643584f..0000000 --- a/root/etc/e-smith/templates/etc/e-smith/sql/init/31sogo_upgrade +++ /dev/null @@ -1,3 +0,0 @@ -#! /bin/sh - -exec /etc/e-smith/events/actions/sogo_upgrade diff --git a/root/etc/e-smith/templates/etc/e-smith/sql/init/sogo b/root/etc/e-smith/templates/etc/e-smith/sql/init/sogo new file mode 100644 index 0000000..06648a8 --- /dev/null +++ b/root/etc/e-smith/templates/etc/e-smith/sql/init/sogo @@ -0,0 +1,40 @@ +{ +my $db = ${'sogod'}{'DbName'} || 'sogo'; +my $user = ${'sogod'}{'DbUser'} || 'sogo'; +my $pass = ${'sogod'}{'DbPassword'} || 'secret'; + +$OUT .= <<"END"; +/usr/bin/mysql <log(LOGINFO, "SOGo mailer detected, going to fix headers case"); foreach my $header (qw/From To Cc Subject Message-ID Content-Type Date Content-Length Content-Transfer-Encoding/){ - my $value = $self->get_header($transaction,$header) or return DECLINED; + my $value = $self->get_header($transaction,$header) or next; $self->set_header($transaction, $header, $value); } return DECLINED; diff --git a/root/home/sogo/GNUstep/Defaults/.GNUstepDefaults b/root/var/lib/sogo/GNUstep/Defaults/.GNUstepDefaults similarity index 100% rename from root/home/sogo/GNUstep/Defaults/.GNUstepDefaults rename to root/var/lib/sogo/GNUstep/Defaults/.GNUstepDefaults diff --git a/root/home/sogo/GNUstep/Library/SOGo/Templates/MainUI/SOGoRootPage.wox b/root/var/lib/sogo/GNUstep/Library/SOGo/Templates/MainUI/SOGoRootPage.wox similarity index 100% rename from root/home/sogo/GNUstep/Library/SOGo/Templates/MainUI/SOGoRootPage.wox rename to root/var/lib/sogo/GNUstep/Library/SOGo/Templates/MainUI/SOGoRootPage.wox