centos 6.4 getmail 收取163 邮件

#CentOS 6.6 64bit 默认yum 源没有getmail rpm包
#首先安装EPEL yum 源
EPEL(Extra Packages for Enterprise Linux):http://fedoraproject.org/wiki/EPEL
[root@localhost ~]# rpm -Uvh http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el7.rf.x86_64.rpm

#安装getmail
[root@localhost ~]# yum -y install getmail

#创建测试用户(root无法使用getmail,使用时报错)
[root@localhost ~]# useradd getmailtest
[root@localhost ~]# echo "123456" | passwd --stdin getmailtest
更改用户 getmailtest 的密码 。
passwd: 所有的身份验证令牌已经成功更新。

#su登录到测试用户
[root@localhost ~]# su getmailtest

#创建配置文件、日志文件
[getmailtest@localhost root]$ mkdir ~/.getmail
[getmailtest@localhost root]$ touch ~/.getmail/log
[getmailtest@localhost root]$ touch ~/.getmail/getmailrc

#修改配置文件如下(具体可参考/usr/share/doc/getmail-4.48.0/getmailrc-examples)
[getmailtest@localhost root]$ more ~/.getmail/getmailrc
[options] //此项配置会从邮件服务器删除已收取的邮件,慎用!
verbose = 0
delete = true
message_log = ~/.getmail/log
message_log_verbose = true

[retriever]
type = SimplePOP3Retriever
server = pop.163.com
username = username //username 或 username@163.com,自行替换为163邮箱帐号即可
password = userpwd //163邮箱帐号的密码

[destination]
type = Maildir
path = ~jeffp/Maildir/

#创建邮件保存目录
[getmailtest@localhost root]$ mkdir -p ~/Maildir/cur
[getmailtest@localhost root]$ mkdir -p ~/Maildir/new
[getmailtest@localhost root]$ mkdir -p ~/Maildir/tmp

#收取邮件
[getmailtest@localhost root]$ getmail -v -n -r ~/.getmail/getmailrc
getmail version 4.48.0
Copyright (C) 1998-2012 Charles Cazabon. Licensed under the GNU GPL version 2.
SimplePOP3Retriever:username@pop.163.com:110:
msg 1/44 (5532 bytes) delivered, deleted
......中间略......
msg 44/44 (2816 bytes) delivered, deleted
44 messages (324463 bytes) retrieved, 0 skipped

