1 ******************* DELETE - LATER ********************
3 version 0.11 2007-02-06
6 A tool for deleting email messages on POP3 accounts
7 after a given period of time (in days)
9 E.g. if you want to keep the messages 30 days to
10 have webmail access while on the road
12 ********************************************************
14 The script queries the current contents of a POP3 mailbox,
15 stores the message IDs of that run and saves them to a
18 On each run, it compares the date on which the message was
19 first seen with the current date and deletes the message,
20 if that difference is greater than the value of the column
23 The script stores account settings in a separate MySQL
24 table for easy maintenance each email account needs an
27 The script scales well on large installations with several
28 thousands of messages a day if you run it at a time of low
29 email volume (e.g. at 4 am).
36 - MySQL database server and client software (v4.x or later,
39 MySQL sources (for compiling mysqltcl only)
41 - mysqltcl script (www.xdobry.de/mysqltcl/)
43 - libexpect (v5 or later)
50 1. create the tables "fetchmail" and "fetchmail_users" on a
51 MySQL server by running
53 CREATE TABLE `fetchmail` ( `UserID` BIGINT UNSIGNED NOT NULL DEFAULT 0, `UID` VARCHAR(255) NOT NULL DEFAULT '', `Fetchdate` DATE NOT NULL DEFAULT 0, PRIMARY KEY(`UserID`, `UID`));
55 CREATE TABLE `fetchmail_user` ( `UserID` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT, `server` VARCHAR(255) NOT NULL DEFAULT '', `username` VARCHAR(63) NOT NULL DEFAULT '', `password` VARCHAR(63) NOT NULL DEFAULT '', `retaindays` INTEGER UNSIGNED NOT NULL DEFAULT 0, PRIMARY KEY(`UserID`));
57 2. Fill the table "fetchmail_users" with the settings of the
58 email accounts you wish to handle
60 3. copy the script "delete-later" to a safe place, (on
61 Linux/Unix: make it executable) and edit the first lines to
62 match your MySQL setup
64 4. run "delete-later" via cron AFTER you fetched your emails
65 with settings that keep the messages on the server (e.g. via
73 The mysqltcl libraries sometimes don't compile against
74 earlier versions of MySQL 4.x.
76 If you are experiencing any problems with compiling
77 mysqltcl, please look for pre-compiled binaries for your
78 distribution (or contact mail@xdobry.de), the win32 binaries
79 work out of the box on most M$ systems.
81 As most linux distributions don't include mysqltcl, get the
82 latest precompiled 5.x series MySQL binariesand the matching
83 source code from www.mysql.com, install them onto a separate
84 location and run "configure && make && make install" to
85 compile mysqltcl yourself.
92 The age of an email message is calculated by the difference
93 in days between the run of "delete-later" it was first seen
94 on and the current date, not the actual date the message was
95 sent. So if you run the script every week, the period after
96 which a message is delete may vary up to 14 days.
98 This was implemented that way, because of the common
99 practice of spammers to change the message date to some date
100 in the far future to place the message first in your inbox.
107 Copyright (c) 2007 Yoo GmbH
109 09603 GROSSVOIGTSBERG
112 Permission to use, copy, modify, distribute, and sell this software
113 and its documentation for any purpose is hereby granted without fee,
114 provided that the content of this README file appears in all copies
115 of the software and related documentation.
122 THE SCRIPT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND.
124 WE (YOO) HEREBY DISCLAIM ALL WARRANTIES AND CONDITIONS WITH REGARD
125 TO THIS README AND SCRIPT, INCLUDING ALL WARRANTIES AND CONDITIONS
126 OF MERCHANTABILITY, WHETHER EXPRESS, IMPLIED OR STATUTORY, FITNESS
127 FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT.
129 IN NO EVENT SHALL YOO AND/OR ITS REPRESENTATIVES AND/OR RESPECTIVE
130 SUPPLIERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
131 DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA
132 OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
133 TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
134 PERFORMANCE OF THIS README OR SCRIPT.
141 For help, bug reports or other request regarding "delete-later" please
142 contact Carsten Ralle (English/German) by writing an e-mail to
144 cr <at> i4yoo <dot> de
146 with a subject starting with "DELETE-LATER: "
148 Please note that messages containing HTML or images will be
149 automatically deleted.
153 ********************************************************************************
154 Yoo GmbH, Zellwaldring 51, D-09603 Grossvoigtsberg, Germany
157 ********************************************************************************