| 1 | 1 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 2 | package Mail::Audit::Vacation; | ||||||||||||||||||||||||||||
| 3 | { | ||||||||||||||||||||||||||||
| 4 | 1 | $Mail::Audit::Vacation::VERSION = '2.228'; | |||||||||||||||||||||||||||
| 5 | } | ||||||||||||||||||||||||||||
| 6 | # ABSTRACT: perform vacation autoresponding | ||||||||||||||||||||||||||||
| 7 | 1 | ▶ | use Mail::Audit; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 8 | 1 | ▶ | use vars qw($vacfile $message $subject $replyto $from); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 9 | 1 | $vacfile = ".vacation-cache"; | |||||||||||||||||||||||||||
| 10 | 1 | $message = "This user is on vacation."; | |||||||||||||||||||||||||||
| 11 | 1 | $subject = "Vacation autoresponse"; | |||||||||||||||||||||||||||
| 12 | 1 | $replyto = $from = "<>"; | |||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||
| 14 | package Mail::Audit; | ||||||||||||||||||||||||||||
| 15 | { | ||||||||||||||||||||||||||||
| 16 | 1 | $Mail::Audit::VERSION = '2.228'; | |||||||||||||||||||||||||||
| 17 | } | ||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||
| 19 | 0 | ▶ | sub vacation { | ||||||||||||||||||||||||||
|
Subroutine
vacation: not called CC=10 SCAR=45.1
Pod
undocumented
| |||||||||||||||||||||||||||||
| 20 | 0 | my $item = shift; | |||||||||||||||||||||||||||
| 21 | 0 | my $where = shift; | |||||||||||||||||||||||||||
| 22 | 0 | ▶ | my $reply = $item->head->get("Reply-To") | ||||||||||||||||||||||||||
|
Condition0%0/3
$item->head->get('Reply-To') || $item->head->get('From')
MC/DC0%0/2
$item->head->get('Reply-To') || $item->head->get('From')
$item->head->get('Reply-To')
$item->head->get('From')
Truth table0%0/3
A || B
A= $item->head->get('Reply-To')B= $item->head->get('From')
| |||||||||||||||||||||||||||||
| 23 | || $item->head->get("From"); | ||||||||||||||||||||||||||||
| 24 | 0 | ▶ | return if $item->head->get("Distribution") =~ /bulk/i or !$reply; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$item->head->get("Distribution") =~ /bulk/i or not $reply
MC/DC0%0/2
$item->head->get("Distribution") =~ /bulk/i or not $reply
$item->head->get("Distribution") =~ /bulk/i
not $reply
Truth table0%0/3
A or not(B)
A= $item->head->get("Distribution") =~ /bulk/iB= not $reply
| |||||||||||||||||||||||||||||
| 25 | 0 | $item->_log(1, "Vacation thing from $reply"); | |||||||||||||||||||||||||||
| 26 | 0 | ▶ | if (open TOLD, $Mail::Audit::Vacation::vacfile) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 27 | 0 | ▶ | while (<TOLD>) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 28 | 0 | ▶ | if ($_ eq $reply) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 29 | 0 | $item->accept($where); | |||||||||||||||||||||||||||
| 30 | 0 | return 1; # Just in case. | |||||||||||||||||||||||||||
| 31 | } | ||||||||||||||||||||||||||||
| 32 | } | ||||||||||||||||||||||||||||
| 33 | } | ||||||||||||||||||||||||||||
| 34 | 0 | ▶ | if (open TOLD, ">>" . $Mail::Audit::Vacation::vacfile) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 35 | 0 | ▶ | print TOLD $item->head->get("Reply-To") | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 36 | if $item->head->get("Reply-To"); | ||||||||||||||||||||||||||||
| 37 | 0 | ▶ | print TOLD $item->head->get("From") | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 38 | if $item->head->get("From"); | ||||||||||||||||||||||||||||
| 39 | 0 | close TOLD; | |||||||||||||||||||||||||||
| 40 | 1 | ▶ | use Mail::Mailer qw(sendmail); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 41 | 0 | my $out = new Mail::Mailer; | |||||||||||||||||||||||||||
| 42 | 0 | $out->open( | |||||||||||||||||||||||||||
| 43 | { | ||||||||||||||||||||||||||||
| 44 | From => $Mail::Audit::Vacation::from, | ||||||||||||||||||||||||||||
| 45 | Subject => $Mail::Audit::Vacation::subject, | ||||||||||||||||||||||||||||
| 46 | To => $reply, | ||||||||||||||||||||||||||||
| 47 | "Reply-To" => $Mail::Audit::Vacation::replyto | ||||||||||||||||||||||||||||
| 48 | } | ||||||||||||||||||||||||||||
| 49 | ); | ||||||||||||||||||||||||||||
| 50 | 0 | print $out $Mail::Audit::Vacation::message; | |||||||||||||||||||||||||||
| 51 | 0 | $out->close; | |||||||||||||||||||||||||||
| 52 | } | ||||||||||||||||||||||||||||
| 53 | 0 | $item->accept($where); | |||||||||||||||||||||||||||
| 54 | |||||||||||||||||||||||||||||
| 55 | 0 | return 0; | |||||||||||||||||||||||||||
| 56 | } | ||||||||||||||||||||||||||||
| 57 | |||||||||||||||||||||||||||||
| 58 | __END__ | ||||||||||||||||||||||||||||