Re: [Feature Request] doveadm option to return number of messages acted upon

2016-02-25 Thread A. Schulze


Haravikk:

So I have a script for handling my specific archive and expunge  
needs, but it’d be nice to be able to track how many messages are  
being affected.


Currently I’m doing it by firing the same search queries into  
doveadm search and counting the lines of the result with wc -l, but  
that’s not a very pretty solution. While I’m mostly doing it out of  
interest on a personal server, I can’t imagine it’s a very scalable  
way to do it if you wanted to gather some kind of metrics for example.


What I think would make sense would be for relevant doveadm commands  
such as move, expunge (probably purge too) and others I haven’t  
thought of to have a new option that, if enabled, will cause the  
command to output the number of messages affected as the final line  
of output (most of these commands don’t have any output anyway). A  
doveadm count command could also be a convenient, more efficient,  
alternative to doveadm search | wc -l.


+1
statistics are always nice

Andreas


Re: Replication between two ISPCOnfig servers

2016-02-25 Thread Philon
Hi Otto

if Dovecot users are setup through SQL you might want to check the iterate
query. So that things like for example doveadm quota get -A work. So look
into your SQL config, there you must setup the sql query. Then doveadm sync
-A should do what you expect.


Philon


2016-02-22 11:44 GMT+01:00 Otto Saayman :

> Hello
>
> I have set up two servers, one master and one slave, using ISPConfig. I
> have been using rsync to synchronise mails between the two machines, but
> this has some unstable results.
>
> I had a look at setting up replication:
> http://wiki.dovecot.org/Replication
>
> When I run the command, doveadm user '*', only two users are returned. So
> when I run this command: doveadm replicator replicate \* I get: 2 users
> updated
>
> I run this command:
> doveadm sync -u [e-mail address] tcp:[2nd/ slave dovecot server IP
> address]
>
> Here I can input any valid e-mail address in the ISPConfig MySQL database
> and it works.
>
> How do I tell the dovecote server to replicate all the users configured in
> the MySQL database it uses when it handles logins via POP/ IMAP, all of
> which is working fine?
>
> Is there a command I need to run at a set interval via cron to synchronise
> the two machines' mailboxes, which are identical in every way except the
> mails the users' mailboxes contain?
>
> OR
>
> Is there a way that I can instruct the two machines to keep each other's
> user mailbox contents "up to date"?
>
> The main idea is to have a hot backup of my "main" dovecot server and also
> to enable a lower mail priority for the second server so that mails are
> still received when the main server becomes busy, or is taken offline for
> some reason.
>
> Any help, or link to a HOWTO would be appreciated.
>
> --
>
> Best Regards
>
> Otto Saayman
>


[Feature Request] doveadm option to return number of messages acted upon

2016-02-25 Thread Haravikk
So I have a script for handling my specific archive and expunge needs, but it’d 
be nice to be able to track how many messages are being affected.

Currently I’m doing it by firing the same search queries into doveadm search 
and counting the lines of the result with wc -l, but that’s not a very pretty 
solution. While I’m mostly doing it out of interest on a personal server, I 
can’t imagine it’s a very scalable way to do it if you wanted to gather some 
kind of metrics for example.

What I think would make sense would be for relevant doveadm commands such as 
move, expunge (probably purge too) and others I haven’t thought of to have a 
new option that, if enabled, will cause the command to output the number of 
messages affected as the final line of output (most of these commands don’t 
have any output anyway). A doveadm count command could also be a convenient, 
more efficient, alternative to doveadm search | wc -l.

Checking index sanity

2016-02-25 Thread Emmanuel Dreyfus
Hello

We experienced corrupted dovecot indexes, probably caused by a server
crash. This does not cause a lot of harm, just annoyance. For instance,
LMTP raises an assertion during delivery, which causes mail to multiple 
recipients e-mail to remain in the queue if a single of them hits a 
corrupted index.

The workaround for now is to detect the situation in the logs and to remove 
corrupted indexes when the problem arise.

A better fix would be to sanity check all user's index on startup. Is 
there a command line tool to do this?

-- 
Emmanuel Dreyfus
m...@netbsd.org


Re: search problem dovecot 2.2.21 + fts - Solr

2016-02-25 Thread Teemu Huovila


On 24.02.2016 21:14, Anderson Barbosa wrote:
> Hello,
> 
> Realized update dovecot on my server. Now the search is returning
> differently from the previous version bringing reference information of
> other messages .
> For example when doing a search for anderson.joao this new version of the
> dovecot dovecot 2.2.21 + fts - Solr response will be all email that has the
> word anderson and joao, instead of returning only items with the word
> anderson.joao.
> 
> Before used version 2.2.18 + dovecot fts - Solr and the problem did not
> occur .
> For example practical test :
> 
> Dovecot 2.2.18
> 
> 
> # telnet SERVER 143
> Trying SERVER...
> Connected to SERVER.
> Escape character is '^]'.
> * OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE
> AUTH=PLAIN] Zimbra IMAP4.
> a login co...@conta.com.br 1223456
> a OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE
> SORT SORT=DISPLAY THREAD=REFERENCES THREAD=REFS THREAD=ORDEREDSUBJECT
> MULTIAPPEND URL-PARTIAn
> a select  INBOX
> * FLAGS (\Answered \Flagged \Deleted \Seen \Draft)
> * OK [PERMANENTFLAGS (\Answered \Flagged \Deleted \Seen \Draft \*)] Flags
> permitted.
> * 14 EXISTS
> * 0 RECENT
> * OK [UIDVALIDITY 1452548222] UIDs valid
> * OK [UIDNEXT 25] Predicted next UID
> * OK [HIGHESTMODSEQ 52] Highest
> a OK [READ-WRITE] Select completed (0.001 secs).
> a SEARCH text "anderson"
> * SEARCH 11 12 (2 found emails)
> a OK Search completed (0.265 secs).
> a SEARCH text "joao"
> * SEARCH 13 14 (2 found emails)
> a OK Search completed (0.003 secs).
> a SEARCH text "anderson.joao"
> * SEARCH (0 found emails)
> a OK Search completed (0.004 secs).
> a logout
> * BYE Logging out
> a OK Logout completed.
> Connection closed by foreign host.
> 
> 
> Dovecot 2.2.21
> 
> # telnet SERVER 143
> Trying SERVER...
> Connected to SERVER.
> Escape character is '^]'.
> * OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE
> AUTH=PLAIN] Zimbra IMAP4.
> a login co...@conta.com.br 1223456
> a OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE
> SORT SORT=DISPLAY THREAD=REFERENCES THREAD=REFS THREAD=ORDEREDSUBJECT
> MULTIAPPEND URL-PARTIAn
> a select INBOX
> * FLAGS (\Answered \Flagged \Deleted \Seen \Draft)
> * OK [PERMANENTFLAGS (\Answered \Flagged \Deleted \Seen \Draft \*)] Flags
> permitted.
> * 14 EXISTS
> * 0 RECENT
> * OK [UIDVALIDITY 1452548222] UIDs valid
> * OK [UIDNEXT 25] Predicted next UID
> * OK [HIGHESTMODSEQ 52] Highest
> a OK [READ-WRITE] Select completed (0.000 + 0.000 secs).
> a SEARCH text "anderson"
> * SEARCH 11 12 (2 found emails)
> a OK Search completed (0.004 + 0.000 secs).
> a SEARCH text "joao" (2 found emails)
> * SEARCH 13 14
> a OK Search completed (0.005 + 0.000 secs).
> a SEARCH text "anderson.joao"
> * SEARCH 11 12 13 14 *(4 found emails)*
> a OK Search completed (0.005 + 0.000 secs).
> a logout
> * BYE Logging out
> a OK Logout completed.
> Connection closed by foreign host.
> 
> Even using characters Special "" \ scape, ' ' for an answer will always be
> all emails with the word anderson and joao.
> Checking the Changelog dovecot noticed que NAS versions Previous v2.2.20
> and v2.2.19 certain changes with respect to fts .
> 
> There Have Another way to Make Search for Exact Word In this new version to
> loft?

This is most likely fixed by  
https://github.com/dovecot/core/commit/f3b0efdcbd0bd9059574c8f86d6cb43e16c8e521 
The fix will be included in 2.2.22, which will hopefully be released some time 
mid-march.
If you can, please test with a build from current git master tip and let us 
know, if it does not.

br,
Teemu Huovila