#查看邮件列表
[getmailtest@localhost root]$ ll ~/Maildir/new/
总用量 392
-rw------- 1 getmailtest getmailtest 5533 3月 15 11:02 1458010979.M346714P3278Q0R1e0727794828eb9b.localhost
-rw------- 1 getmailtest getmailtest 2908 3月 15 11:03 1458010980.M242235P3279Q1R161d7286fdf7e580.localhost
-rw------- 1 getmailtest getmailtest 4860 3月 15 11:03 1458010981.M143718P3280Q2R1323c5d4e3bfa0ee.localhost
-rw------- 1 getmailtest getmailtest 4481 3月 15 11:03 1458010981.M963718P3281Q3Rd2800ecbf1a0ff2e.localhost
-rw------- 1 getmailtest getmailtest 8525 3月 15 11:03 1458010982.M915445P3282Q4R46e6d385b3615e3c.localhost
-rw------- 1 getmailtest getmailtest 11294 3月 15 11:03 1458010984.M338784P3283Q5Rc53ebc40ae729b9d.localhost
-rw------- 1 getmailtest getmailtest 1982 3月 15 11:03 1458010985.M194597P3284Q6R09a893c11ff1a8f0.localhost
-rw------- 1 getmailtest getmailtest 22508 3月 15 11:03 1458010987.M163490P3285Q7R52656083e9ce0a04.localhost
-rw------- 1 getmailtest getmailtest 3101 3月 15 11:03 1458010988.M132935P3286Q8Rb733806f6f6aa351.localhost
-rw------- 1 getmailtest getmailtest 3233 3月 15 11:03 1458010989.M92986P3287Q9Raf5408e1ccbefccb.localhost
-rw------- 1 getmailtest getmailtest 3073 3月 15 11:03 1458010990.M35407P3288Q10R475a0747d91074b2.localhost
-rw------- 1 getmailtest getmailtest 3836 3月 15 11:03 1458010990.M978260P3289Q11R98244f76f8d3bd7d.localhost
-rw------- 1 getmailtest getmailtest 2917 3月 15 11:03 1458010991.M996118P3290Q12Rccc727835c3af1f3.localhost
-rw------- 1 getmailtest getmailtest 3287 3月 15 11:03 1458010993.M89432P3291Q13R25ef450f146f2486.localhost
-rw------- 1 getmailtest getmailtest 3927 3月 15 11:03 1458010994.M117127P3292Q14Ra4bdb019d7980def.localhost
-rw------- 1 getmailtest getmailtest 2526 3月 15 11:03 1458010995.M213469P3293Q15R139fa1be73eaf705.localhost
-rw------- 1 getmailtest getmailtest 2477 3月 15 11:03 1458010996.M356843P3294Q16R8a0ee39d2b19c5ec.localhost
-rw------- 1 getmailtest getmailtest 2477 3月 15 11:03 1458010997.M515897P3295Q17Ra94b02ae4683ca21.localhost
-rw------- 1 getmailtest getmailtest 3374 3月 15 11:03 1458010998.M567606P3296Q18R58ff2a5ba1ab05c3.localhost
-rw------- 1 getmailtest getmailtest 12969 3月 15 11:03 1458010999.M660168P3297Q19Rae4573e82b88f391.localhost
-rw------- 1 getmailtest getmailtest 3134 3月 15 11:03 1458011000.M812241P3298Q20Rc496f6a3b7ad990a.localhost
-rw------- 1 getmailtest getmailtest 6787 3月 15 11:03 1458011002.M376233P3299Q21R1dc5e2516b6eba24.localhost
-rw------- 1 getmailtest getmailtest 3392 3月 15 11:03 1458011003.M399379P3300Q22R920b5449f2cabd71.localhost
-rw------- 1 getmailtest getmailtest 22531 3月 15 11:03 1458011004.M835200P3301Q23R7a81a024a9636c77.localhost
-rw------- 1 getmailtest getmailtest 2357 3月 15 11:03 1458011005.M866718P3302Q24R0032183ba02373ca.localhost
-rw------- 1 getmailtest getmailtest 3006 3月 15 11:03 1458011006.M888860P3303Q25R48a61e0d304be9c4.localhost
-rw------- 1 getmailtest getmailtest 3376 3月 15 11:03 1458011007.M896986P3304Q26R48a0f8911241a9f6.localhost
-rw------- 1 getmailtest getmailtest 1652 3月 15 11:03 1458011008.M850488P3305Q27R69790471e619d974.localhost
-rw------- 1 getmailtest getmailtest 18685 3月 15 11:03 1458011009.M833583P3306Q28R8dd7919655459674.localhost
-rw------- 1 getmailtest getmailtest 23619 3月 15 11:03 1458011011.M508171P3307Q29R0efdf78e8ac64172.localhost
-rw------- 1 getmailtest getmailtest 2743 3月 15 11:03 1458011012.M690670P3308Q30Re570613e79576cb8.localhost
-rw------- 1 getmailtest getmailtest 2961 3月 15 11:03 1458011014.M2788P3309Q31R3388976b39f1454f.localhost
-rw------- 1 getmailtest getmailtest 2743 3月 15 11:03 1458011015.M167417P3310Q32R5835b6cd2df147f9.localhost
-rw------- 1 getmailtest getmailtest 2694 3月 15 11:03 1458011016.M458882P3311Q33Rd3c7c272a8df11f3.localhost
-rw------- 1 getmailtest getmailtest 10236 3月 15 11:03 1458011018.M253293P3312Q34Rb6ca53080242f590.localhost
-rw------- 1 getmailtest getmailtest 10142 3月 15 11:03 1458011019.M422399P3313Q35Re46ea13b1fd31649.localhost
-rw------- 1 getmailtest getmailtest 23499 3月 15 11:03 1458011020.M955149P3314Q36R0180f093abe719d8.localhost
-rw------- 1 getmailtest getmailtest 23505 3月 15 11:03 1458011022.M359360P3315Q37R3f308030002416ea.localhost
-rw------- 1 getmailtest getmailtest 4411 3月 15 11:03 1458011023.M266922P3316Q38R6302b97771b7bff8.localhost
-rw------- 1 getmailtest getmailtest 4701 3月 15 11:03 1458011024.M229118P3317Q39R0d19134987034314.localhost
-rw------- 1 getmailtest getmailtest 30238 3月 15 11:03 1458011025.M642268P3318Q40Rda37bcca3304fb08.localhost
-rw------- 1 getmailtest getmailtest 5042 3月 15 11:03 1458011026.M912043P3319Q41R29cac9a44ae521c0.localhost
-rw------- 1 getmailtest getmailtest 2066 3月 15 11:03 1458011027.M808955P3320Q42R3c76049cb501a3f6.localhost
-rw------- 1 getmailtest getmailtest 2921 3月 15 11:03 1458011028.M744606P3321Q43Rd0ceeb8a6eb28f40.localhost

