mirror of
https://github.com/imapsync/imapsync.git
synced 2025-07-24 03:00:25 +02:00
1.147
This commit is contained in:
parent
02b830ba86
commit
471328efae
7 changed files with 76 additions and 16 deletions
24
learn/subscribe
Executable file
24
learn/subscribe
Executable file
|
@ -0,0 +1,24 @@
|
|||
#!/usr/bin/perl -w
|
||||
|
||||
use Mail::IMAPClient;
|
||||
|
||||
$ARGV[1] or die "usage: $0 user password\n";
|
||||
|
||||
$host = "localhost";
|
||||
$user = $ARGV[0];
|
||||
$password = $ARGV[1];
|
||||
|
||||
my $imap = Mail::IMAPClient->new();
|
||||
#$imap->Debug(1);
|
||||
$imap->Server($host);
|
||||
$imap->connect() or die;
|
||||
$imap->User($user);
|
||||
$imap->Password($password);
|
||||
$imap->login() or die;
|
||||
$imap->subscribe("shared.Spam") or die;
|
||||
print "$user subscribed to\n",
|
||||
join("\n", $imap->subscribed()),
|
||||
"\n";
|
||||
$imap->close();
|
||||
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue