diff --git a/plugins/content_log b/plugins/content_log index b4f04c4..48f1567 100644 --- a/plugins/content_log +++ b/plugins/content_log @@ -8,9 +8,7 @@ use POSIX qw:strftime:; sub hook_data_post { my ($self, $transaction) = @_; - # as a decent default, log on a per-day-basis - my $date = strftime("%Y%m%d", localtime(time)); - open(my $out, ">>mail/$date") + open my $out, '>>', $self->content_log_file; or return DECLINED, "Could not open log file.. continuing anyway"; $transaction->header->print($out); @@ -23,3 +21,9 @@ sub hook_data_post { return DECLINED, "successfully saved message.. continuing"; } + +sub content_log_file { + # as a decent default, log on a per-day-basis + my $date = strftime("%Y%m%d", localtime(time)); + return "mail/$date"; +}