[imapfilter-devel] i18n and difference bitween match_subject() and contain_subject()
Alexander Polyakhov
apolyakhov at gmail.com
Mon Nov 23 22:11:13 EET 2009
Lefteris Chatzimparmpas wrote:
> On Tue, Nov 17, 2009 at 01:33:08PM +0300, Alexander Polyakhov wrote:
>
>
> Instead of contain_subject(), can you try using the send_query()
> function, and specify a character set, like this:
>
>
> account.INBOX:send_query('ALL SUBJECT "Ответ на ваш комментарийна welinux.ru"', "ISO-8859-7")
>
> ... where instad of "ISO-8859-7" (greek character set), you should use
> what is appropriate for your language, or maybe try "UTF-8".
>
Hi. My new rule looks like that:
result = yandex.lwilis.INBOX:send_query('ALL SUBJECT "Ответ на ваш
комментарий на welinux.ru"', "UTF-8")
Here is the log from imapfilter -v:
S (3): * OK Yandex IMAP4rev1 1.8.18 at imap11:993 ready to talk with
217.197.251.19:62503 2009-Nov-23
22:56:56
C (3): 1000
CAPABILITY
S (3): 1000 OK CAPABILITY completed
C (3): 1001 LOGIN "lwilis" *
S (3): 1001 OK LOGIN completed
C (3): 1002 SELECT "INBOX"
S (3): 1002 OK [READ-WRITE] SELECT completed
C (3): 1003 UID SEARCH CHARSET "UTF-8" ALL ALL SUBJECT "Ответ на ваш
комментарий на welinux.ru"
S (3): 1003 OK SEARCH completed
C (3): 1004 UID SEARCH ALL SEEN
S (3): 1004 OK SEARCH completed
C (3): 1005 UID SEARCH ALL SUBJECT "Ответ на ваш пост на welinux.ru"
S (3): 1005 OK SEARCH completed
C (3): 1006 UID SEARCH ALL SEEN
S (3): 1006 OK SEARCH completed
S (4): * OK Gimap ready for requests from 217.197.251.19 5if7002249fxm.28
C (4): 1007 CAPABILITY
S (4): 1007 OK Thats all she wrote! 5if7002249fxm.28
C (4): 1008 LOGIN "apolyakhov at gmail.com" *
S (4): 1008 OK apolyakhov at gmail.com authenticated (Success)
C (4): 1009 SELECT "INBOX"
S (4): 1009 OK [READ-WRITE] INBOX selected. (Success)
C (4): 100A UID SEARCH ALL FROM "'@bazar2.conectiva.com.br'"
S (4): 100A OK SEARCH completed (Success)
C (4): 100B UID SEARCH ALL TO "'@bazar2.conectiva.com.br'"
S (4): 100B OK SEARCH completed (Success)
C (4): 100C UID SEARCH ALL SEEN
S (4): 100C OK SEARCH completed (Success)
C (4): 100D UID SEARCH ALL FROM "'@lists.hellug.gr'"
S (4): 100D OK SEARCH completed (Success)
C (4): 100E UID SEARCH ALL TO "'@lists.hellug.gr'"
S (4): 100E OK SEARCH completed (Success)
C (4): 100F UID SEARCH ALL SEEN
S (4): 100F OK SEARCH completed (Success)
C (4): 1010 UID COPY 760 "lists/imapfilter"
S (4): 1010 OK [COPYUID 603005609 760 6] (Success)
C (4): 1011 UID STORE 760 +FLAGS.SILENT (\Deleted)
S (4): 1011 OK Success
C (4): 1012 EXPUNGE
S (4): 1012 OK Success
1 messages moved from apolyakhov at gmail.com@imap.gmail.com/INBOX to
apolyakhov at gmail.com@imap.gmail.com/lists/imapfilter.
C (3): 1013 LOGOUT
C (4): 1014 LOGOUT
S (4): 1014 OK 73 good day (Success)
> If that works then since imapfilter lacks some option to have a charset
> for all search queries at the moment (too bad I forgot to add that), you
> can work around this by editing the /usr/share/imapfilter/mailbox.lua
> (or wherever mailbox.lua is installed), and change line 72 from:
>
> charset = ''
>
> ... to whatever your charset should be by default.
>
> I'll add some global option for the charset for searching at the next
> release...
>
>
Seems no luck:
S (3): * OK Yandex IMAP4rev1 1.8.18 at imap2:993 ready to talk with
217.197.251.19:64821 2009-Nov-23 23:09:23
C (3): 1000 CAPABILITY
S (3): 1000 OK CAPABILITY completed
C (3): 1001 LOGIN "lwilis" *
S (3): 1001 OK LOGIN completed
C (3): 1002 SELECT "INBOX"
S (3): 1002 OK [READ-WRITE] SELECT completed
C (3): 1003 UID SEARCH CHARSET "UTF-8" ALL ALL SUBJECT "Ответ на ваш
комментарий на welinux.ru"
S (3): 1003 OK SEARCH completed
C (3): 1004 UID SEARCH CHARSET "UTF-8" ALL SEEN
S (3): 1004 OK SEARCH completed
C (3): 1005 UID SEARCH CHARSET "UTF-8" ALL SUBJECT "Ответ на ваш пост на
welinux.ru"
S (3): 1005 OK SEARCH completed
C (3): 1006 UID SEARCH CHARSET "UTF-8" ALL SEEN
S (3): 1006 OK SEARCH completed
S (4): * OK Gimap ready for requests from 217.197.251.19 3if6211657bwz.36
C (4): 1007 CAPABILITY
S (4): 1007 OK Thats all she wrote! 3if6211657bwz.36
C (4): 1008 LOGIN "apolyakhov at gmail.com" *
S (4): 1008 OK apolyakhov at gmail.com authenticated (Success)
C (4): 1009 SELECT "INBOX"
S (4): 1009 OK [READ-WRITE] INBOX selected. (Success)
C (4): 100A UID SEARCH CHARSET "UTF-8" ALL FROM "'@bazar2.conectiva.com.br'"
S (4): 100A OK SEARCH completed (Success)
C (4): 100B UID SEARCH CHARSET "UTF-8" ALL TO "'@bazar2.conectiva.com.br'"
S (4): 100B OK SEARCH completed (Success)
C (4): 100C UID SEARCH CHARSET "UTF-8" ALL SEEN
S (4): 100C OK SEARCH completed (Success)
C (4): 100D UID SEARCH CHARSET "UTF-8" ALL FROM "'@lists.hellug.gr'"
S (4): 100D OK SEARCH completed (Success)
C (4): 100E UID SEARCH CHARSET "UTF-8" ALL TO "'@lists.hellug.gr'"
S (4): 100E OK SEARCH completed (Success)
C (4): 100F UID SEARCH CHARSET "UTF-8" ALL SEEN
S (4): 100F OK SEARCH completed (Success)
C (3): 1010 LOGOUT
C (4): 1011 LOGOUT
S (4): 1011 OK 73 good day (Success)
I`m using IMAPFilter 2.1 already.
More information about the Imapfilter-devel
mailing list