Re: [Bug] FTS double escaping

2017-04-09 Thread azurit


Citát azu...@pobox.sk:


Citát Timo Sirainen :


On 6 Apr 2017, at 14.58, azu...@pobox.sk wrote:


Hi,

i'm trying to resolve few problems with indexing 'From' headers  
using FTS/Solr. I was tcpdumping the communication between Dovecot  
and Jetty/Solr and noticed that 'From' headers, which includes  
also sender's name, are double escaped. This is what was Dovecot  
sending to Solr:


Name Surname  
lt;t...@example.comgt;


As you can see, characters < and > were escaped to  and   
which were, again, escaped to lt; and gt;. This is doing  
problems while trying to index whole e-mail address, as Solr sees  
it as 't...@example.com'.


I spend hours trying to figure out why i'm able to search in all  
parts of e-mail addresses but searching for full and exact e-mail  
address was successfull ONLY for messages which doesn't include  
sender's name in 'From' header. Finally, after i found this bug,  
this fixed all search problems:


pattern="lt;" replacement=""/>
pattern="gt;" replacement=""/>


I hope that, at least, this bug, reported by me, will be fixed. Thank you.


The attached patch should also help.



Works fine, thank you!



Will this fix gets into 2.2.29?


Re: [Bug] FTS double escaping

2017-04-09 Thread azurit


Citát Timo Sirainen :


On 6 Apr 2017, at 14.58, azu...@pobox.sk wrote:


Hi,

i'm trying to resolve few problems with indexing 'From' headers  
using FTS/Solr. I was tcpdumping the communication between Dovecot  
and Jetty/Solr and noticed that 'From' headers, which includes also  
sender's name, are double escaped. This is what was Dovecot sending  
to Solr:


Name Surname  
lt;t...@example.comgt;


As you can see, characters < and > were escaped to  and   
which were, again, escaped to lt; and gt;. This is doing  
problems while trying to index whole e-mail address, as Solr sees  
it as 't...@example.com'.


I spend hours trying to figure out why i'm able to search in all  
parts of e-mail addresses but searching for full and exact e-mail  
address was successfull ONLY for messages which doesn't include  
sender's name in 'From' header. Finally, after i found this bug,  
this fixed all search problems:


replacement=""/>
replacement=""/>


I hope that, at least, this bug, reported by me, will be fixed. Thank you.


The attached patch should also help.



Works fine, thank you!


Re: How to use quota with dovecot

2017-04-09 Thread chaouche yacine


On Saturday, April 8, 2017 9:47 AM, Mik J  wrote:
> Then commented out in 90-quota.conf
>
>quota_rule = *:storage=1G
>
>quota_rule2 = Trash:storage=+100M
>
>quota_grace = 10%%
>
>}


You also need to define what type of quota do you want, dict-based, maildir 
based, static (same quota for all)... Figure out what quota you want then add 
the missing "quota=" line. I configured maildir based quotas and the line looks 
like this on my config file : 


90-quota.conf: 

quota = maildir:User quota

This will create and maintain a maildirsize file in the maildirs. Of course, 
this doesn't work for mboxes.


  -- Yassine.


Re: [Bug] FTS double escaping

2017-04-09 Thread Timo Sirainen
On 6 Apr 2017, at 14.58, azu...@pobox.sk wrote:
> 
> Hi,
> 
> i'm trying to resolve few problems with indexing 'From' headers using 
> FTS/Solr. I was tcpdumping the communication between Dovecot and Jetty/Solr 
> and noticed that 'From' headers, which includes also sender's name, are 
> double escaped. This is what was Dovecot sending to Solr:
> 
> Name Surname 
> lt;t...@example.comgt;
> 
> As you can see, characters < and > were escaped to  and  which were, 
> again, escaped to lt; and gt;. This is doing problems while trying 
> to index whole e-mail address, as Solr sees it as 't...@example.com'.
> 
> I spend hours trying to figure out why i'm able to search in all parts of 
> e-mail addresses but searching for full and exact e-mail address was 
> successfull ONLY for messages which doesn't include sender's name in 'From' 
> header. Finally, after i found this bug, this fixed all search problems:
> 
>  replacement=""/>
>  replacement=""/>
> 
> I hope that, at least, this bug, reported by me, will be fixed. Thank you.

