diff options
author | ivan <ivan> | 2002-09-05 18:51:01 +0000 |
---|---|---|
committer | ivan <ivan> | 2002-09-05 18:51:01 +0000 |
commit | 03fad632a9f62a63486bf69c9a663fc800764f58 (patch) | |
tree | b0d69dcc9fef535899c07befaa0973c2251401e3 /FS | |
parent | afb81dcb0fd47759bb5234d7f5989dc8df0aa502 (diff) |
clear up directory silliness ick
Diffstat (limited to 'FS')
-rw-r--r-- | FS/FS/part_export/vpopmail.pm | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/FS/FS/part_export/vpopmail.pm b/FS/FS/part_export/vpopmail.pm index cc8136e25..4ec6dd0e4 100644 --- a/FS/FS/part_export/vpopmail.pm +++ b/FS/FS/part_export/vpopmail.pm @@ -1,6 +1,6 @@ package FS::part_export::vpopmail; -use vars qw(@ISA @saltset $exportdir $rsync $ssh); +use vars qw(@ISA @saltset $exportdir); use File::Path; use FS::UID qw( datasrc ); use FS::part_export; @@ -9,9 +9,6 @@ use FS::part_export; @saltset = ( 'a'..'z' , 'A'..'Z' , '0'..'9' , '.' , '/' ); -$rsync = "rsync"; -$ssh = "ssh"; - sub rebless { shift; } sub _export_insert { @@ -60,7 +57,15 @@ sub _export_delete { #a good idea to queue anything that could fail or take any time sub vpopmail_queue { my( $self, $svcnum, $method ) = (shift, shift, shift); + my $exportdir = "/usr/local/etc/freeside/export." . datasrc; + mkdir $exportdir, 0700 or die $! unless -d $exportdir; + $exportdir .= "/vpopmail"; + mkdir $exportdir, 0700 or die $! unless -d $exportdir; + $exportdir .= '/'. $self->machine; + mkdir $exportdir, 0700 or die $! unless -d $exportdir; + mkdir "$exportdir/domains", 0700 or die $! unless -d "$exportdir/domains"; + my $queue = new FS::queue { 'svcnum' => $svcnum, 'job' => "FS::part_export::vpopmail::vpopmail_$method", @@ -78,7 +83,10 @@ sub vpopmail_queue { sub vpopmail_insert { #subroutine, not method my( $exportdir, $machine, $dir, $uid, $gid ) = splice @_,0,5; my( $username, $password, $domain, $quota ) = @_; - + + mkdir "$exportdir/domains/$domain", 0700 or die $! + unless -d "$exportdir/domains/$domain"; + (open(VPASSWD, ">>$exportdir/domains/$domain/vpasswd") and flock(VPASSWD,LOCK_EX) ) or die "can't open vpasswd file for $username\@$domain: ". |