OpenWebmail tips/vsite destroy patch
From CobaltFAQs
This patch alters the vsite_destroy.pl script in /usr/sausalito/handlers/base/vsite to remove an override file whenever a vsite is deleted via the UI.
The Perl script has to be edited after patching to ensure the proper Open WebMail path is configured. Several OWM PKG files install themselves into different directories, and there is not a good way to automatically determine this. Put the correct OWM path into the openwebmail_dir variable.
--- vsite_destroy.pl 2006-08-23 00:45:21.000000000 -0700
+++ vsite_destroy.pl 2006-08-23 01:05:11.000000000 -0700
@@ -97,8 +97,19 @@
my $base = homedir_get_group_dir($vsite->{name}, $vsite->{volume});
# destroy the command line friendly symlink
-my ($site_link, $link_target) = homedir_create_group_link($vsite->{name},
- $vsite->{fqdn}, $vsite->{volume});
+my ($site_link, $link_target) = homedir_create_group_link($vsite->{name}, $vsite->{fqdn}, $vsite->{volume});
+
+# Remove Open WebMail domain_override file if it exists
+# Enables mail send from user@example.com vs. user@www.example.com
+#
+# Set openwebmail_dir according to the site's installation
+#
+my $openwebmail_dir = "/var/www/cgi-bin/openwebmail/etc/sites.conf/";
+my $openwebmail_file = "$openwebmail_dir/$vsite->{fqdn}";
+if ( -f $openwebmail_file) {
+ unlink($openwebmail_file) or $cce->warn('Cannot delete Open WebMail domain_override file');
+}
+
unlink($site_link);
Sauce::Util::addrollbackcommand("umask 000; /bin/ln -sf \"$link_target\" \"$site_link\"");