The attached patch should also help.



solr.diff
Description: Binary data


[Bug] FTS invalid address parsing

2017-04-09 Thread azurit

Hi,

i found another bug in FTS while parsing  
quoted-printable/base64-encoded sender's name inside 'From' header  
(again, i was figuring out why some of messages cannot be searched).



Header: From: =?UTF-8?Q?A=2CB?= 
Data send to Solr by Dovecot: A@, B  
lt;t...@example.comgt;



Header: From: =?UTF-8?Q?A_B=2CC?= 
Data send to Solr by Dovecot: A@


Header: From: =?UTF-8?B?QSBCLEMK?= 
Data send to Solr by Dovecot: A@


Dovecot 2.2.27.

azur


Re: sieve does not seem to be working

2017-04-09 Thread Robert Moskowitz

Yassine,

I believe I sent a 'solved' message.  It was a permission problem in 
that .svbin was owned by root.  I have my commands in the wrong order in 
my script.


Robert

On 04/09/2017 06:34 AM, chaouche yacine wrote:

Hello Robert,

You said that the script worked when you ran it with sieve-test, proabably as 
root user, but not when you sent an e-mail with sendmail, which I guess would 
run it as the dovecot user (probably vmail as you said you changed the 
ownership of the e-mail to vmail:mail ?)


You forgot to show us the file permissions on the script and the folder 
containing it. A namei -l on the whole path can show if dovecot can reach it.

Example :


root@messagerie-secours[10.10.10.20] ~ # namei -l 
/var/vmail/mailfilters/spam.svbin
f: /var/vmail/mailfilters/spam.svbin
drwxr-xr-x root  root  /
drwxr-xr-x root  root  var
drwxr-xr-x vmail vmail vmail
drwxr-xr-x root  root  mailfilters
-rw-r--r-- vmail vmail spam.svbin
root@messagerie-secours[10.10.10.20] ~ #




   -- Yassine.



Re: sieve does not seem to be working

2017-04-09 Thread chaouche yacine
Hello Robert,

You said that the script worked when you ran it with sieve-test, proabably as 
root user, but not when you sent an e-mail with sendmail, which I guess would 
run it as the dovecot user (probably vmail as you said you changed the 
ownership of the e-mail to vmail:mail ?)


You forgot to show us the file permissions on the script and the folder 
containing it. A namei -l on the whole path can show if dovecot can reach it.

Example : 


root@messagerie-secours[10.10.10.20] ~ # namei -l 
/var/vmail/mailfilters/spam.svbin 
f: /var/vmail/mailfilters/spam.svbin
drwxr-xr-x root  root  /
drwxr-xr-x root  root  var
drwxr-xr-x vmail vmail vmail
drwxr-xr-x root  root  mailfilters
-rw-r--r-- vmail vmail spam.svbin
root@messagerie-secours[10.10.10.20] ~ # 




  -- Yassine.


Re: Using filter in an imapsieve script?

2017-04-09 Thread Tobi
Am 08.04.2017 um 10:00 schrieb Stephan Bosch:
> 
> However, I now remember I tested this in the past and there was one
> snag. The effect of this is that the message is stored twice in the Sent
> mailbox:
> 
> - The first is the original message. Since it was discarded, it has the
> \Deleted flag set and it will disappear at the next EXPUNGE
> - The encrypted message stored with "fileinto".
> 
I changed my sieve script as you described and get the following:

- if save encrypted to same mailbox as original message only the
original message can be seen in TB. Even restart TB does not change
anything. But the enc message is in Sent on server, just TB does
**never** show it

- if I save the encrypted message to another mailbox then I can see the
ecrypted msg in TB and the original msg in Sent

Do you think that the problem could be solved by using another client
instead of TB?
Is there a way around this issue on serverside? Like for example use
pipe? Or does pipe store the original message as well on server?

Cheers

tobi