Linux IMAP文件夹差异?
我想“区分”两个IMAP文件夹(在两个不同的服务器上)来比较垃圾邮件过滤器,我想有一个命令行工具(linux)来获取标题(而不是整个目录,例如使用“isync”或类似工具),类似这样: $imapget--subjects-p=密码user@server 或者这个: $imapget--格式“$DATE-$FROM-$SUBJ”-p=密码user@server ('imapget'cmd是虚构的) 你有什么建议Linux IMAP文件夹差异?,linux,command-line,imap,spam,Linux,Command Line,Imap,Spam,我想“区分”两个IMAP文件夹(在两个不同的服务器上)来比较垃圾邮件过滤器,我想有一个命令行工具(linux)来获取标题(而不是整个目录,例如使用“isync”或类似工具),类似这样: $imapget--subjects-p=密码user@server 或者这个: $imapget--格式“$DATE-$FROM-$SUBJ”-p=密码user@server ('imapget'cmd是虚构的) 你有什么建议 谢谢简单的方法可能是获取perl和Mail::IMAPClient并使用以下内容:
谢谢简单的方法可能是获取perl和Mail::IMAPClient并使用以下内容:
use Mail::IMAPClient;
my $imap = Mail::IMAPClient->new(
Server => $imaphost, User => $login, Password => $pass, Uid => 1
);
$imap->select("demo_folder");
my $msgs = $imap->search("ALL");
for my $h (
# get specified headers from every message in folder "demo_folder" the
values %{ $imap->parse_headers( $msgs , "Date", "From", "Subject") } )
{
# $h is the value of each element in the hash ref returned
# from parse_headers, and $h is also a reference to a hash.
# We'll only print the first occurrence of each field because
# we don't expect more than one particular header line per
# message.
print map { "$_:\t$h->{$_}[0]\n"} keys %$h;
}
最简单的方法可能是获取perl和Mail::IMAPClient并使用以下内容:
use Mail::IMAPClient;
my $imap = Mail::IMAPClient->new(
Server => $imaphost, User => $login, Password => $pass, Uid => 1
);
$imap->select("demo_folder");
my $msgs = $imap->search("ALL");
for my $h (
# get specified headers from every message in folder "demo_folder" the
values %{ $imap->parse_headers( $msgs , "Date", "From", "Subject") } )
{
# $h is the value of each element in the hash ref returned
# from parse_headers, and $h is also a reference to a hash.
# We'll only print the first occurrence of each field because
# we don't expect more than one particular header line per
# message.
print map { "$_:\t$h->{$_}[0]\n"} keys %$h;
}
我会使用OfflineIMAP、imapsync、imapcopy、isync或mailsync之类的工具将这两个IMAP文件夹镜像到本地Maildir文件夹
然后我会使用mailutils之类的工具来输出这两种格式的邮件列表,并将它们区分开来。我会使用OfflineIMAP、imapsync、imapcopy、isync或mailsync之类的工具将这两个IMAP文件夹镜像到本地Maildir文件夹
然后我会使用类似mailutils的东西来输出这两种格式的消息列表并加以区分。这可能属于serverfault,或者可能属于superuser。这可能属于serverfault,或者可能属于superuser。