#查看邮件内容
[getmailtest@localhost root]$ more ~/Maildir/new/1458010979.M346714P3278Q0R1e0727794828eb9b.localhost
Return-Path: <admin@kk.mail88.net>
Delivered-To: unknown
Received: from pop.163.com (220.181.12.101:110) by localhost.localdomain with
POP3; 15 Mar 2016 03:02:59 -0000
Received: from hr.edm88.net (unknown [108.62.227.137])
by mx18 (Coremail) with SMTP id RMCowEB5eloeGUFQwwHRDA--.773S2;
Sat, 01 Sep 2012 04:05:51 +0800 (CST)
Received: from localhost ([127.0.0.1])
by hr.edm88.net
for username@163.com;
Sat, 1 Sep 2012 04:04:44 +0800
To: username@163.com
Subject: =?UTF-8?B?6IGM5Zy65LiK6K6p5oKo5bmz5q2l6Z2S5LqR77yM5YyW6Zmp5Li65aS355qE6IGM5Zy65Zyj57uPICDku7flgLwzODjlhYPlhY3otLnpooblj5bkuK3vvIhBRO+8iQ==?=
Message-ID: <35329e75f1c303815c7db5ccde50bc2c@vip.egez.cn>
Date: Fri, 31 Aug 2012 22:55:47 +0800
From: "=?UTF-8?B?5piT5Lit5YWN6LS56LWg6ZiF?=" <admin@hkk.sendedm.net>
Reply-To: admin@kk.mail88.net
MIME-Version: 1.0
X-Mailer-LID: 63,50,40,66,65,11,12,13,16,14
List-Unsubscribe: <http://vip.egez.cn/unsubscribe.php?M=897561&C=f0770308746f5fa27a17f01334b6ebb4&L=11&N=67>
X-Mailer-RecptId: 897561
X-Mailer-SID: 67
X-Mailer-Sent-By: 14
Content-Type: multipart/alternative; charset="UTF-8"; boundary="b1_322005bf8afb1ca0d716d124e6fcde81"
Content-Transfer-Encoding: 8bit
X-CM-TRANSID: RMCowEB5eloeGUFQwwHRDA--.773S2
X-Coremail-Antispam: 1Uf129KBjvdXoWruryxtF4UWF1xXFW8tr15twb_yoWxZFg_Xr
sxJr45Zay293y5G3srZF4aqFW5Jr1vgr90kwn8trn7tayYya98K3sYkFnrXry3uFZ5Gay2
qF4Ska1kWr4kCjkaLaAFLSUrUU08_b8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT
9fnUUvcSsGvfC2KfnxnbnKAaVF93slvjIFyTuYvjxUsJ3kDUUUU
Sender: admin@kk.mail88.net

--b1_322005bf8afb1ca0d716d124e6fcde81
Content-Type: text/plain; format=flowed; charset="UTF-8"
Content-Transfer-Encoding: 8bit

Your email client cannot read this email.
To view it online, please go here:
http://vip.egez.cn/display.php?M=897561&C=f0770308746f5fa27a17f01334b6ebb4&S=67&L=11&N=38

To stop receiving these
emails:http://vip.egez.cn/unsubscribe.php?M=897561&C=f0770308746f5fa27a17f01334b6ebb4&L=11&N=67

