[Mimedefang] Saving Headers for report
Jerome Tytgat
jerome.tytgat at asterion.fr
Thu May 6 05:19:48 EDT 2004
thanks, i'll try that !
Steffen Kaiser wrote:
> On Thu, 6 May 2004, Jerome Tytgat wrote:
>
>
>>Is there a possibility, with mimedefang, to automatically save
>>only the headers (I don't want the full mail, as forwarding virus
>>is not a good idea) to a folder using for name the reference number
>>of the mail (also found in MDLOG entries) for easy linking.
>
>
> I do it like so in filter_end():
>
> my $logd = $Features{'Path:QUARANTINEDIR'} . "/maillog";
> if(-d $logd) {
> my $logf = "$logd/${MsgID}-Report-" . localtime() . ".txt";
> if(open(LOG, ">$logf")) {
> print LOG $report;
> if(open(H, 'HEADERS')) {
> print LOG "\nHeaders:\n" . join('', <H>);
> close H;
> } else {
> print LOG "\nFailed to open headers: $!\n";
> }
> close LOG;
> } else {
> skalog "\nFailed to create logfile: $logf: $!\n";
> }
> } else {
> skalog "No maillog dir: $logd";
> }
>
> Bye,
>
--
====================================
> Jérôme Tytgat
Administrateur Réseau et Sécurité
ASTERION - Impasse de la Hache
CP 5911 - 44 477 CARQUEFOU CEDEX
T: 02 40 300 800 - F: 02 40 25 10 74
====================================
More information about the MIMEDefang
mailing list