MailScanner加密附件問題?
MailScanner可以檢測附件的內容以及類型,請問它能不能給附件加密啊,比如我發現附件是doc類型的就使用:zip -P 123456 aaa.zip aaa.doc給附件加密,替換aaa.doc為aaa.zip。
《解決方案》
好像不能加密
《解決方案》
恩。。。我找到了可以打zip包,但是不能加密!
《解決方案》
我看了它的code,在meesage.pm中(俺是搞C開發的,perl一點兒都不懂)# Create a new zip archive
my $zip = Archive::Zip->new();
foreach $file (@files) {
#JKF 20080331 $zip->addFile("$explodeinto/$file", $file);
$unsafefile = $this->{safefile2file}{$file};
#print STDERR "Adding $file as $unsafefile\n";
MailScanner::Log::InfoLog("Adding zip member name \"%s\"", $file);
$zip->addFile("$explodeinto/$file", $unsafefile);
}
# The new zip file is a normal attachment.
my $safezipname = $this->MakeNameSafe('n'.$newzipname, $explodeinto);
#print STDERR "Writing to zip $safezipname\n";
my $result = $zip->writeToFileNamed($explodeinto . '/' . $safezipname);
unless($result == AZ_OK) {
#print STDERR "Error: Zip file could not be created!\n";
MailScanner::Log::WarnLog("Zip file %s for message %s could not be created",
$safezipname, $this->{id});
return;
}看似比較簡單改成密碼保護的,但是它使用的是Archive的zip庫,這套庫不支持密碼保護功能,google了半天也沒有結果,在perl版塊問也木有人回答。。。:cry: