<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#ffffff">
Thank you so much, Rob. :)<br>
<br>
Sorry so late on my response. I'll need to adjust the filter that
filtered this. ;)<br>
<br>
On 2011/02/27 17:48, Rob Austein wrote:
<blockquote cite="mid:20110227154829.B368E22829@thrintun.hactrn.net"
type="cite">
<pre wrap="">This is what I use, after Lefteris straightened me out on a few of the
details. Hack as necessary.
</pre>
<pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
myserver = IMAP {
server = "myserver.example.org",
username = "me",
password = "secret",
ssl = "tls1"
}
month = {
["Jan"] = "01", ["Feb"] = "02", ["Mar"] = "03", ["Apr"] = "04", ["May"] = "05", ["Jun"] = "06",
["Jul"] = "07", ["Aug"] = "08", ["Sep"] = "09", ["Oct"] = "10", ["Nov"] = "11", ["Dec"] = "12"
}
-- Archive old messages. This is (sort of) a recreation of something
-- that existed in the original 0.x version of imapfilter, rewritten
-- in LUA. Move old unflagged seen messages to archive mailboxes
-- named using the internal date of the message.
function archive(days, mailboxes)
for _, mailbox in ipairs(mailboxes) do
results = myserver[mailbox]:is_older(days) * myserver[mailbox]:is_seen() * myserver[mailbox]:is_unflagged()
targets = {}
for _, message in ipairs(results) do
mbox, uid = unpack(message)
date = mbox[uid]:fetch_date()
_, _, m, y = string.find(date, "%d+-(%a+)-(%d+)")
target = mailbox .. "." .. y .. "." .. month[m]
if targets[target] == nil then
targets[target] = Set {}
end
table.insert(targets[target], message)
end
for target, msgset in pairs(targets) do
msgset:move_messages(myserver[target])
end
end
end
archive(120, { "fee", "fie" })
archive(14, { "foe", "fum" })
</pre>
<pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
Imapfilter-devel mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Imapfilter-devel@lists.hellug.gr">Imapfilter-devel@lists.hellug.gr</a>
<a class="moz-txt-link-freetext" href="http://lists.hellug.gr/mailman/listinfo/imapfilter-devel">http://lists.hellug.gr/mailman/listinfo/imapfilter-devel</a></pre>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">--
__________
Brendan Hide
Mobile: +27 83 448 3867
Mobile: <a class="moz-txt-link-abbreviated" href="mailto:brendan.cell@swiftspirit.co.za">brendan.cell@swiftspirit.co.za</a> (plain text only please)
Web Africa - Internet Business Solutions - <a class="moz-txt-link-freetext" href="http://www.webafrica.co.za/?AFF1E97">http://www.webafrica.co.za/?AFF1E97</a></pre>
</body>
</html>