[Users] Processing Rules: Header defined

wwp subscript at free.fr
Mon Feb 6 17:04:50 CET 2012


Hello Christian,


On Wed, 1 Feb 2012 14:08:09 +0100 Christian Hesse <list at eworm.de> wrote:

> wwp <subscript at free.fr> on Wed, 1 Feb 2012 11:42:28 +0100:
> > Hello Christian,
> > 
> > 
> > On Wed, 1 Feb 2012 11:33:18 +0100 Christian Hesse <list at eworm.de> wrote:
> > 
> > > Hello everybody,
> > > 
> > > when creating processing rules for headers you can choose whether they
> > > contain a string or do not contain a string.
> > > 
> > > My mobile phone stores sent Mails without a Date header set. Therefore I
> > > would like to have check "header exists". Is there something like that?
> > > Any reason not to implement it?
> > 
> > There's no such rule, you can you use a regexp rule to match "." (w/o
> > the quotes, . meaning any character in regexp). That way only an
> > existing, non-empty value will match.
> > 
> > Why isn't there a "header exists"? Well.. hmm, I don't have a precise
> > answer - I remember this topic raising from time to time - because
> > regexp . is enough to test it maybe?
> 
> Ok, makes sense if it works. I did not notice the regexp option.
> I do have this now:
> 
> ~header "Date" regexp "."
> execute "/usr/lib/claws-mail/tools/fix_date.sh %F"
> 
> But it does not work. Are scripts not allowed to modify messages from
> processing rules?
> And would it make sense to allow actions for processing actions?

Sorry for my late reply, did you get any progress on that?

I've made a short test w/ a sample, and I get mixed results, see:

In a test folder, 3 emails:
  a) one with a valid Date: field (seen OK by Claws Mail),
  b) another one w/ *no* date field (seen OK -> (No Date) ),
  c) yet another one w/ an empty Date: field (Date:\n).

Added both processing rules to folder:
  ~header "Date" regexpcase "." color 2   (red)
  header "Date" regexpcase "." color 6    (green)

I get a) in green, b) in red, c) un-coloured.

Instead, with:
  ~header "Date" regexpcase "^" color 2   (red)
  header "Date" regexpcase "^" color 6    (green)

I get a) in green, b) in green, c) un-coloured.

Which leads me to think that when a header is not there at all, it
can't match a rule that explicitly names it. I didn't thought of that.
And also think that I won't use regexp "^" in such situation (maybe
unexpected, though).

I personally apply the fix_date script manually when I detect a broken
or missing Date: field. The script should be safe enough to apply to
all emails in folder, but you'll see an impact in terms of
performances, I presume.


> And even more important... If a local file changes, can I sync it back to the
> IMAP server automatically?

My IMAP knownledge is nearly zero, but I don't think that you can
upload a modified email to the IMAP server.. Anyone to confirm?


Regards,

-- 
wwp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.claws-mail.org/pipermail/users/attachments/20120206/3b6d6081/attachment.sig>


More information about the Users mailing list