--b1_322005bf8afb1ca0d716d124e6fcde81
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: 8bit

<html><head></head><body><table style="font-family: Verdana, Geneva,
sans-serif; border: #d5d5d5 1px solid;" border="0" cellspacing="0"
cellpadding="0" width="650" align="center">
<tbody>
<tr>
<td>
<table border="0" cellspacing="0" cellpadding="0" width="650"
align="center">
<tbody>
<tr>
<td style="text-align: center; padding-bottom: 25px; line-height: 26px;
padding-left: 0px; padding-right: 0px; color: #333; font-size: 26px;
font-weight: bold; padding-top: 25px;" valign="top" width="650"
align="center">14万中高层管理者共同推荐的管理杂志!</td>
</tr>
</tbody>
</table>
<table style="background-image:
url(http://www.izhong.com/edm/yiyou/6/images/bg_topcenter_02.jpg);
background-color: #9a1e35; background-repeat: repeat-y;" border="0"
cellspacing="0" cellpadding="0" width="650" align="center" height="50">
<tbody>
<tr>
<td style="padding-top: 25px;" width="650" align="center"><img border="0"
src="http://www.izhong.com/edm/yiyou/6/images/title_03.jpg" width="269"
height="38" /></td>
</tr>
</tbody>
</table>
<table style="background-image:
url(http://www.izhong.com/edm/yiyou/6/images/bg_topcenter_02.jpg);
background-color: #9a1e35; background-repeat: repeat-y;" border="0"
cellspacing="0" cellpadding="0" width="650" align="center">
<tbody>
<tr>
<td style="padding-bottom: 25px; line-height: 24px; text-indent: 26px;
padding-left: 20px; padding-right: 20px; color: #fff; font-size: 14px;
padding-top: 15px;" height="45"
width="650">我是一名中层管理者,由于之前从事网络技术工作,对管理没有感性的认知,对管理类知识求知若渴。第一次接触《易友》杂志是
2011
年,我无意间发现"《易友》免费赠阅"的活动,义无反顾地网上索取,让我误打误撞地走入了《易友》的管理海洋。索阅后发现杂志篇篇文章是精华,其中
80%
的文章都能与自己的管理和生活实际相联系。我经常把《易友》放在床头、背包和办公桌上,保证它在我的视线中,一有空,就可以拿起来阅读。6
个月的不离不弃,让我逐步完成了从技术向管理转型。<br
/>在此,我真诚地感谢《易友》的点拨,希望我们共同成长!&mdash;&mdash;(内蒙古国资委信息中心
云月霞)</td>
</tr>
</tbody>
</table>
<table border="0" cellspacing="0" cellpadding="0" width="650"
align="center">
<tbody>
<tr>
<td valign="top" width="650" align="center"><img border="0"
src="http://www.izhong.com/edm/yiyou/6/images/yiyouimg_02.jpg" width="650"
height="85" /></td>
</tr>
<tr>
<td valign="top" width="650" align="center"><img border="0"
src="http://www.izhong.com/edm/yiyou/6/images/yiyouimg_03.jpg" width="650"
height="85" /></td>
</tr>
<tr>
<td valign="top" width="650" align="center"><img border="0"
src="http://www.izhong.com/edm/yiyou/6/images/yiyouimg_04.jpg" width="650"
height="85" /></td>
</tr>
<tr>
<td valign="top" width="650" align="center"><a
href="http://vip.egez.cn/link.php?M=897561&N=67&L=17&F=H"
target="_blank"><img border="0"
src="http://www.izhong.com/edm/yiyou/6/images/yiyouimg_05.jpg" width="650"
height="97" /></a></td>
</tr>
<tr>
<td valign="top" width="650" align="center"><img border="0"
src="http://www.izhong.com/edm/yiyou/6/images/yiyouimg_06.jpg" width="650"
height="97" /></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table><img
src="http://vip.egez.cn/open.php?M=897561&L=11&N=67&F=H&image=.jpg"
height="1" width="10"></body></html>

--b1_322005bf8afb1ca0d716d124e6fcde81--

[getmailtest@localhost root]$ exit

上一篇:delphi网络组件ICS的THttpCli和TSslHttpCli如何设置自定义Header


下一篇:Delphi簇状柱形图