|
本帖最后由 coldmoon 于 2010-12-2 12:49 编辑
搜索了好久终于搞定了Openwrt收邮件,mutt的配置前面的帖子已经说了,在这里需要安装fetchmail 和procmail
安装好后在建立/etc/fetchmailrc 文件并配置如下:
poll pop3.139.com protocol pop3 uidl username "yourusername" password "password" to root keep
# smtphost localhost/110
mda "/usr/bin/procmail -d %T " #openwrt和ddwrt procmail的位置不太一样,可以which procmail或者的所在位置
limit 10000 #限制接收单个邮件的大小,超过10k的不接收。
配置好这个后,在OpenWrt下如果直接运行fetchmail -v -f /etc/fetchmailrc 会提示下面的错误,我在这里搞了好久,DDwrt里不会有这个错误。
fetchmail: WARNING: Running as root is discouraged.
gethostbyname failed for OpenWrt
Name or service not knownCannot find my own host in hosts database to qualify it!
Trying to continue with unqualified hostname.
DO NOT report broken Received: headers, HELO/EHLO lines or similar problems!
DO repair your /etc/hosts, DNS, NIS or LDAP instead.
Enter password for ajyuhan@mail.google.com:
fetchmail: getaddrinfo("mail.google.com","pop3") error: Servname not supported for ai_socktype
fetchmail: Try adding the --service option (see also FAQ item R12).
POP3 connection to mail.google.com failed: Input/output error
fetchmail: Query status=2 (SOCKET)
这需要配置一下 /etc/hosts文件
改为
127.0.0.1 OpenWrt localhost
这样就可以消除第一个错误提示
然后把执行命令改为
fetchmail -v -f /etc/fetchmailrc -P 110
就可以收139邮箱的mail。gmail的要加ssl,麻烦一点。
这时候openwrt邮件保存在/tmp/spool/mail/root中
可以用mutt -f /tmp/spool/mail/root 来读取邮件 |
|