OpenWebmail tips/vsite create patch

From CobaltFAQs

Jump to: navigation, search

This patch alters the vsite_create.pl script in /usr/sausalito/handlers/base/vsite to create a new override file whenever a vsite is added 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_create.pl     2006-08-23 00:45:32.000000000 -0700
+++ vsite_create.pl     2006-08-23 00:59:28.000000000 -0700
@@ -227,6 +227,19 @@
        ($ok) = $cce->set($site_ftp[0], '', {'commit' => time()});
 }

+# Create Open WebMail domain_override file
+# 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 ( -d $openwebmail_dir) {
+  open CONF, "> $openwebmail_file" or $cce->warn('Cannot create Open WebMail domain_override file');
+  print CONF "domainnames $vsite->{domain}";
+  close CONF;
+}
+
 $cce->bye('SUCCESS');
 exit(0);
Personal tools