mirror of
https://github.com/imapsync/imapsync.git
synced 2025-08-02 15:11:49 +02:00
1.670
This commit is contained in:
parent
f1987d5e52
commit
b7c835d670
134 changed files with 44448 additions and 2810 deletions
27
W/learn/imapclient_skeleton
Normal file
27
W/learn/imapclient_skeleton
Normal file
|
@ -0,0 +1,27 @@
|
|||
#!/usr/bin/perl -w
|
||||
|
||||
use Mail::IMAPClient;
|
||||
|
||||
$ARGV[3] or die "usage: $0 host user password folder\n";
|
||||
|
||||
$host = $ARGV[0];
|
||||
$user = $ARGV[1];
|
||||
$password = $ARGV[2];
|
||||
$folder_arg = $ARGV[3];
|
||||
|
||||
my $imap = Mail::IMAPClient->new();
|
||||
$imap->Debug(1);
|
||||
$imap->Server($host);
|
||||
$imap->connect() or die;
|
||||
$imap->IsUnconnected();
|
||||
$imap->User($user);
|
||||
$imap->Password($password);
|
||||
$imap->login() or die;
|
||||
$imap->Uid(1);
|
||||
$imap->Peek(1);
|
||||
my @folders = $imap->folders( ) ;
|
||||
foreach my $folder ( @folders ) {
|
||||
print "$folder\n" ;
|
||||
}
|
||||
$imap->select( $folder_arg ) or die ;
|
||||
$imap->logout();
|
Loading…
Add table
Add a link
Reference in a new issue