Re: IMAP filter
Ingo Klöcker <[email protected]>
| Newsgroups | gmane.comp.kde.users.pim |
|---|---|
| Message-ID | <[email protected]> |
On Thursday 12 February 2009, Paul Cartwright wrote: > On Wed February 11 2009, Ingo Klöcker wrote: > > > rewrite header "Subject" > > > replace "\s*\[mailing list name\]\s*" > > > with "" > > > > > > Does this rewirite the header on the IMAP server or just locally? > > > > On the server. > > > > One important thing to keep in mind: By design the IMAP protocol > > does not allow the alteration of messages. Therefore any change > > requires an upload of the altered message and a subsequent deletion > > of the obsolete copy of the message. > > I just tried to change my filter for this list, and added a line to > change the subject from: > [kde-pim-users] to "". > once I did that, here is what the subject looked like for a message: > > R"": [""""""""""""-""""""""""] S""""ll hav""""g """"c""""""""g > """"""bl"""""" (that was a message from Anne Wilson) You missed the backslashes from the tip of the day. KMail interprets the search pattern, i.e. [kde-pim-users] as regular expression [1]. In a regular expression the brackets denote an alternative, e.g. [0-9] means "any of the characters 0, 1, 2, ..., 9" So [kde-pim-users] means 'k' or 'd' or any character from 'e' to 'p' or 'i' or any character from 'm' to 'u' or 's' or 'e' or 'r' or 's'. Consequently, KMail replaced any of those characters by "" (i.e. by two " characters). To get what you really meant, i.e. '[' followed by 'k' followed by 'd' ... you have to specify \[kde-pim-users\] as search pattern. The backslash prevents the special interpretation of the brackets. As replacement text you should enter nothing instead of two " characters. Thinking about it, using regular expressions is not really user-friendly. Regards, Ingo [1] http://en.wikipedia.org/wiki/Regular_expression _______________________________________________ KDE PIM users mailing list [email protected] https://mail.kde.org/mailman/listinfo/kdepim-users
signature.asc
(application/pgp-signature, 197 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) iEYEABECAAYFAkmTZEAACgkQGnR+RTDgudhXSACgv3nnnUPp5b5w7SZVWul0XsFV 8ocAn1JOl7AUgf+A/SnNt0g2Hvhj+C1i =eS53 -----END PGP SIGNATURE-----