Leser: 19
sendCommand ( $src, "1 STORE $msgnum +FLAGS (\\Deleted)");
sendCommand ( $src, "1 STORE $msgnum +FLAGS (\Deleted)");
sendCommand ( $src, "1 STORE $msgnum +FLAGS.SILENT (\\Deleted)");
sendCommand ( $src, "1 STORE $msgnum +FLAGS.SILENT (\\Deleted)");
1
2
3
4
5
6
7
8
9
foreach $_ ( @msgs ) {
($msgnum,$date,$flags) = split(/\|/, $_);
$message = fetchMsg( $msgnum, $srcmbx, $src );
next unless $message;
$copied++ if insertMsg( $dst, $dstmbx, *message, $flags, $date);
#lösche die aktuelle email nach dem kopieren von src server
deleteMsg( $srcmbx, $msgnum, $src );
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
sub deleteMsg {
my $srcmbx = shift;
my $msgnum = shift;
my $src = shift;
my $rc;
sendCommand ( $src, "1 STORE $msgnum +FLAGS (\\Deleted)");
while (1) {
readResponse ($src);
print "$response";
if ( $response =~ /^1 OK/i ) {
$rc = 1;
Log(" Marked msg number $msgnum for delete");
last;
}
if ( $response =~ /^1 BAD|^1 NO/i ) {
Log("Error setting \Deleted flag for msg $msgnum: $response");
$rc = 0;
last;
}
}
return $rc;
}
sendCommand ( $src, "1 select $srcmbx");
* FLAGS (\Draft \Answered \Flagged \Deleted \Seen \Recent)* OK [PERMANENTFLAGS (\* \Draft \Answered \Flagged \Deleted \Seen)] Limited* 6 EXISTS* 0 RECENT* OK [UIDVALIDITY 1263590270] Ok* OK [MYRIGHTS "acdilrsw"] ACL1 OK [READ-WRITE] Ok