Changeset 178
- Timestamp:
- 09/07/07 22:09:46 (16 months ago)
- Location:
- trunk
- Files:
-
- 2 modified
-
ChangeLog (modified) (1 diff)
-
system_scripts/create_mailfilters.pl (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ChangeLog
r175 r178 9 9 o Added: check if php-imap is enabled 10 10 o Added: lang selection per user/sadmin 11 o Added: md5sum of .mailfiter will be saved to database 11 12 o Improved: removed reload to domain show on save emailaddress 12 13 o Fixed: autoresponder.pl. UTF-8 problems in body -
trunk/system_scripts/create_mailfilters.pl
r171 r178 21 21 use Config::General; 22 22 use Proc::PID::File; 23 use Digest::MD5; 23 24 24 25 my $conf = new Config::General("/etc/cpves/mail_config.conf"); … … 122 123 return $default; 123 124 } 125 } 126 127 sub update_email_option($$$) { 128 my $uid = $_[0]; 129 my $conf = $_[1]; 130 my $value = $_[2]; 131 my $eo_sth = $dbh->prepare("SELECT id FROM email_options WHERE email=? AND conf=?"); 132 $eo_sth->execute($uid,$conf); 133 if ($eo_sth->rows==1) { 134 my @row_eo=$eo_sth->fetchrow_array; 135 my $sql=sprintf("UPDATE email_options SET options=%s WHERE email=%d AND conf=%s", 136 $dbh->quote($value), 137 $dbh->quote($uid), 138 $dbh->quote($conf)); 139 $dbh->do($sql); 140 undef($sql); 141 } 142 else { 143 my $eou_sth = $dbh->prepare("INSERT INTO email_options SET email=?,conf=?,options=?"); 144 $eou_sth->execute($uid,$conf,$value); 145 } 146 return 0; 147 124 148 } 125 149 … … 238 262 undef $handle; 239 263 `chmod 600 $path/.mailfilter`; 264 265 open(FILE , $path ."/.mailfilter"); 266 binmode(FILE); 267 my $md5sum =Digest::MD5->new->addfile(*FILE)->hexdigest; 268 close(FILE); 269 update_email_option($id,"mailfilter_md5",$md5sum); 270 undef($md5sum); 271 240 272 } 241 273 undef $mailfilter;
