0

我使用fetchmailwithimap协议从邮件服务器上传电子邮件,并将它们通过管道传输到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 只是为了显示目的)删除服务器上我从中获取电子邮件的电子邮件?

4

1 回答 1

1

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
于 2019-12-17T04:46:59.370 回答