imap - 如何使用 fetchmail / procmail 删除 IMAP 邮件
问题描述
我使用fetchmail
withimap
协议从邮件服务器上传电子邮件,并将它们通过管道传输到procmail
. 我使用以下命令执行此操作:
fetchmail -f /home/$USER/.fetchmailrc --ssl -t 100 -d 240 -s -m "/usr/bin/procmail /home/$USER/.procmailrc "
.fetchmailrc
如下:
poll imap.my_email_server.com protocol IMAP
user "user@email_server.com" with password "myPassword" is "user@email_server.com" here keep
.procmailrc 如下:
:0:
* ^Subject: someSubject
{
:0 c
| $BIN/parse_email
:0 c
$HOME/posnav
:0
/dev/null
}
一切正常,但我怎样才能制作最后一个命令(在这里我将电子邮件推送到 /dev/null 只是为了显示目的)删除服务器上我从中获取电子邮件的电子邮件?
解决方案
If you want to delete the mail on the server, you have to tell fetchmail to do that.
But, you explicitly told fetchmail to keep the message on the server by including the keyword "keep" in the run control file.
Change it to "no keep":
poll imap.my_email_server.com protocol IMAP
user "user@email_server.com" with password "myPassword" is "user@email_server.com" here no keep
推荐阅读
- django - 在通用更新视图中使用内联表单集通过外键编辑相关对象
- square-connect - 使用 Connect V2 时库存管理不起作用
- java - 如何根据google java格式格式化代码
- java - java.io.FileNotFoundException: C:\Users\user\AppData\Local\Temp(访问被拒绝)
- python - scapy没有回答碎片化的tcp get
- python - 如何在 Pyomo 中获得对偶变量?
- vba - 运行时错误“3075”:查询表达式中的语法错误
- c - ac 程序,输出 3 个数字的战斗,存储在一个数组中
- git - 如何在git中的错误命令后恢复文件
- json - CURL 从请求和下载文件中获取下载链接