Ubuntu 9.10通过配置MDA来过滤邮件
首先是procmail MDA 邮件软件来过滤邮件:
1 .安装procmail 包
aptitude install procmail
2.getmail 文件:
vim /home/ubuntu/.getmail/getmailrc
[retriever]
type = SimplePOP3SSLRetriever
server = pop.gmail.com
username =
password =
#port = 995
[destination]
type = MDA_external
path = /usr/bin/procmail
user = ubuntu
unixfrom = true
[options]
verbose = 0
delete = true
read_all = false
message_log = ~/.getmail/log
#max_bytes_per_session = 1048576
#max_messages_per_session = 20
3.配置/home/ubuntu/.procmailrc 配置文件
vim /home/ubuntu/.procmailrc
PATH = /bin:/sbin:/usr/bin:/usr/sbin
SHELL=/bin/bash
MAILDIR=$HOME/Mail/
DEFAULT=$MAILDIR/inbox/new
注:$MAILDIR 要通过MAILDIR="邮箱要保存的目录"
要在inbox 下创建3个目录 cur new tmp 要不然运行 getmail 命令会报Delivery error (command maildrop 18258 error (75, /usr/bin/maildrop: Unable to open mailbox.))
LOGFILE=$MAILDIR/.procmaillog
#VERBOSE=no
#ORGMAIL=/var/mail/$USER
:0:
*^Subject:.*haha.* --- 收到标题为 *haha* 就保存到$MAILDIR/hotmail/ 中
$MAILDIR/hotmail/
对了 还要注意权限问题 !!!
- 最新评论