-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpopclean.html
295 lines (288 loc) · 12.7 KB
/
popclean.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>popclean - script to purge messages at a POP3 server older than a certain age, larger than a given size or tagged by a spamfilter.</title>
<link rev="made" href="mailto:root@localhost" />
</head>
<body style="background-color: white">
<p><a name="__index__"></a></p>
<!-- INDEX BEGIN -->
<ul>
<li><a href="#name">NAME</a></li>
<li><a href="#synopsis">SYNOPSIS</a></li>
<li><a href="#options">OPTIONS</a></li>
<li><a href="#description">DESCRIPTION</a></li>
<li><a href="#environment">ENVIRONMENT</a></li>
<li><a href="#see_also">SEE ALSO</a></li>
<li><a href="#author">AUTHOR</a></li>
<li><a href="#prerequisites">PREREQUISITES</a></li>
</ul>
<!-- INDEX END -->
<hr />
<p>
</p>
<h1><a name="name">NAME</a></h1>
<p>popclean - script to purge messages at a POP3 server older than a certain age, larger than a given size or tagged by a spamfilter.</p>
<p>
</p>
<hr />
<h1><a name="synopsis">SYNOPSIS</a></h1>
<p><strong>popclean</strong> [options]</p>
<p>Options:</p>
<pre>
-a, --maxage Set maximum age in hours before a message is purged
-l, --limit Messages larger than this limit in KB will be deleted
-g, --spamtag Messages with this text in the subject will be considered tagged as spam and will be deleted
-f, --fetchmailrc=file Specify an alternate name for the fetchmail run control file
-i, --uidlfile=file Specify an alternate name for the .fetchids file
-k, --skipuidl Bypass verification of .fetchids file
-u, --user Specify username
-p, --password Specify password
-s, --server Specify POP3 server name or IP address
-t, --test-mode, --test Operate as normal but do not actually purge messages
-S, --syslog Write messages to syslog daemon
-T, --timeout Set timeout in seconds for connecting to the POP server
--attempts Number of attempts before giving up on connecting to a server
-P, --port The POP server port number
-A, --authmode Authentication method. Use BEST (default), APOP, CRAM-MD5 or PASS.
-v, --verbose Write details about deleted messages
-d, --debug Write detailed information while processing messages
-F, --force Purge messages even with unrecognisable date
-V, --version Print version
-?, --usage Print usage message
-h, --help Print documentation</pre>
<p>
</p>
<hr />
<h1><a name="options">OPTIONS</a></h1>
<dl>
<dt><strong><a name="item__2da_2c__2d_2dmaxage_n"><strong>-A</strong>, <strong>--maxage</strong> N</a></strong><br />
</dt>
<dd>
Any message older than N hours will be deleted. If --maxage=0 is specified
the age will be ignored. This is useful when deletion based upon size
is intended. Default: 48
</dd>
<p></p>
<dt><strong><a name="item__2dl_2c__2d_2dlimit_n"><strong>-l</strong>, <strong>--limit</strong> N</a></strong><br />
</dt>
<dd>
Any message larger than N Kbytes will be deleted. If limit=0 is
specified the size will be ignored. This is the default behaviour.
If --limit and --maxage are combined they are OR'ed. This means a message
needs to exceed either --limit or --maxage to be deleted.
</dd>
<p></p>
<dt><strong><a name="item__2dg_2c__2d_2dspamtag__3ctag_3e"><strong>-g</strong>, <strong>--spamtag</strong> <tag></a></strong><br />
</dt>
<dd>
Specifies a string that, if present in the subject line, causes the message
to be deleted from the server. Spamfilters often add a special tag to the
subject of a message to indicate it is considered spam. If --spamtag and
--maxage are combined they are OR'ed. This means a message needs to exceed
either --maxage or be considered spam to be deleted.
</dd>
<p></p>
<dt><strong><a name="item__2dv_2c__2d_2dversion"><strong>-V</strong>, <strong>--version</strong></a></strong><br />
</dt>
<dd>
Displays the version information for your copy of popclean.
No further actions are performed.
</dd>
<p></p>
<dt><strong><a name="item__2du_2c__2d_2duser__3cusername_3e"><strong>-u</strong>, <strong>--user</strong> <username></a></strong><br />
</dt>
<dd>
The <strong>-u</strong> parameter will cause popclean to process a specific user
account. This requires the server name or address to be specified
as well.
</dd>
<p></p>
<dt><strong><a name="item__2ds_2c__2d_2dserver__3cservername_or_address_3e"><strong>-s</strong>, <strong>--server</strong> <servername or address></a></strong><br />
</dt>
<dd>
Specifies the host name or dotted IP address of the POP3 server.
This option is required if <strong>-u</strong> is given.
</dd>
<p></p>
<dt><strong><a name="item__2dp_2c__2d_2dpassword__3cpassword_3e"><strong>-p</strong>, <strong>--password</strong> <password></a></strong><br />
</dt>
<dd>
Specifies the cleartext password belonging to the user account
as specified by <strong>-u</strong> and <strong>-s</strong>. If no password is specified but
the <strong>-u</strong> and <strong>-s</strong> options are present, the user is prompted to
specify one.
</dd>
<p></p>
<dt><strong><a name="item__2dp_2c__2d_2dport__3cportnum_3e"><strong>-P</strong>, <strong>--port</strong> <portnum></a></strong><br />
</dt>
<dd>
Specifies the POP server port (default = 110). This value overrides
the value specified in the fetchmailrc file.
</dd>
<p></p>
<dt><strong><a name="item__2da_2c__2d_2dauthmode__3cmode_3e"><strong>-A</strong>, <strong>--authmode</strong> <mode></a></strong><br />
</dt>
<dd>
Authentication mode used to login to the POP server. If the mode is set
to BEST, and the server appears to support APOP, it will try APOP, if
that fails, then it will try SASL CRAM-MD5 if the server appears to
support it, and finally PASS. If the mode is set to APOP, and the server
appears to support APOP, it will use APOP or it will fail to log in.
Likewise, for CRAM-MD5, no PASS-fallback is made. Otherwise password is
sent in clear text.
</dd>
<p></p>
<dt><strong><a name="item__2dt_2c__2d_2dtimeout__3cseconds_3e"><strong>-T</strong>, <strong>--timeout</strong> <seconds></a></strong><br />
</dt>
<dd>
The timeout option (default = 60 seconds) allows you to set a
server-nonresponse timeout in seconds. After the timeout expires
the connection is considered dead. This value overrides the value
specified in the fetchmailrc file.
</dd>
<p></p>
<dt><strong><a name="item__2d_2dattempts__3cnumber_3e"><strong>--attempts</strong> <number></a></strong><br />
</dt>
<dd>
Number of attempts (default=3) to connect to a server. Sometimes the
first attempt to connect to a server fails for unknown reasons, usually
network related. This option allows the control of the number of
retries. Authorization failures are never retried.
</dd>
<p></p>
<dt><strong><a name="item__2df_2c__2d_2dfetchmailrc__3cfilename_3e"><strong>-f</strong>, <strong>--fetchmailrc</strong> <filename></a></strong><br />
</dt>
<dd>
Specify the location of the fetchmail configuration file> By
default popclean will look for the file <strong>$HOME/.fetchmailrc</strong>.
Many options and directives are ignored. The following options are
actually used: server, username, password, port, timeout.
When account information is explicitly specified through the
--user option this file is ignored. See the README file for details.
</dd>
<p></p>
<dt><strong><a name="item__2di_2c__2d_2duidlfile__3cfilename_3e"><strong>-i</strong>, <strong>--uidlfile</strong> <filename></a></strong><br />
</dt>
<dd>
Specify an alternate name for the .fetchids file used by fetchmail to
save POP3 UIDs. By default the file <strong>$HOME/.fetchids</strong> is read to
validate POP3 UIDs to make shure that fetchmail has fetched a message
before deciding to delete it. This prevents deletion of messages when
fetchmail has not run for a period longer than MAXAGE. This value
overrides the value specified in the fetchmailrc file.
</dd>
<p></p>
<dt><strong><a name="item__2dk_2c__2d_2dskipuidl"><strong>-k</strong>, <strong>--skipuidl</strong></a></strong><br />
</dt>
<dd>
Bypass validation of UIDs against the .fetchids file. Beware of the
danger of unwanted deletion if fetchmail has not run in a while. This
option is useful if fetchmail is not around (in this case also use
--user, --password and --server) or is not using the UIDL option for
some reason.
</dd>
<p></p>
<dt><strong><a name="item__2dt_2c__2d_2dtest_2dmode_2c__2d_2dtest"><strong>-t</strong>, <strong>--test-mode</strong>, <strong>--test</strong></a></strong><br />
</dt>
<dd>
Popclean will work normally but will not actually delete any messages.
This is especially useful for testing purposes.
</dd>
<p></p>
<dt><strong><a name="item__2ds_2c__2d_2dsyslog"><strong>-S</strong>, <strong>--syslog</strong></a></strong><br />
</dt>
<dd>
This option allows you to redirect status and error messages emitted
to the <code>syslog(3)</code> system daemon if available. Messages are logged with
an id of popclean, the facility LOG_MAIL, and priorities LOG_ERR,
LOG_ALERT or LOG_INFO. This option is intended for logging status
and error messages which indicate the results while cleaning a POP
account. Error messages for command line options and parsing the
configuration file are still written to stderr.
</dd>
<p></p>
<dt><strong><a name="item__2dv_2c__2d_2dverbose"><strong>-v</strong>, <strong>--verbose</strong></a></strong><br />
</dt>
<dd>
Verbose mode. Information about processed messages is echoed to
the output.
</dd>
<p></p>
<dt><strong><a name="item__2dd_2c__2d_2ddebug"><strong>-d</strong>, <strong>--debug</strong></a></strong><br />
</dt>
<dd>
Debug mode. Implies verbose mode. Echoes extra diagnostic information
about all messages. In particular the conversation with the POP3
server echoed. Warning: This can cause lots of output when many
messages and/or many accounts are processed.
</dd>
<p></p>
<dt><strong><a name="item__2df_2c__2d_2dforce"><strong>-F</strong>, <strong>--force</strong></a></strong><br />
</dt>
<dd>
Forced deletion of messages. Sometimes the age of a message cannot
be determined due to malformed date headers. With this option these
messages are always deleted. Beware: this can lead to deletion of
recent messages.
</dd>
<p></p></dl>
<p>
</p>
<hr />
<h1><a name="description">DESCRIPTION</a></h1>
<p>Fetchmail downloads (``fetches'') messages from a POP3 mailserver and
forwards them your local (client) machine's delivery system using SMTP.
It can either leave a copy of these messages on that server or delete
them entirely. Many users of fetchmail have requested the possibility to
postpone that deletion to a later date. Every single user has different
reasons for that request. As per the FAQ (see
<a href="http://catb.org/~esr/fetchmail/fetchmail-FAQ.html),">http://catb.org/~esr/fetchmail/fetchmail-FAQ.html),</a> item G5, fetchmail
is not meant to implement policy; hence the second-most-requested
feature for fetchmail is denied. Popclean comes to the rescue.</p>
<p>Popclean is a perl script that deletes messages from a POP3 server a
certain amount of time after they have been received by that server. It
does so by looking at the latest ``Received:'' header. It was designed to
work in conjunction with fetchmail. By default, account information is
obtained from the fetchmail configuration. Popclean will also look at
the .fetchids file to determine if a message was received by the local
host before deleting it from the POP server. This helps in avoiding
deletion of unread messages.</p>
<p>Additionally, popclean can delete messages that exceed a certain size
or contain a tag in the subject line that was inserted by a spamfilter.</p>
<p>Provided the correct set of
arguments was specified no Fetchmail information is needed. Many options
control the behaviour of popclean. Some of them actually make the
presence of fetchmail optional.</p>
<p>
</p>
<hr />
<h1><a name="environment">ENVIRONMENT</a></h1>
<p>No environment variables, aside from those used by perl, are required
to be set.</p>
<p>
</p>
<hr />
<h1><a name="see_also">SEE ALSO</a></h1>
<p><code>fetchmail(1)</code></p>
<p>
</p>
<hr />
<h1><a name="author">AUTHOR</a></h1>
<p>Jan Klaverstijn <<a href="mailto:[email protected]">[email protected]</a>></p>
<p>
</p>
<hr />
<h1><a name="prerequisites">PREREQUISITES</a></h1>
<dl>
<dt><strong><a name="item_mail_3a_3apop3client">Mail::POP3Client</a></strong><br />
</dt>
<dt><strong><a name="item_mail_3a_3aheader">Mail::Header</a></strong><br />
</dt>
<dt><strong><a name="item_http_3a_3adate">HTTP::Date</a></strong><br />
</dt>
<dt><strong><a name="item_sys_3a_3asyslog">Sys::Syslog</a></strong><br />
</dt>
</dl>
</body>
</html>