[kdepim-users] IMAP filter

Ingo Klöcker kloecker at kde.org
Wed Feb 11 23:50:18 GMT 2009


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kdepim-users/attachments/20090212/b7b96b81/attachment.sig>
-------------- next part --------------
_______________________________________________
KDE PIM users mailing list
kdepim-users at kde.org
https://mail.kde.org/mailman/listinfo/kdepim-users


More information about the kdepim-users mailing list