| 1 | package Mail::Client::Yahoo; | ||||||||||||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||||||||||||
| 3 | 1 | ▶ | use 5.006; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 4 | 1 | our $VERSION = 1.0; | |||||||||||||||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||||||||||||||||
| 6 | #***** Interface *****# | ||||||||||||||||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||||||||||||||||
| 8 | sub login; | ||||||||||||||||||||||||||||||||||||||||||
| 9 | sub logout; | ||||||||||||||||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||||||||||||||||
| 11 | sub folder_list; | ||||||||||||||||||||||||||||||||||||||||||
| 12 | sub select_folder; | ||||||||||||||||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||||||||||||||||
| 14 | sub folder_size; | ||||||||||||||||||||||||||||||||||||||||||
| 15 | sub folder_count; | ||||||||||||||||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||||||||||||||||
| 17 | sub message_list; | ||||||||||||||||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||||||||||||||||
| 19 | sub message_size; | ||||||||||||||||||||||||||||||||||||||||||
| 20 | sub message_head; | ||||||||||||||||||||||||||||||||||||||||||
| 21 | sub message_body; | ||||||||||||||||||||||||||||||||||||||||||
| 22 | sub message; | ||||||||||||||||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||||||||||||||||
| 24 | sub move_message; | ||||||||||||||||||||||||||||||||||||||||||
| 25 | sub delete_message; | ||||||||||||||||||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||||||||||||||||
| 27 | sub send_message; | ||||||||||||||||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||||||||||||||||
| 29 | sub empty_trash; | ||||||||||||||||||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||||||||||||||||
| 31 | #***** Implementation *****# | ||||||||||||||||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||||||||||||||||
| 33 | 1 | ▶ | use WWW::Mechanize; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 34 | 1 | ▶ | use HTML::TableExtract; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 35 | 1 | ▶ | use Mail::Header; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 36 | 1 | ▶ | use Mail::Internet; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||||||||||||||||
| 38 | 1 | our %URLs = ( | |||||||||||||||||||||||||||||||||||||||||
| 39 | login => 'http://mail.yahoo.com/', | ||||||||||||||||||||||||||||||||||||||||||
| 40 | slogin => 'https://login.yahoo.com/config/login?.src=ym', | ||||||||||||||||||||||||||||||||||||||||||
| 41 | logout => 'Logout', | ||||||||||||||||||||||||||||||||||||||||||
| 42 | folders => 'Folders', | ||||||||||||||||||||||||||||||||||||||||||
| 43 | box => 'ShowFolder?sort=date&order=up&box=%s', | ||||||||||||||||||||||||||||||||||||||||||
| 44 | msghead => 'ShowLetter?bodyPart=HEADER&box=%s&MsgId=%s', | ||||||||||||||||||||||||||||||||||||||||||
| 45 | msgbody => 'ShowLetter?bodyPart=TEXT&box=%s&MsgId=%s', | ||||||||||||||||||||||||||||||||||||||||||
| 46 | message => 'ShowLetter?box=%s&MsgId=%s', | ||||||||||||||||||||||||||||||||||||||||||
| 47 | movemsg => 'ShowLetter?MOV=1&.crumb=%s&box=%s&destBox=%s&MsgId=%s', | ||||||||||||||||||||||||||||||||||||||||||
| 48 | delmsg => 'ShowLetter?DEL=%A0Delete%A0&box=%s&MsgId=%s', | ||||||||||||||||||||||||||||||||||||||||||
| 49 | sendmsg => 'Compose', | ||||||||||||||||||||||||||||||||||||||||||
| 50 | ); | ||||||||||||||||||||||||||||||||||||||||||
| 51 | |||||||||||||||||||||||||||||||||||||||||||
| 52 | 1 | our %Patterns = ( | |||||||||||||||||||||||||||||||||||||||||
| 53 | login_form => 'login_form', | ||||||||||||||||||||||||||||||||||||||||||
| 54 | user_field => 'login', | ||||||||||||||||||||||||||||||||||||||||||
| 55 | pass_field => 'passwd', | ||||||||||||||||||||||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||||||||||||||||||||
| 57 | move_form => 'showLetter', | ||||||||||||||||||||||||||||||||||||||||||
| 58 | crumb_field => '.crumb', | ||||||||||||||||||||||||||||||||||||||||||
| 59 | |||||||||||||||||||||||||||||||||||||||||||
| 60 | delete_form => 'showLetter', | ||||||||||||||||||||||||||||||||||||||||||
| 61 | delete_field => 'DEL', | ||||||||||||||||||||||||||||||||||||||||||
| 62 | |||||||||||||||||||||||||||||||||||||||||||
| 63 | send_form => 'Compose', | ||||||||||||||||||||||||||||||||||||||||||
| 64 | to_field => 'To', | ||||||||||||||||||||||||||||||||||||||||||
| 65 | cc_field => 'Cc', | ||||||||||||||||||||||||||||||||||||||||||
| 66 | bcc_field => 'Bcc', | ||||||||||||||||||||||||||||||||||||||||||
| 67 | subject_field => 'Subj', | ||||||||||||||||||||||||||||||||||||||||||
| 68 | body_field => 'Body', | ||||||||||||||||||||||||||||||||||||||||||
| 69 | html_field => 'Format', | ||||||||||||||||||||||||||||||||||||||||||
| 70 | html_value => 'html', | ||||||||||||||||||||||||||||||||||||||||||
| 71 | save_field => 'SaveCopy', | ||||||||||||||||||||||||||||||||||||||||||
| 72 | save_value => 'yes', | ||||||||||||||||||||||||||||||||||||||||||
| 73 | attach_field => 'ATT', | ||||||||||||||||||||||||||||||||||||||||||
| 74 | attach_value => '1', | ||||||||||||||||||||||||||||||||||||||||||
| 75 | send_button => 'SEND', | ||||||||||||||||||||||||||||||||||||||||||
| 76 | send_error => qr/class="errmsg"/i, | ||||||||||||||||||||||||||||||||||||||||||
| 77 | |||||||||||||||||||||||||||||||||||||||||||
| 78 | attach_form => 'Attachments', | ||||||||||||||||||||||||||||||||||||||||||
| 79 | first_field => 'userFile0', | ||||||||||||||||||||||||||||||||||||||||||
| 80 | second_field => 'userFile1', | ||||||||||||||||||||||||||||||||||||||||||
| 81 | third_field => 'userFile2', | ||||||||||||||||||||||||||||||||||||||||||
| 82 | attach_button => 'UPL', | ||||||||||||||||||||||||||||||||||||||||||
| 83 | |||||||||||||||||||||||||||||||||||||||||||
| 84 | aconfirm_form => 'Compose', | ||||||||||||||||||||||||||||||||||||||||||
| 85 | |||||||||||||||||||||||||||||||||||||||||||
| 86 | folder_link => qr/\/ShowFolder\?.*\bbox=((?:%40B%40)?([^&]+))/, | ||||||||||||||||||||||||||||||||||||||||||
| 87 | folder_size => qr/(\d+[MKB])/i, | ||||||||||||||||||||||||||||||||||||||||||
| 88 | folder_unread => qr/(\S+)/, | ||||||||||||||||||||||||||||||||||||||||||
| 89 | |||||||||||||||||||||||||||||||||||||||||||
| 90 | message_link => qr/\/ShowLetter\?.*\bMsgId=([^&]+)/, | ||||||||||||||||||||||||||||||||||||||||||
| 91 | message_size => qr/(\d+[MKB])/i, | ||||||||||||||||||||||||||||||||||||||||||
| 92 | |||||||||||||||||||||||||||||||||||||||||||
| 93 | first_link => qr/^First$/, | ||||||||||||||||||||||||||||||||||||||||||
| 94 | next_link => qr/^Next$/, | ||||||||||||||||||||||||||||||||||||||||||
| 95 | |||||||||||||||||||||||||||||||||||||||||||
| 96 | empty_link => qr/^Empty$/, | ||||||||||||||||||||||||||||||||||||||||||
| 97 | |||||||||||||||||||||||||||||||||||||||||||
| 98 | bad_user => qr/This Yahoo! ID does not exist/i, | ||||||||||||||||||||||||||||||||||||||||||
| 99 | bad_pass => qr/invalid password/i, | ||||||||||||||||||||||||||||||||||||||||||
| 100 | |||||||||||||||||||||||||||||||||||||||||||
| 101 | folder_stats => { | ||||||||||||||||||||||||||||||||||||||||||
| 102 | 'name' => 'Name', | ||||||||||||||||||||||||||||||||||||||||||
| 103 | 'count' => 'Messages', | ||||||||||||||||||||||||||||||||||||||||||
| 104 | 'unread' => 'Unread', | ||||||||||||||||||||||||||||||||||||||||||
| 105 | 'size' => 'Size', | ||||||||||||||||||||||||||||||||||||||||||
| 106 | }, | ||||||||||||||||||||||||||||||||||||||||||
| 107 | message_stats => { | ||||||||||||||||||||||||||||||||||||||||||
| 108 | 'from' => 'Sender', | ||||||||||||||||||||||||||||||||||||||||||
| 109 | 'link' => 'Subject', | ||||||||||||||||||||||||||||||||||||||||||
| 110 | 'date' => 'Date', | ||||||||||||||||||||||||||||||||||||||||||
| 111 | 'size' => 'Size', | ||||||||||||||||||||||||||||||||||||||||||
| 112 | }, | ||||||||||||||||||||||||||||||||||||||||||
| 113 | ); | ||||||||||||||||||||||||||||||||||||||||||
| 114 | |||||||||||||||||||||||||||||||||||||||||||
| 115 | 0 | ▶ | sub DESTROY { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
DESTROY: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||
| 116 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 117 | 0 | $self->logout(); | |||||||||||||||||||||||||||||||||||||||||
| 118 | } | ||||||||||||||||||||||||||||||||||||||||||
| 119 | |||||||||||||||||||||||||||||||||||||||||||
| 120 | 0 | ▶ | sub error { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
error: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 121 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 122 | 0 | $self->{error}->(@_); | |||||||||||||||||||||||||||||||||||||||||
| 123 | } | ||||||||||||||||||||||||||||||||||||||||||
| 124 | |||||||||||||||||||||||||||||||||||||||||||
| 125 | 0 | ▶ | sub login { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
login: not called CC=6 SCAR=37.4
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 126 | 0 | my $class = shift; | |||||||||||||||||||||||||||||||||||||||||
| 127 | 0 | my $self = bless {}, $class; | |||||||||||||||||||||||||||||||||||||||||
| 128 | 0 | my %args = @_; | |||||||||||||||||||||||||||||||||||||||||
| 129 | |||||||||||||||||||||||||||||||||||||||||||
| 130 | 0 | ▶ | $self->{error} = sub { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=3 SCAR=24.8
| |||||||||||||||||||||||||||||||||||||||||||
| 131 | 0 | my $msg = $self->{mech}->res->message; | |||||||||||||||||||||||||||||||||||||||||
| 132 | 0 | ▶ | $msg = shift()."\n" if $msg =~ /^OK/; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 133 | 0 | ▶ | ($args{error} || sub { die @_ })->( | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
Condition0%0/3
$args{'error'} || sub {
die @_;
}
MC/DC0%0/2
$args{'error'} || sub {
die @_;
}
$args{'error'}
sub {
die @_;
}
Truth table0%0/3
A || B
A= $args{'error'}B= sub {
die @_;
}
| |||||||||||||||||||||||||||||||||||||||||||
| 134 | "$self->{phase} failed on $self->{step}: $msg" | ||||||||||||||||||||||||||||||||||||||||||
| 135 | ); | ||||||||||||||||||||||||||||||||||||||||||
| 136 | 0 | }; | |||||||||||||||||||||||||||||||||||||||||
| 137 | |||||||||||||||||||||||||||||||||||||||||||
| 138 | my $mech = $self->{mech} = Mail::Client::Yahoo::Mechanize->new( | ||||||||||||||||||||||||||||||||||||||||||
| 139 | autocheck => 1, | ||||||||||||||||||||||||||||||||||||||||||
| 140 | onerror => $self->{error}, | ||||||||||||||||||||||||||||||||||||||||||
| 141 | onwarn => $self->{error}, | ||||||||||||||||||||||||||||||||||||||||||
| 142 | 0 | ); | |||||||||||||||||||||||||||||||||||||||||
| 143 | |||||||||||||||||||||||||||||||||||||||||||
| 144 | 0 | $self->{phase} = 'Login'; | |||||||||||||||||||||||||||||||||||||||||
| 145 | |||||||||||||||||||||||||||||||||||||||||||
| 146 | 0 | $self->{step} = 'Front Page Retrieval'; | |||||||||||||||||||||||||||||||||||||||||
| 147 | 0 | ▶ | $mech->get($args{secure} ? $URLs{slogin} : $URLs{login}); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 148 | |||||||||||||||||||||||||||||||||||||||||||
| 149 | 0 | $self->{step} = 'Login Submission'; | |||||||||||||||||||||||||||||||||||||||||
| 150 | $mech->submit_form( | ||||||||||||||||||||||||||||||||||||||||||
| 151 | form_name => $Patterns{login_form}, | ||||||||||||||||||||||||||||||||||||||||||
| 152 | fields => { | ||||||||||||||||||||||||||||||||||||||||||
| 153 | $Patterns{user_field} => $args{username}, | ||||||||||||||||||||||||||||||||||||||||||
| 154 | $Patterns{pass_field} => $args{password}, | ||||||||||||||||||||||||||||||||||||||||||
| 155 | }, | ||||||||||||||||||||||||||||||||||||||||||
| 156 | 0 | ); | |||||||||||||||||||||||||||||||||||||||||
| 157 | |||||||||||||||||||||||||||||||||||||||||||
| 158 | 0 | $self->{step} = 'Redirection'; | |||||||||||||||||||||||||||||||||||||||||
| 159 | 0 | ▶ | while(my $redir = $mech->res->header('Location')) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 160 | 0 | $mech->get($redir); | |||||||||||||||||||||||||||||||||||||||||
| 161 | } | ||||||||||||||||||||||||||||||||||||||||||
| 162 | 0 | ▶ | if ( $mech->content =~ m#window.location.replace\("([^"]*?)"# ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 163 | 0 | $mech->get($1); | |||||||||||||||||||||||||||||||||||||||||
| 164 | } | ||||||||||||||||||||||||||||||||||||||||||
| 165 | |||||||||||||||||||||||||||||||||||||||||||
| 166 | 0 | $self->{step} = 'Login'; | |||||||||||||||||||||||||||||||||||||||||
| 167 | 0 | ▶ | if($mech->content =~ $Patterns{bad_user}) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 168 | 0 | $self->error("Invalid username"); | |||||||||||||||||||||||||||||||||||||||||
| 169 | } elsif($mech->content =~ $Patterns{bad_pass}) { | ||||||||||||||||||||||||||||||||||||||||||
| 170 | 0 | $self->error("Invalid password"); | |||||||||||||||||||||||||||||||||||||||||
| 171 | } | ||||||||||||||||||||||||||||||||||||||||||
| 172 | |||||||||||||||||||||||||||||||||||||||||||
| 173 | 0 | $self->{connected} = 1; | |||||||||||||||||||||||||||||||||||||||||
| 174 | |||||||||||||||||||||||||||||||||||||||||||
| 175 | 0 | return $self; | |||||||||||||||||||||||||||||||||||||||||
| 176 | } | ||||||||||||||||||||||||||||||||||||||||||
| 177 | |||||||||||||||||||||||||||||||||||||||||||
| 178 | 0 | ▶ | sub logout { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
logout: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 179 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 180 | 0 | ▶ | return unless $self->{connected}; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 181 | |||||||||||||||||||||||||||||||||||||||||||
| 182 | 0 | $self->{phase} = 'Logout'; | |||||||||||||||||||||||||||||||||||||||||
| 183 | 0 | $self->{step} = 'Logout Submission'; | |||||||||||||||||||||||||||||||||||||||||
| 184 | 0 | $self->{mech}->get($URLs{logout}); | |||||||||||||||||||||||||||||||||||||||||
| 185 | |||||||||||||||||||||||||||||||||||||||||||
| 186 | 0 | undef $self->{mech}; | |||||||||||||||||||||||||||||||||||||||||
| 187 | 0 | %$self = (); | |||||||||||||||||||||||||||||||||||||||||
| 188 | |||||||||||||||||||||||||||||||||||||||||||
| 189 | 0 | return $self; | |||||||||||||||||||||||||||||||||||||||||
| 190 | } | ||||||||||||||||||||||||||||||||||||||||||
| 191 | |||||||||||||||||||||||||||||||||||||||||||
| 192 | |||||||||||||||||||||||||||||||||||||||||||
| 193 | 0 | ▶ | sub _fetch_folder_stats { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_fetch_folder_stats: not called CC=5 SCAR=34.0
| |||||||||||||||||||||||||||||||||||||||||||
| 194 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 195 | |||||||||||||||||||||||||||||||||||||||||||
| 196 | 0 | $self->{step} = 'Folder Stats Retrieval'; | |||||||||||||||||||||||||||||||||||||||||
| 197 | |||||||||||||||||||||||||||||||||||||||||||
| 198 | 0 | $self->{mech}->get($URLs{folders}); | |||||||||||||||||||||||||||||||||||||||||
| 199 | |||||||||||||||||||||||||||||||||||||||||||
| 200 | 0 | my @stats = keys %{$Patterns{folder_stats}}; | |||||||||||||||||||||||||||||||||||||||||
| 201 | 0 | my @cols = @{$Patterns{folder_stats}}{@stats}; | |||||||||||||||||||||||||||||||||||||||||
| 202 | |||||||||||||||||||||||||||||||||||||||||||
| 203 | 0 | my $te = new HTML::TableExtract(headers => [@cols], keep_html => 1); | |||||||||||||||||||||||||||||||||||||||||
| 204 | 0 | $te->parse($self->{mech}->content); | |||||||||||||||||||||||||||||||||||||||||
| 205 | |||||||||||||||||||||||||||||||||||||||||||
| 206 | 0 | foreach my $row ($te->rows) { | |||||||||||||||||||||||||||||||||||||||||
| 207 | 0 | my %stats; | |||||||||||||||||||||||||||||||||||||||||
| 208 | 0 | @stats{@stats} = @$row; | |||||||||||||||||||||||||||||||||||||||||
| 209 | 0 | ▶ | next unless $stats{name} =~ $Patterns{folder_link}; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 210 | 0 | $stats{box} = $1; | |||||||||||||||||||||||||||||||||||||||||
| 211 | 0 | $stats{name} = $2; | |||||||||||||||||||||||||||||||||||||||||
| 212 | 0 | ▶ | $stats{size} = $1 if $stats{size} =~ $Patterns{folder_size}; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 213 | 0 | ▶ | $stats{unread} = $1 if $stats{unread} =~ $Patterns{folder_unread}; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 214 | 0 | %{$self->{folder_list}{$stats{name}}} = %stats; | |||||||||||||||||||||||||||||||||||||||||
| 215 | } | ||||||||||||||||||||||||||||||||||||||||||
| 216 | } | ||||||||||||||||||||||||||||||||||||||||||
| 217 | |||||||||||||||||||||||||||||||||||||||||||
| 218 | 0 | ▶ | sub folder_list { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
folder_list: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 219 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 220 | 0 | $self->{phase} = 'Folder List'; | |||||||||||||||||||||||||||||||||||||||||
| 221 | 0 | ▶ | $self->_fetch_folder_stats() unless exists $self->{folder_list}; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 222 | 0 | return keys %{$self->{folder_list}}; | |||||||||||||||||||||||||||||||||||||||||
| 223 | } | ||||||||||||||||||||||||||||||||||||||||||
| 224 | |||||||||||||||||||||||||||||||||||||||||||
| 225 | 0 | ▶ | sub select_folder { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
select_folder: not called CC=4 SCAR=30.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 226 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 227 | 0 | my $name = shift; | |||||||||||||||||||||||||||||||||||||||||
| 228 | |||||||||||||||||||||||||||||||||||||||||||
| 229 | 0 | ▶ | return if $name eq $self->{current_folder}; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 230 | |||||||||||||||||||||||||||||||||||||||||||
| 231 | 0 | $self->{phase} = 'Select Folder'; | |||||||||||||||||||||||||||||||||||||||||
| 232 | |||||||||||||||||||||||||||||||||||||||||||
| 233 | 0 | ▶ | $self->_fetch_folder_stats() unless exists $self->{folder_list}; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 234 | |||||||||||||||||||||||||||||||||||||||||||
| 235 | 0 | $self->{step} = 'Folder Existance'; | |||||||||||||||||||||||||||||||||||||||||
| 236 | |||||||||||||||||||||||||||||||||||||||||||
| 237 | $self->error("Folder `$name' does not exist") | ||||||||||||||||||||||||||||||||||||||||||
| 238 | 0 | ▶ | unless exists $self->{folder_list}{$name}; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 239 | |||||||||||||||||||||||||||||||||||||||||||
| 240 | 0 | $self->{current_folder} = $name; | |||||||||||||||||||||||||||||||||||||||||
| 241 | |||||||||||||||||||||||||||||||||||||||||||
| 242 | 0 | delete $self->{message_list}; | |||||||||||||||||||||||||||||||||||||||||
| 243 | 0 | delete $self->{message_stats}; | |||||||||||||||||||||||||||||||||||||||||
| 244 | |||||||||||||||||||||||||||||||||||||||||||
| 245 | 0 | return $self->{folder_list}{$name}{size}; | |||||||||||||||||||||||||||||||||||||||||
| 246 | } | ||||||||||||||||||||||||||||||||||||||||||
| 247 | |||||||||||||||||||||||||||||||||||||||||||
| 248 | 0 | ▶ | sub folder_size { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
folder_size: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 249 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 250 | 0 | ▶ | my $box = shift() || $self->{current_folder}; | ||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/3
shift() || $self->{'current_folder'}
MC/DC0%0/2
shift() || $self->{'current_folder'}
shift()
$self->{'current_folder'}
Truth table0%0/3
A || B
A= shift()B= $self->{'current_folder'}
| |||||||||||||||||||||||||||||||||||||||||||
| 251 | 0 | $self->{phase} = 'Folder Size'; | |||||||||||||||||||||||||||||||||||||||||
| 252 | 0 | ▶ | $self->_fetch_folder_stats() unless exists $self->{folder_list}; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 253 | 0 | return $self->{folder_list}{$box}{size}; | |||||||||||||||||||||||||||||||||||||||||
| 254 | } | ||||||||||||||||||||||||||||||||||||||||||
| 255 | |||||||||||||||||||||||||||||||||||||||||||
| 256 | 0 | ▶ | sub folder_count { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
folder_count: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 257 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 258 | 0 | ▶ | my $box = shift() || $self->{current_folder}; | ||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/3
shift() || $self->{'current_folder'}
MC/DC0%0/2
shift() || $self->{'current_folder'}
shift()
$self->{'current_folder'}
Truth table0%0/3
A || B
A= shift()B= $self->{'current_folder'}
| |||||||||||||||||||||||||||||||||||||||||||
| 259 | 0 | $self->{phase} = 'Folder Count'; | |||||||||||||||||||||||||||||||||||||||||
| 260 | 0 | ▶ | $self->_fetch_folder_stats() unless exists $self->{folder_list}; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 261 | 0 | return $self->{folder_list}{$box}{count}; | |||||||||||||||||||||||||||||||||||||||||
| 262 | } | ||||||||||||||||||||||||||||||||||||||||||
| 263 | |||||||||||||||||||||||||||||||||||||||||||
| 264 | |||||||||||||||||||||||||||||||||||||||||||
| 265 | 0 | ▶ | sub _fetch_message_list { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_fetch_message_list: not called CC=6 SCAR=37.4
| |||||||||||||||||||||||||||||||||||||||||||
| 266 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 267 | |||||||||||||||||||||||||||||||||||||||||||
| 268 | 0 | $self->{step} = 'Message List Retrieval'; | |||||||||||||||||||||||||||||||||||||||||
| 269 | |||||||||||||||||||||||||||||||||||||||||||
| 270 | 0 | ▶ | $self->error('No folder selected') unless defined $self->{current_folder}; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 271 | |||||||||||||||||||||||||||||||||||||||||||
| 272 | # Read the folder, and make sure we're on the first page | ||||||||||||||||||||||||||||||||||||||||||
| 273 | 0 | $self->{mech}->get(sprintf $URLs{box}, $self->{current_folder}); | |||||||||||||||||||||||||||||||||||||||||
| 274 | 0 | $self->{mech}->follow_link(text_regex => $Patterns{first_link}); | |||||||||||||||||||||||||||||||||||||||||
| 275 | |||||||||||||||||||||||||||||||||||||||||||
| 276 | do { | ||||||||||||||||||||||||||||||||||||||||||
| 277 | 0 | my @stats = keys %{$Patterns{message_stats}}; | |||||||||||||||||||||||||||||||||||||||||
| 278 | 0 | my @cols = @{$Patterns{message_stats}}{@stats}; | |||||||||||||||||||||||||||||||||||||||||
| 279 | 0 | my $te = new HTML::TableExtract(headers => [@cols], keep_html => 1); | |||||||||||||||||||||||||||||||||||||||||
| 280 | 0 | $te->parse($self->{mech}->content); | |||||||||||||||||||||||||||||||||||||||||
| 281 | 0 | foreach my $row ($te->rows) { | |||||||||||||||||||||||||||||||||||||||||
| 282 | 0 | my %stats; | |||||||||||||||||||||||||||||||||||||||||
| 283 | 0 | @stats{@stats} = @$row; | |||||||||||||||||||||||||||||||||||||||||
| 284 | 0 | ▶ | next unless $stats{link} =~ $Patterns{message_link}; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 285 | 0 | $stats{msgid} = $1; | |||||||||||||||||||||||||||||||||||||||||
| 286 | 0 | ▶ | $stats{size} = $1 if $stats{size} =~ $Patterns{message_size}; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 287 | 0 | push @{$self->{message_list}}, $stats{msgid}; | |||||||||||||||||||||||||||||||||||||||||
| 288 | 0 | %{$self->{message_stats}{$stats{msgid}}} = %stats; | |||||||||||||||||||||||||||||||||||||||||
| 289 | } | ||||||||||||||||||||||||||||||||||||||||||
| 290 | 0 | ▶ | } while($self->{mech}->follow_link(text_regex => $Patterns{next_link})); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 291 | } | ||||||||||||||||||||||||||||||||||||||||||
| 292 | |||||||||||||||||||||||||||||||||||||||||||
| 293 | |||||||||||||||||||||||||||||||||||||||||||
| 294 | 0 | ▶ | sub _id_or_index { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_id_or_index: not called CC=5 SCAR=34.0
| |||||||||||||||||||||||||||||||||||||||||||
| 295 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 296 | 0 | my $i = shift; | |||||||||||||||||||||||||||||||||||||||||
| 297 | |||||||||||||||||||||||||||||||||||||||||||
| 298 | 0 | ▶ | $self->_fetch_message_list() unless exists $self->{message_list}; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 299 | |||||||||||||||||||||||||||||||||||||||||||
| 300 | 0 | ▶ | return $i if exists $self->{message_stats}{$i}; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 301 | 0 | ▶ | return $self->{message_list}[$i] if 0 <= $i && $i < @{$self->{message_list}}; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
0 <= $i and $i < @{$self->{"message_list"};}
MC/DC0%0/2
0 <= $i and $i < @{$self->{"message_list"};}
0 <= $i
$i < @{$self->{"message_list"};}
Truth table0%0/3
A and B
A= 0 <= $iB= $i < @{$self->{"message_list"};}
| |||||||||||||||||||||||||||||||||||||||||||
| 302 | 0 | $self->error("Invalid message id: $i"); | |||||||||||||||||||||||||||||||||||||||||
| 303 | } | ||||||||||||||||||||||||||||||||||||||||||
| 304 | |||||||||||||||||||||||||||||||||||||||||||
| 305 | |||||||||||||||||||||||||||||||||||||||||||
| 306 | 0 | ▶ | sub message_list { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
message_list: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 307 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 308 | 0 | $self->{phase} = 'Message List'; | |||||||||||||||||||||||||||||||||||||||||
| 309 | 0 | ▶ | $self->_fetch_message_list() unless exists $self->{message_list}; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 310 | 0 | return @{$self->{message_list}}; | |||||||||||||||||||||||||||||||||||||||||
| 311 | } | ||||||||||||||||||||||||||||||||||||||||||
| 312 | |||||||||||||||||||||||||||||||||||||||||||
| 313 | |||||||||||||||||||||||||||||||||||||||||||
| 314 | 0 | ▶ | sub message_size { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
message_size: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 315 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 316 | |||||||||||||||||||||||||||||||||||||||||||
| 317 | 0 | $self->{phase} = 'Message Size'; | |||||||||||||||||||||||||||||||||||||||||
| 318 | 0 | $self->{step} = 'Message Size'; | |||||||||||||||||||||||||||||||||||||||||
| 319 | |||||||||||||||||||||||||||||||||||||||||||
| 320 | 0 | my $msgid = $self->_id_or_index(shift); | |||||||||||||||||||||||||||||||||||||||||
| 321 | |||||||||||||||||||||||||||||||||||||||||||
| 322 | 0 | return $self->{message_stats}{$msgid}{size}; | |||||||||||||||||||||||||||||||||||||||||
| 323 | } | ||||||||||||||||||||||||||||||||||||||||||
| 324 | |||||||||||||||||||||||||||||||||||||||||||
| 325 | 0 | ▶ | sub message_head { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
message_head: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 326 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 327 | |||||||||||||||||||||||||||||||||||||||||||
| 328 | 0 | $self->{phase} = 'Message Headers'; | |||||||||||||||||||||||||||||||||||||||||
| 329 | 0 | $self->{step} = 'Header Retrieval'; | |||||||||||||||||||||||||||||||||||||||||
| 330 | |||||||||||||||||||||||||||||||||||||||||||
| 331 | 0 | my $msgid = $self->_id_or_index(shift); | |||||||||||||||||||||||||||||||||||||||||
| 332 | |||||||||||||||||||||||||||||||||||||||||||
| 333 | 0 | $self->{mech}->get(sprintf $URLs{msghead}, $self->{current_folder}, $msgid); | |||||||||||||||||||||||||||||||||||||||||
| 334 | |||||||||||||||||||||||||||||||||||||||||||
| 335 | 0 | return Mail::Header->new([split /(?<=\n)/, $self->{mech}->content]); | |||||||||||||||||||||||||||||||||||||||||
| 336 | } | ||||||||||||||||||||||||||||||||||||||||||
| 337 | |||||||||||||||||||||||||||||||||||||||||||
| 338 | 0 | ▶ | sub message_body { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
message_body: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 339 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 340 | |||||||||||||||||||||||||||||||||||||||||||
| 341 | 0 | $self->{phase} = 'Message Body'; | |||||||||||||||||||||||||||||||||||||||||
| 342 | 0 | $self->{step} = 'Body Retrieval'; | |||||||||||||||||||||||||||||||||||||||||
| 343 | |||||||||||||||||||||||||||||||||||||||||||
| 344 | 0 | my $msgid = $self->_id_or_index(shift); | |||||||||||||||||||||||||||||||||||||||||
| 345 | |||||||||||||||||||||||||||||||||||||||||||
| 346 | 0 | $self->{mech}->get(sprintf $URLs{msgbody}, $self->{current_folder}, $msgid); | |||||||||||||||||||||||||||||||||||||||||
| 347 | |||||||||||||||||||||||||||||||||||||||||||
| 348 | return Mail::Internet->new( | ||||||||||||||||||||||||||||||||||||||||||
| 349 | 0 | Body => [split /(?<=\n)/, $self->{mech}->content], | |||||||||||||||||||||||||||||||||||||||||
| 350 | ); | ||||||||||||||||||||||||||||||||||||||||||
| 351 | } | ||||||||||||||||||||||||||||||||||||||||||
| 352 | |||||||||||||||||||||||||||||||||||||||||||
| 353 | 0 | ▶ | sub message { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
message: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 354 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 355 | |||||||||||||||||||||||||||||||||||||||||||
| 356 | 0 | $self->{phase} = 'Message'; | |||||||||||||||||||||||||||||||||||||||||
| 357 | 0 | $self->{step} = 'Message Retrieval'; | |||||||||||||||||||||||||||||||||||||||||
| 358 | |||||||||||||||||||||||||||||||||||||||||||
| 359 | 0 | my $msgid = $self->_id_or_index(shift); | |||||||||||||||||||||||||||||||||||||||||
| 360 | |||||||||||||||||||||||||||||||||||||||||||
| 361 | 0 | return Mail::Internet->new( | |||||||||||||||||||||||||||||||||||||||||
| 362 | Header => $self->message_head($msgid), | ||||||||||||||||||||||||||||||||||||||||||
| 363 | Body => $self->message_body($msgid)->body, | ||||||||||||||||||||||||||||||||||||||||||
| 364 | ); | ||||||||||||||||||||||||||||||||||||||||||
| 365 | } | ||||||||||||||||||||||||||||||||||||||||||
| 366 | |||||||||||||||||||||||||||||||||||||||||||
| 367 | |||||||||||||||||||||||||||||||||||||||||||
| 368 | 0 | ▶ | sub move_message { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
move_message: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 369 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 370 | |||||||||||||||||||||||||||||||||||||||||||
| 371 | 0 | $self->{phase} = 'Move Message'; | |||||||||||||||||||||||||||||||||||||||||
| 372 | 0 | $self->{step} = 'Input Validation'; | |||||||||||||||||||||||||||||||||||||||||
| 373 | |||||||||||||||||||||||||||||||||||||||||||
| 374 | 0 | my $msgid = $self->_id_or_index(shift); | |||||||||||||||||||||||||||||||||||||||||
| 375 | 0 | my $dest = shift; | |||||||||||||||||||||||||||||||||||||||||
| 376 | |||||||||||||||||||||||||||||||||||||||||||
| 377 | $self->error("Invalid folder") | ||||||||||||||||||||||||||||||||||||||||||
| 378 | 0 | ▶ | unless exists $self->{folder_list}{$dest}; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 379 | |||||||||||||||||||||||||||||||||||||||||||
| 380 | 0 | $self->{step} = 'Message Selection'; | |||||||||||||||||||||||||||||||||||||||||
| 381 | 0 | $self->{mech}->get(sprintf $URLs{message}, $self->{current_folder}, $msgid); | |||||||||||||||||||||||||||||||||||||||||
| 382 | |||||||||||||||||||||||||||||||||||||||||||
| 383 | # Would that I could just submit the 'Move to folder' form, | ||||||||||||||||||||||||||||||||||||||||||
| 384 | # but alas, HTML::Form (and by extension WWW::Mechanize) | ||||||||||||||||||||||||||||||||||||||||||
| 385 | # doesn't allow a SELECT to take on a value not in the OPTION | ||||||||||||||||||||||||||||||||||||||||||
| 386 | # list. It doesn't even provide a way to override it. Crappy. :( | ||||||||||||||||||||||||||||||||||||||||||
| 387 | # So, instead, I must extract the crumb and fetch manually. | ||||||||||||||||||||||||||||||||||||||||||
| 388 | 0 | $self->{step} = 'Move Submission'; | |||||||||||||||||||||||||||||||||||||||||
| 389 | 0 | $self->{mech}->form_name($Patterns{move_form}); | |||||||||||||||||||||||||||||||||||||||||
| 390 | 0 | my $crumb = $self->{mech}->current_form->value($Patterns{crumb_field}); | |||||||||||||||||||||||||||||||||||||||||
| 391 | $self->{mech}->get( | ||||||||||||||||||||||||||||||||||||||||||
| 392 | 0 | sprintf $URLs{movemsg}, $crumb, $self->{current_folder}, $dest, $msgid | |||||||||||||||||||||||||||||||||||||||||
| 393 | ); | ||||||||||||||||||||||||||||||||||||||||||
| 394 | } | ||||||||||||||||||||||||||||||||||||||||||
| 395 | |||||||||||||||||||||||||||||||||||||||||||
| 396 | 0 | ▶ | sub delete_message { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
delete_message: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 397 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 398 | |||||||||||||||||||||||||||||||||||||||||||
| 399 | 0 | $self->{phase} = 'Delete Message'; | |||||||||||||||||||||||||||||||||||||||||
| 400 | 0 | $self->{step} = 'Input Validation'; | |||||||||||||||||||||||||||||||||||||||||
| 401 | |||||||||||||||||||||||||||||||||||||||||||
| 402 | 0 | my $msgid = $self->_id_or_index(shift); | |||||||||||||||||||||||||||||||||||||||||
| 403 | |||||||||||||||||||||||||||||||||||||||||||
| 404 | 0 | $self->{step} = 'Message Selection'; | |||||||||||||||||||||||||||||||||||||||||
| 405 | 0 | $self->{mech}->get(sprintf $URLs{message}, $self->{current_folder}, $msgid); | |||||||||||||||||||||||||||||||||||||||||
| 406 | |||||||||||||||||||||||||||||||||||||||||||
| 407 | 0 | $self->{step} = 'Delete Submission'; | |||||||||||||||||||||||||||||||||||||||||
| 408 | $self->{mech}->submit_form( | ||||||||||||||||||||||||||||||||||||||||||
| 409 | form_name => $Patterns{delete_form}, | ||||||||||||||||||||||||||||||||||||||||||
| 410 | button => $Patterns{delete_field}, | ||||||||||||||||||||||||||||||||||||||||||
| 411 | 0 | ); | |||||||||||||||||||||||||||||||||||||||||
| 412 | } | ||||||||||||||||||||||||||||||||||||||||||
| 413 | |||||||||||||||||||||||||||||||||||||||||||
| 414 | |||||||||||||||||||||||||||||||||||||||||||
| 415 | 0 | ▶ | sub send_message { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
send_message: not called CC=17 SCAR=57.2
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 416 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 417 | 0 | my %args = @_; | |||||||||||||||||||||||||||||||||||||||||
| 418 | 0 | my $mech = $self->{mech}; | |||||||||||||||||||||||||||||||||||||||||
| 419 | |||||||||||||||||||||||||||||||||||||||||||
| 420 | 0 | $self->{phase} = 'Send Message'; | |||||||||||||||||||||||||||||||||||||||||
| 421 | |||||||||||||||||||||||||||||||||||||||||||
| 422 | 0 | $self->{step} = 'Input Validation'; | |||||||||||||||||||||||||||||||||||||||||
| 423 | 0 | ▶ | $self->error('No recipient specified') unless exists $args{to}; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 424 | 0 | ▶ | $self->error('No subject specified') unless exists $args{subject}; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 425 | 0 | ▶ | $self->error('No body specified') unless exists $args{body}; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 426 | |||||||||||||||||||||||||||||||||||||||||||
| 427 | 0 | $self->{step} = 'Form Retrieval'; | |||||||||||||||||||||||||||||||||||||||||
| 428 | 0 | $mech->get($URLs{sendmsg}); | |||||||||||||||||||||||||||||||||||||||||
| 429 | |||||||||||||||||||||||||||||||||||||||||||
| 430 | 0 | ▶ | if($args{attach}) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 431 | 0 | $self->{step} = 'Attach Files'; | |||||||||||||||||||||||||||||||||||||||||
| 432 | $mech->submit_form( | ||||||||||||||||||||||||||||||||||||||||||
| 433 | form_name => $Patterns{send_form}, | ||||||||||||||||||||||||||||||||||||||||||
| 434 | fields => { | ||||||||||||||||||||||||||||||||||||||||||
| 435 | $Patterns{attach_field} => $Patterns{attach_value}, | ||||||||||||||||||||||||||||||||||||||||||
| 436 | }, | ||||||||||||||||||||||||||||||||||||||||||
| 437 | 0 | ); | |||||||||||||||||||||||||||||||||||||||||
| 438 | $mech->submit_form( | ||||||||||||||||||||||||||||||||||||||||||
| 439 | form_name => $Patterns{attach_form}, | ||||||||||||||||||||||||||||||||||||||||||
| 440 | fields => { | ||||||||||||||||||||||||||||||||||||||||||
| 441 | @$args{attach} >= 0 ? ($Patterns{first_field} => $args{attach}[0]) :() | ||||||||||||||||||||||||||||||||||||||||||
| 442 | , | ||||||||||||||||||||||||||||||||||||||||||
| 443 | @$args{attach} >= 1 ? ($Patterns{second_field} => $args{attach}[1]) :() | ||||||||||||||||||||||||||||||||||||||||||
| 444 | , | ||||||||||||||||||||||||||||||||||||||||||
| 445 | @$args{attach} >= 2 ? ($Patterns{third_field} => $args{attach}[2]) :() | ||||||||||||||||||||||||||||||||||||||||||
| 446 | , | ||||||||||||||||||||||||||||||||||||||||||
| 447 | }, | ||||||||||||||||||||||||||||||||||||||||||
| 448 | button => $Patterns{attach_button}, | ||||||||||||||||||||||||||||||||||||||||||
| 449 | 0 | ▶ | ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 3 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 450 | $mech->submit_form( | ||||||||||||||||||||||||||||||||||||||||||
| 451 | form_name => $Patterns{aconfirm_form}, | ||||||||||||||||||||||||||||||||||||||||||
| 452 | ) | ||||||||||||||||||||||||||||||||||||||||||
| 453 | 0 | } | |||||||||||||||||||||||||||||||||||||||||
| 454 | |||||||||||||||||||||||||||||||||||||||||||
| 455 | # HTML::Form doesn't allow you to set the value of certain inputs to | ||||||||||||||||||||||||||||||||||||||||||
| 456 | # something other than the values supplied by the webpage. Nor does | ||||||||||||||||||||||||||||||||||||||||||
| 457 | # it provide a way to add new values to that list. However, some | ||||||||||||||||||||||||||||||||||||||||||
| 458 | # websites use JavaScript to set the inputs to new values, and we | ||||||||||||||||||||||||||||||||||||||||||
| 459 | # need to emulate that. Thus, we have to manually add the value to | ||||||||||||||||||||||||||||||||||||||||||
| 460 | # the list of possible values, and then select it. | ||||||||||||||||||||||||||||||||||||||||||
| 461 | 0 | $mech->form_name($Patterns{send_form}); | |||||||||||||||||||||||||||||||||||||||||
| 462 | 0 | ▶ | if($args{html}) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 463 | 0 | my $cb = $mech->current_form()->find_input($Patterns{html_field}, undef, 0) | |||||||||||||||||||||||||||||||||||||||||
| 464 | ; | ||||||||||||||||||||||||||||||||||||||||||
| 465 | 0 | push @{$cb->{menu}}, $Patterns{html_value}; | |||||||||||||||||||||||||||||||||||||||||
| 466 | 0 | $cb->value($Patterns{html_value}); | |||||||||||||||||||||||||||||||||||||||||
| 467 | } | ||||||||||||||||||||||||||||||||||||||||||
| 468 | |||||||||||||||||||||||||||||||||||||||||||
| 469 | $mech->submit_form( | ||||||||||||||||||||||||||||||||||||||||||
| 470 | form_name => $Patterns{send_form}, | ||||||||||||||||||||||||||||||||||||||||||
| 471 | fields => { | ||||||||||||||||||||||||||||||||||||||||||
| 472 | (exists $args{to} ? ($Patterns{to_field} => $args{to}) :()) | ||||||||||||||||||||||||||||||||||||||||||
| 473 | , | ||||||||||||||||||||||||||||||||||||||||||
| 474 | (exists $args{cc} ? ($Patterns{cc_field} => $args{cc}) :()) | ||||||||||||||||||||||||||||||||||||||||||
| 475 | , | ||||||||||||||||||||||||||||||||||||||||||
| 476 | (exists $args{bcc} ? ($Patterns{bcc_field} => $args{bcc}) :()) | ||||||||||||||||||||||||||||||||||||||||||
| 477 | , | ||||||||||||||||||||||||||||||||||||||||||
| 478 | (exists $args{subject} ? ($Patterns{subject_field} => $args{subject}):()) | ||||||||||||||||||||||||||||||||||||||||||
| 479 | , | ||||||||||||||||||||||||||||||||||||||||||
| 480 | (exists $args{body} ? ($Patterns{body_field} => $args{body}) :()) | ||||||||||||||||||||||||||||||||||||||||||
| 481 | , | ||||||||||||||||||||||||||||||||||||||||||
| 482 | ( | ||||||||||||||||||||||||||||||||||||||||||
| 483 | exists $args{save} ? ( | ||||||||||||||||||||||||||||||||||||||||||
| 484 | $Patterns{save_field} => $args{save} ? $Patterns{save_value} : undef, | ||||||||||||||||||||||||||||||||||||||||||
| 485 | ) : () | ||||||||||||||||||||||||||||||||||||||||||
| 486 | ), | ||||||||||||||||||||||||||||||||||||||||||
| 487 | }, | ||||||||||||||||||||||||||||||||||||||||||
| 488 | button => $Patterns{send_button}, | ||||||||||||||||||||||||||||||||||||||||||
| 489 | 0 | ▶ | ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 7 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 490 | |||||||||||||||||||||||||||||||||||||||||||
| 491 | 0 | ▶ | if($mech->response->as_string() =~ $Patterns{send_error}) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 492 | 0 | $self->error('Error sending message'); | |||||||||||||||||||||||||||||||||||||||||
| 493 | } | ||||||||||||||||||||||||||||||||||||||||||
| 494 | } | ||||||||||||||||||||||||||||||||||||||||||
| 495 | |||||||||||||||||||||||||||||||||||||||||||
| 496 | |||||||||||||||||||||||||||||||||||||||||||
| 497 | 0 | ▶ | sub empty_trash { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
empty_trash: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 498 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 499 | |||||||||||||||||||||||||||||||||||||||||||
| 500 | 0 | $self->{phase} = 'Empty Trash'; | |||||||||||||||||||||||||||||||||||||||||
| 501 | 0 | $self->{step} = 'Folder List Retrieval'; | |||||||||||||||||||||||||||||||||||||||||
| 502 | 0 | $self->{mech}->get($URLs{folders}); | |||||||||||||||||||||||||||||||||||||||||
| 503 | |||||||||||||||||||||||||||||||||||||||||||
| 504 | 0 | $self->{step} = 'Empty Submission'; | |||||||||||||||||||||||||||||||||||||||||
| 505 | 0 | $self->{mech}->follow_link(text_regex => $Patterns{empty_link}); | |||||||||||||||||||||||||||||||||||||||||
| 506 | } | ||||||||||||||||||||||||||||||||||||||||||
| 507 | |||||||||||||||||||||||||||||||||||||||||||
| 508 | |||||||||||||||||||||||||||||||||||||||||||
| 509 | #***** WWW::Mechanize Subclass *****# | ||||||||||||||||||||||||||||||||||||||||||
| 510 | |||||||||||||||||||||||||||||||||||||||||||
| 511 | package Mail::Client::Yahoo::Mechanize; | ||||||||||||||||||||||||||||||||||||||||||
| 512 | |||||||||||||||||||||||||||||||||||||||||||
| 513 | 1 | ▶ | use base 'WWW::Mechanize'; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 514 | |||||||||||||||||||||||||||||||||||||||||||
| 515 | # We subclass WWW::Mechanize to try to catch error messages from Yahoo | ||||||||||||||||||||||||||||||||||||||||||
| 516 | 0 | ▶ | sub get { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get: not called CC=4 SCAR=30.0
| |||||||||||||||||||||||||||||||||||||||||||
| 517 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 518 | 0 | my $resp = $self->SUPER::get(@_); | |||||||||||||||||||||||||||||||||||||||||
| 519 | |||||||||||||||||||||||||||||||||||||||||||
| 520 | # This might be a little fragile. Not too much, though. | ||||||||||||||||||||||||||||||||||||||||||
| 521 | 0 | ▶ | if( | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/6
$self->content =~ /<!--\s*start error\s*-->/ and $self->content =~ /<!--\s*end error\s*-->/ and $self->content =~ /<!--\s*error code:\s+((?:\w+\s?)+)\s+-->/
$self->content =~ /<!--\s*start error\s*-->/ and $self->content =~ /<!--\s*end error\s*-->/
MC/DC0%0/3
$self->content =~ /<!--\s*start error\s*-->/ and $self->content =~ /<!--\s*end error\s*-->/ and $self->content =~ /<!--\s*error code:\s+((?:\w+\s?)+)\s+-->/
$self->content =~ /<!--\s*start error\s*-->/
$self->content =~ /<!--\s*end error\s*-->/
$self->content =~ /<!--\s*error code:\s+((?:\w+\s?)+)\s+-->/
Truth table0%0/4
A and B and C
A= $self->content =~ /<!--\s*start error\s*-->/B= $self->content =~ /<!--\s*end error\s*-->/C= $self->content =~ /<!--\s*error code:\s+((?:\w+\s?)+)\s+-->/
| |||||||||||||||||||||||||||||||||||||||||||
| 522 | $self->content =~ /<!--\s*start error\s*-->/ | ||||||||||||||||||||||||||||||||||||||||||
| 523 | && | ||||||||||||||||||||||||||||||||||||||||||
| 524 | $self->content =~ /<!--\s*end error\s*-->/ | ||||||||||||||||||||||||||||||||||||||||||
| 525 | && | ||||||||||||||||||||||||||||||||||||||||||
| 526 | $self->content =~ /<!--\s*error code:\s+((?:\w+\s?)+)\s+-->/ | ||||||||||||||||||||||||||||||||||||||||||
| 527 | ) { | ||||||||||||||||||||||||||||||||||||||||||
| 528 | 0 | $self->die("Yahoo error: $1"); | |||||||||||||||||||||||||||||||||||||||||
| 529 | } | ||||||||||||||||||||||||||||||||||||||||||
| 530 | |||||||||||||||||||||||||||||||||||||||||||
| 531 | 0 | return $resp; | |||||||||||||||||||||||||||||||||||||||||
| 532 | } | ||||||||||||||||||||||||||||||||||||||||||
| 533 | |||||||||||||||||||||||||||||||||||||||||||
| 534 | =head1 NAME | ||||||||||||||||||||||||||||||||||||||||||
| 535 | |||||||||||||||||||||||||||||||||||||||||||
| 536 | Mail::Client::Yahoo - Programmatically access Yahoo's web-based email | ||||||||||||||||||||||||||||||||||||||||||
| 537 | |||||||||||||||||||||||||||||||||||||||||||
| 538 | =head1 SYNOPSIS | ||||||||||||||||||||||||||||||||||||||||||
| 539 | |||||||||||||||||||||||||||||||||||||||||||
| 540 | use Mail::Client::Yahoo; | ||||||||||||||||||||||||||||||||||||||||||
| 541 | |||||||||||||||||||||||||||||||||||||||||||
| 542 | $y = Mail::Client::Yahoo->login( | ||||||||||||||||||||||||||||||||||||||||||
| 543 | username => 'bob', | ||||||||||||||||||||||||||||||||||||||||||
| 544 | password => 'secret', | ||||||||||||||||||||||||||||||||||||||||||
| 545 | secure => 1, # for the paranoid and patient | ||||||||||||||||||||||||||||||||||||||||||
| 546 | ); | ||||||||||||||||||||||||||||||||||||||||||
| 547 | |||||||||||||||||||||||||||||||||||||||||||
| 548 | $y->select_folder('Inbox'); | ||||||||||||||||||||||||||||||||||||||||||
| 549 | |||||||||||||||||||||||||||||||||||||||||||
| 550 | $m = $y->message(0); # is equivalent to... | ||||||||||||||||||||||||||||||||||||||||||
| 551 | @ids = $y->message_list(); | ||||||||||||||||||||||||||||||||||||||||||
| 552 | $y->message($id[0]); | ||||||||||||||||||||||||||||||||||||||||||
| 553 | |||||||||||||||||||||||||||||||||||||||||||
| 554 | $y->delete_message(0); | ||||||||||||||||||||||||||||||||||||||||||
| 555 | |||||||||||||||||||||||||||||||||||||||||||
| 556 | $y->logout(); | ||||||||||||||||||||||||||||||||||||||||||
| 557 | |||||||||||||||||||||||||||||||||||||||||||
| 558 | =head1 DESCRIPTION | ||||||||||||||||||||||||||||||||||||||||||
| 559 | |||||||||||||||||||||||||||||||||||||||||||
| 560 | This module allows you to access your web-based Yahoo Mail account | ||||||||||||||||||||||||||||||||||||||||||
| 561 | programatically. Similar in function to L<Mail::Webmail::Yahoo>, this | ||||||||||||||||||||||||||||||||||||||||||
| 562 | module is more geared towards manipulation of individual messages, | ||||||||||||||||||||||||||||||||||||||||||
| 563 | rather than simple bulk download. This module is also probably more | ||||||||||||||||||||||||||||||||||||||||||
| 564 | reliable than L<Mail::Webmail::Yahoo>, as well. | ||||||||||||||||||||||||||||||||||||||||||
| 565 | |||||||||||||||||||||||||||||||||||||||||||
| 566 | =head1 METHODS | ||||||||||||||||||||||||||||||||||||||||||
| 567 | |||||||||||||||||||||||||||||||||||||||||||
| 568 | =head2 login( %options ) | ||||||||||||||||||||||||||||||||||||||||||
| 569 | |||||||||||||||||||||||||||||||||||||||||||
| 570 | Creates a new Mail::Client::Yahoo object, and logs in to the Yahoo | ||||||||||||||||||||||||||||||||||||||||||
| 571 | Mail server. You must include the C<username> and C<password> | ||||||||||||||||||||||||||||||||||||||||||
| 572 | options. (The username and password is sent over a secure HTTPS | ||||||||||||||||||||||||||||||||||||||||||
| 573 | connection.) | ||||||||||||||||||||||||||||||||||||||||||
| 574 | |||||||||||||||||||||||||||||||||||||||||||
| 575 | You may also include an C<error> option, which should be a reference | ||||||||||||||||||||||||||||||||||||||||||
| 576 | to a subroutine to be called if there is an error. The default | ||||||||||||||||||||||||||||||||||||||||||
| 577 | handler simply dies. | ||||||||||||||||||||||||||||||||||||||||||
| 578 | |||||||||||||||||||||||||||||||||||||||||||
| 579 | You may also include a C<secure> option, which should be either 0 or | ||||||||||||||||||||||||||||||||||||||||||
| 580 | 1. If C<secure> is 1, the session uses a secure HTTPS connection, | ||||||||||||||||||||||||||||||||||||||||||
| 581 | instead of a standard HTTP connection (the default). Note that the | ||||||||||||||||||||||||||||||||||||||||||
| 582 | secure connection will be slower, and the username and password are | ||||||||||||||||||||||||||||||||||||||||||
| 583 | always sent over HTTPS, regardless of the value of C<secure>. | ||||||||||||||||||||||||||||||||||||||||||
| 584 | |||||||||||||||||||||||||||||||||||||||||||
| 585 | =head2 logout( ) | ||||||||||||||||||||||||||||||||||||||||||
| 586 | |||||||||||||||||||||||||||||||||||||||||||
| 587 | Log out, and disconnect from the server. | ||||||||||||||||||||||||||||||||||||||||||
| 588 | |||||||||||||||||||||||||||||||||||||||||||
| 589 | =head2 folder_list( ) | ||||||||||||||||||||||||||||||||||||||||||
| 590 | |||||||||||||||||||||||||||||||||||||||||||
| 591 | Returns a list of the names of all available folders. | ||||||||||||||||||||||||||||||||||||||||||
| 592 | |||||||||||||||||||||||||||||||||||||||||||
| 593 | =head2 select_folder( $name ) | ||||||||||||||||||||||||||||||||||||||||||
| 594 | |||||||||||||||||||||||||||||||||||||||||||
| 595 | Selects the current working folder. This must be done before any of | ||||||||||||||||||||||||||||||||||||||||||
| 596 | the message methods may be used. | ||||||||||||||||||||||||||||||||||||||||||
| 597 | |||||||||||||||||||||||||||||||||||||||||||
| 598 | =head2 folder_size( $name ) | ||||||||||||||||||||||||||||||||||||||||||
| 599 | |||||||||||||||||||||||||||||||||||||||||||
| 600 | Returns the size of a folder, as give by Yahoo. This size will | ||||||||||||||||||||||||||||||||||||||||||
| 601 | usually be a string ending in `K', which gives the number of kilobytes | ||||||||||||||||||||||||||||||||||||||||||
| 602 | in the message. This is not an exact size. | ||||||||||||||||||||||||||||||||||||||||||
| 603 | |||||||||||||||||||||||||||||||||||||||||||
| 604 | =head2 folder_count( $name ) | ||||||||||||||||||||||||||||||||||||||||||
| 605 | |||||||||||||||||||||||||||||||||||||||||||
| 606 | Returns the number of messages in a folder. | ||||||||||||||||||||||||||||||||||||||||||
| 607 | |||||||||||||||||||||||||||||||||||||||||||
| 608 | =head2 message_list( ) | ||||||||||||||||||||||||||||||||||||||||||
| 609 | |||||||||||||||||||||||||||||||||||||||||||
| 610 | Returns an array containing the message-id's of all the messages in | ||||||||||||||||||||||||||||||||||||||||||
| 611 | the current folder. | ||||||||||||||||||||||||||||||||||||||||||
| 612 | |||||||||||||||||||||||||||||||||||||||||||
| 613 | =head2 message_size( $msgid_or_index ) | ||||||||||||||||||||||||||||||||||||||||||
| 614 | |||||||||||||||||||||||||||||||||||||||||||
| 615 | Returns the size of the message, as given in the folder listing. As | ||||||||||||||||||||||||||||||||||||||||||
| 616 | with the folder size, it is not exact, and will most likely be a | ||||||||||||||||||||||||||||||||||||||||||
| 617 | number followed by a `K' or `M', indicating kilobytes and megabytes, | ||||||||||||||||||||||||||||||||||||||||||
| 618 | respectively. | ||||||||||||||||||||||||||||||||||||||||||
| 619 | |||||||||||||||||||||||||||||||||||||||||||
| 620 | Note: The parameter passed may either be a message-id, such as | ||||||||||||||||||||||||||||||||||||||||||
| 621 | returned from the L<message_list( )> function, or the index of a | ||||||||||||||||||||||||||||||||||||||||||
| 622 | message in that list. | ||||||||||||||||||||||||||||||||||||||||||
| 623 | |||||||||||||||||||||||||||||||||||||||||||
| 624 | =head2 message_head( $msgid_or_index ) | ||||||||||||||||||||||||||||||||||||||||||
| 625 | |||||||||||||||||||||||||||||||||||||||||||
| 626 | Returns a L<Mail::Header> object containing the headers of the message. | ||||||||||||||||||||||||||||||||||||||||||
| 627 | |||||||||||||||||||||||||||||||||||||||||||
| 628 | =head2 message_body( $msgid_or_index ) | ||||||||||||||||||||||||||||||||||||||||||
| 629 | |||||||||||||||||||||||||||||||||||||||||||
| 630 | Returns a L<Mail::Internet> object containing the body of the message. | ||||||||||||||||||||||||||||||||||||||||||
| 631 | Note that the returned object contains B<only> the body of the | ||||||||||||||||||||||||||||||||||||||||||
| 632 | message; the headers are left empty. | ||||||||||||||||||||||||||||||||||||||||||
| 633 | |||||||||||||||||||||||||||||||||||||||||||
| 634 | This is the complete (possibly MIME-encoded) message body, including | ||||||||||||||||||||||||||||||||||||||||||
| 635 | any attachments. | ||||||||||||||||||||||||||||||||||||||||||
| 636 | |||||||||||||||||||||||||||||||||||||||||||
| 637 | =head2 message( $msgid_or_index ) | ||||||||||||||||||||||||||||||||||||||||||
| 638 | |||||||||||||||||||||||||||||||||||||||||||
| 639 | Returns a L<Mail::Internet> object containing both the headers and | ||||||||||||||||||||||||||||||||||||||||||
| 640 | body of the message. | ||||||||||||||||||||||||||||||||||||||||||
| 641 | |||||||||||||||||||||||||||||||||||||||||||
| 642 | This is the complete message, including any attachments. | ||||||||||||||||||||||||||||||||||||||||||
| 643 | |||||||||||||||||||||||||||||||||||||||||||
| 644 | =head2 move_message( $msgid_or_index, $folder_name ) | ||||||||||||||||||||||||||||||||||||||||||
| 645 | |||||||||||||||||||||||||||||||||||||||||||
| 646 | Moves a message from the current folder to another folder. | ||||||||||||||||||||||||||||||||||||||||||
| 647 | |||||||||||||||||||||||||||||||||||||||||||
| 648 | =head2 delete_message( $msgid_or_index ) | ||||||||||||||||||||||||||||||||||||||||||
| 649 | |||||||||||||||||||||||||||||||||||||||||||
| 650 | Moves a message from the current folder to the special Trash folder. | ||||||||||||||||||||||||||||||||||||||||||
| 651 | Note that the Trash folder is not emptied automatically (though it may | ||||||||||||||||||||||||||||||||||||||||||
| 652 | be purged by Yahoo at random times). | ||||||||||||||||||||||||||||||||||||||||||
| 653 | |||||||||||||||||||||||||||||||||||||||||||
| 654 | =head2 send_message( %options ) | ||||||||||||||||||||||||||||||||||||||||||
| 655 | |||||||||||||||||||||||||||||||||||||||||||
| 656 | Sends a message via the Yahoo website. You must specify a primary | ||||||||||||||||||||||||||||||||||||||||||
| 657 | recipient via C<to>, a C<subject>, and a C<body>. You may also | ||||||||||||||||||||||||||||||||||||||||||
| 658 | specify additional recipients via C<cc> and C<bcc>, a boolean | ||||||||||||||||||||||||||||||||||||||||||
| 659 | indicating whether to save the message in your Sent folder via | ||||||||||||||||||||||||||||||||||||||||||
| 660 | C<save>, and a boolean indicating whether the body contains HTML | ||||||||||||||||||||||||||||||||||||||||||
| 661 | formatting via C<html>. | ||||||||||||||||||||||||||||||||||||||||||
| 662 | |||||||||||||||||||||||||||||||||||||||||||
| 663 | Additionally, you can specify an array reference via C<attach> | ||||||||||||||||||||||||||||||||||||||||||
| 664 | containing a list of up to three file names to upload as attachments. | ||||||||||||||||||||||||||||||||||||||||||
| 665 | |||||||||||||||||||||||||||||||||||||||||||
| 666 | =head2 empty_trash( ) | ||||||||||||||||||||||||||||||||||||||||||
| 667 | |||||||||||||||||||||||||||||||||||||||||||
| 668 | Removes all messages from the Trash folder. These messages are | ||||||||||||||||||||||||||||||||||||||||||
| 669 | permanently lost. | ||||||||||||||||||||||||||||||||||||||||||
| 670 | |||||||||||||||||||||||||||||||||||||||||||
| 671 | =head1 SEE ALSO | ||||||||||||||||||||||||||||||||||||||||||
| 672 | |||||||||||||||||||||||||||||||||||||||||||
| 673 | L<Mail::Header>, L<Mail::Internet>, L<WWW::Mechanize>, L<HTML::TableExtract> | ||||||||||||||||||||||||||||||||||||||||||
| 674 | |||||||||||||||||||||||||||||||||||||||||||
| 675 | =head1 AUTHOR | ||||||||||||||||||||||||||||||||||||||||||
| 676 | |||||||||||||||||||||||||||||||||||||||||||
| 677 | Copyright (C) 2004, Cory Johns. | ||||||||||||||||||||||||||||||||||||||||||
| 678 | |||||||||||||||||||||||||||||||||||||||||||
| 679 | This module is free software; you can redistribute and/or | ||||||||||||||||||||||||||||||||||||||||||
| 680 | modify it under the same terms as Perl itself. | ||||||||||||||||||||||||||||||||||||||||||
| 681 | |||||||||||||||||||||||||||||||||||||||||||
| 682 | Address bug reports and comments to: | ||||||||||||||||||||||||||||||||||||||||||
| 683 | Cory Johns E<lt>L<johnsca@cpan.org>E<gt> | ||||||||||||||||||||||||||||||||||||||||||
| 684 | |||||||||||||||||||||||||||||||||||||||||||
| 685 | =cut | ||||||||||||||||||||||||||||||||||||||||||
| 686 | |||||||||||||||||||||||||||||||||||||||||||