freebsd-ports/mail/cyrus-imapd2/files/patch-dg
Hajimu UMEMOTO fda290ce5c Add CYRUS_USER and CYRUS_GROUP options to be able to configure
psuedo user for cyrus.

Requested by:	Cyrus Anderson Yunker <cayunker@unity.ncsu.edu>
2003-01-30 14:04:02 +00:00

39 lines
1.1 KiB
Text

Index: tools/mkimap
diff -u tools/mkimap.orig tools/mkimap
--- tools/mkimap.orig Fri Sep 28 01:02:34 2001
+++ tools/mkimap Tue Jan 28 18:00:32 2003
@@ -64,6 +64,9 @@
$nosievedir = 0;
$hashispool = 0;
+$cyrus_user = $ENV{CYRUS_USER} || "%%CYRUS_USER%%";
+$cyrus_group = $ENV{CYRUS_GROUP} || "%%CYRUS_GROUP%%";
+
open CONF, $imapdconf or die "can't open $imapdconf";
print "reading configure file...\n";
while (<CONF>) {
@@ -117,6 +120,8 @@
mkdir "log", 0755;
mkdir "msg", 0755;
+system "/usr/sbin/chown -R $cyrus_user:$cyrus_group .";
+
# create the sieve stuff
if (!$nosievedir) {
print "creating $sievedir...\n";
@@ -125,6 +130,7 @@
if (chdir $sievedir) {
foreach $i ("a".."z") { mkdir "$i", 0755; }
}
+ system "/usr/sbin/chown -R $cyrus_user:$cyrus_group $sievedir";
}
$flag = 0;
@@ -136,6 +142,7 @@
chdir $part or die "couldn't change to partition $part";
mkdir "stage.", 0755;
if ($hashispool) { foreach $i ("a".."z") { mkdir $i, 0755; } }
+ system "/usr/sbin/chown -R $cyrus_user:$cyrus_group $part";
}
print "done\n";