[oS-en] Can someone help me with imapfilter?
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, I was told recently about this tool. It uses lua language to do filtering operations on a remote imap server. I have some rules that work, and one that doesn't. I'm following the examples here: https://github.com/lefcha/imapfilter/blob/master/samples/config.lua -- Get messages with the specified "Sender" header, which are older than -- 30 days. results = account1.INBOX:contain_field('sender', 'owner@announce-list') * account1.INBOX:is_older(30) -- Move messages to the "announce" mailbox inside the "lists" folder. results:move_messages(account1['lists/announce']) I have in ~/.imapfilter/config.lua: - -- define and name the account gmx_l = IMAP { server = 'imap.gmx.com', username = '...', password = '...', ssl = 'tls1' } - -- define the operation on the named account. Non_OT_GX_L = gmx_l.INBOX:contain_field('List-Id:', '<users.lists.opensuse.org>') * gmx_l.INBOX:is_older(2) Non_OT_GX_L:move_messages(gmx_l['temp_g']) The purpose is to find emails that contain the header List-Id: <users.lists.opensuse.org> AND are older than 2 days. Then it moves them to a folder named 'temp_g' But it is moving 148 mails, many of which have a different List-Id header, or no such header at all. I don't know what is going on, or where to ask (not on github, nobody answers there). It is a very intersting tool, but it is useless to me if it misbehaves like this. I have a log of the transaction with the server - actually, 3 servers, but the one that has problems is marked with "(7)", so I had to trim a bit the text here for clarity): S (7): * OK [CAPABILITY IMAP4rev1 CHILDREN ENABLE ID IDLE LIST-EXTENDED LIST-STATUS LITERAL- MOVE NAMESPACE SASL-IR SORT SPECIAL-USE THREAD=ORDEREDSUBJECT UIDPLUS UNSELECT WITHIN AUTH=LOGIN AUTH=PLAIN] IMAP server ready H migmx106 28.0 IMAP-1MwxIx-1q... C (7): 100A NOOP S (7): 100A OK NOOP completed C (7): 100B CAPABILITY S (7): 100B OK CAPABILITY completed C (7): 100C LOGIN "...@gmx.es" * S (7): 100C OK LOGIN completed C (7): 100D CAPABILITY S (7): 100D OK CAPABILITY completed C (7): 100E NAMESPACE S (7): 100E OK NAMESPACE completed C (7): 1016 SELECT "INBOX" S (7): 1016 OK [READ-WRITE] SELECT completed C (7): 1017 UID SEARCH ALL HEADER List-Id: "<users.lists.opensuse.org>" S (7): 1017 OK UID SEARCH completed C (7): 1018 UID SEARCH ALL BEFORE 19-Mar-2024 S (7): 1018 OK UID SEARCH completed C (7): 1019 UID COPY 185711:185858 "temp_g" S (7): 1019 OK [COPYUID 1629482218 185711:185858 63249:63396] UID COPY completed C (7): 101A UID STORE 185711:185858 +FLAGS.SILENT (\Deleted) S (7): 101A OK UID STORE completed C (7): 101B EXPUNGE S (7): 101B OK EXPUNGE completed 148 messages moved from robin.listas@gmx.es@imap.gmx.com/INBOX to robin.listas@gmx.es@imap.gmx.com/temp_g. C (7): 101C LOGOUT S (7): 101C OK LOGOUT completed C (6): 101D LOGOUT S (6): 101D OK Logout completed (0.000 + 0.000 secs). C (5): 101E LOGOUT S (5): 101E OK 73 good day (Success) and a separate internal log - I have to check the lines those with "(7)" in them, and trim the others for clarity: 1016 SELECT "INBOX" getting response (7): * 7116 EXISTS * 0 RECENT * FLAGS (\Answered \Flagged \Deleted \Seen \Draft $Forwarded $label1 $label3 $label4 Junk NonJunk hecho list-ot maldito non-ot nonjunk os-ot ot) * OK [PERMANENTFLAGS (\Answered \Flagged \Draft \Deleted \Seen $Forwarded $label1 $label3 $label4 Junk NonJunk hecho list-ot maldito non-ot nonjunk os-ot ot \*)] Unlimited * OK [UNSEEN 8] Message 8 is first unseen * OK [UIDNEXT 185859] Predicted next UID * OK [UIDVALIDITY 1534365692] UIDs valid 1016 OK [READ-WRITE] SELECT completed sending command (7): 1017 UID SEARCH ALL HEADER List-Id: "<users.lists.opensuse.org>" getting response (7): * SEARCH 181019 181023 181025 181026 181027 ... 1017 OK UID SEARCH completed sending command (7): 1018 UID SEARCH ALL BEFORE 19-Mar-2024 getting response (7): * SEARCH 138431 138767 139261 139337 139395 139403 139498 ... getting response (7): 170492 170493 170494 170495 170496 170497 170498 ... getting response (7): ... 5308 185309 185310 185311 185312 ... 1018 OK UID SEARCH completed conversion: 'temp_g' -> 'temp_g' sending command (7): 1019 UID COPY 185711:185858 "temp_g" getting response (7): 1019 OK [COPYUID 1629482218 185711:185858 63249:63396] UID COPY completed sending command (7): 101A UID STORE 185711:185858 +FLAGS.SILENT (\Deleted) getting response (7): 101A OK UID STORE completed sending command (7): 101B EXPUNGE getting response (7): * 6969 EXPUNGE * 6969 EXPUNGE * 6969 EXPUNGE ... * 6969 EXPUNGE * 6968 EXISTS 101B OK EXPUNGE completed sending command (7): 101C LOGOUT getting response (7): * BYE Server logging out 101C OK LOGOUT completed Ideas? I'm thinking that it is possibly a bug on the gmx imap server. - -- Cheers Carlos E. R. (from 15.4 x86_64 at Telcontar) -----BEGIN PGP SIGNATURE----- iHoEARECADoWIQQZEb51mJKK1KpcU/W1MxgcbY1H1QUCZfyHYRwccm9iaW4ubGlz dGFzQHRlbGVmb25pY2EubmV0AAoJELUzGBxtjUfV5OsAn2Q5GuoocPmVxJR8NVYD mK2D0QnmAJ9GHQyQNeOmlt+2wn4FPsiv8ioZIw== =UVJD -----END PGP SIGNATURE-----
Hey. I stumbled upon this essay service https://www.tiktok.com/@essayservice_com during a particularly hectic semester, and I couldn't be more grateful! Their team of professional writers has saved my grades countless times with their impeccable work and quick turnaround. The ordering process is simple, and the customer support team is always responsive and helpful. Plus, their commitment to confidentiality gives me peace of mind. Whether I need help with a last-minute assignment or ongoing support throughout the semester, this site has become my go-to for academic assistance. I highly recommend it to any student needing reliable and high-quality services.
On 2024-03-21 20:15, Carlos E. R. wrote:
Hi,
I was told recently about this tool. It uses lua language to do filtering operations on a remote imap server.
I have some rules that work, and one that doesn't. I'm following the examples here:
https://github.com/lefcha/imapfilter/blob/master/samples/config.lua
Turns out that the GMX server search functionality is broken. The same rules work on a different server. I did a test. I do the same search using Alpine on GMX. Search for arbitrary header "List-Id" with contents "users.lists.opensuse.org", and it results in 224 messages selected, and indeed it selects the wrong messages :-/ -- Cheers / Saludos, Carlos E. R. (from 15.5 x86_64 at Telcontar)
participants (2)
-
Carlos E. R.
-
ginahoc292@storesr.com