6.5.1. getmail 配置
getmail(1) 的配置在getmail documentation里描述.这里是我作为用户搭建访问多个 POP3帐号.
按如下所示的创建 “/usr/local/bin/getmails
“。
#!/bin/sh
set -e
if [ -f $HOME/.getmail/running ]; then
echo "getmail is already running ... (if not, remove $HOME/.getmail/running)" >&2
pgrep -l "getmai[l]"
exit 1
else
echo "getmail has not been running ... " >&2
fi
if [ -f $HOME/.getmail/stop ]; then
echo "do not run getmail ... (if not, remove $HOME/.getmail/stop)" >&2
exit
fi
if [ "x$1" = "x-l" ]; then
exit
fi
rcfiles="/usr/bin/getmail"
for file in $HOME/.getmail/config/* ; do
rcfiles="$rcfiles --rcfile $file"
done
date -u > $HOME/.getmail/running
eval "$rcfiles $@"
rm $HOME/.getmail/running
按如下所示的配置它。
$ sudo chmod 755 /usr/local/bin/getmails
$ mkdir -m 0700 $HOME/.getmail
$ mkdir -m 0700 $HOME/.getmail/config
$ mkdir -m 0700 $HOME/.getmail/log
按如下所示的为每个 POP3 账户创建 “$HOME/.getmail/config/pop3_name
“ 配置文件。
[retriever]
type = SimplePOP3SSLRetriever
server = pop.example.com
username = pop3_name@example.com
password = <your-password>
[destination]
type = MDA_external
path = /usr/bin/maildrop
unixfrom = True
[options]
verbose = 0
delete = True
delivered_to = False
message_log = ~/.getmail/log/pop3_name.log
按如下所示的配置它。
$ chmod 0600 $HOME/.getmail/config/*
计划使用 cron(8) 每 15 分钟运行一次 “/usr/local/bin/getmails
“,通过执行 “sudo crontab -e -u <user_name>
“ 并把如下所示的命令添加到用户的 cron 条目中。
5,20,35,50 * * * * /usr/local/bin/getmails --quiet
提示 | |
---|---|
POP3 访问的问题可能并不来自于 |