Re: [Dovecot] Public mailboxes

2012-05-19 Thread Frank Bonnet




Le 19/05/2012 22:49, Timo Sirainen a écrit :

On 19.5.2012, at 23.40, Frank Bonnet wrote:


Le 19/05/2012 20:44, Timo Sirainen a écrit :

On Fri, 2012-05-18 at 14:31 +0200, Frank Bonnet wrote:


I'm trying to setup a server with public mailboxes only
but I cannot succeed.

Do you still have specific users? Do you want the users to have
subscriptions? Do you need ACLs?

yes I need specific users using ACL
and yes I would like users have subsciptions

OK, so then you need to have a per-user mail_location for the subscriptions. 
Something like:

namespace {
  list = children
  location = maildir:/var/mail/public
  prefix = public/
  separator = /
  subscriptions = no
  type = public
}
namespace inbox {
  location = maildir:/var/lib/dovecot/empty:CONTROL=/var/mail/user/%u
  prefix = /
  inbox = yes
}

With the "empty" directory being non-writable, the users can't create any 
private mailboxes, but with the writable control directory they can store subscriptions 
there.



OK I see, Thanks a LOT Timo !




Re: [Dovecot] dovecot fts_lucene indexes not being updated

2012-05-19 Thread Timo Sirainen
On 20.5.2012, at 5.15, Joe Beaubien wrote:

> Is it normal to not get output in the normal log files in this case, or did
> i miss something?

Before looking into it further, what's your doveconf -n output?



Re: [Dovecot] dovecot fts_lucene indexes not being updated

2012-05-19 Thread Joe Beaubien
On Sat, May 19, 2012 at 6:16 PM, Timo Sirainen  wrote:

> On 20.5.2012, at 0.12, Joe Beaubien wrote:
>
> >> You can run "doveadm index -u user" to get new mails indexed.
> >
> > Awesome, this does seem to work.
> >
> > 2 last questions:
> >
> > - Does it update both indexes (dovecot and fts) or only
> > dovecot.index.cache? I ask because I didn't see any index messages in log
> > files.
>
> It should update both. If it doesn't then there's some kind of a
> configuration problem.
>

How can I verify this? When I run "sudo ./doveadm -v index -u form INBOX2",
I see nothing in the normal log files. I do see the expected output on
stdout:

doveadm(form): Info: INBOX2: Caching mails seq=41808..41822
15/15
joe@XX:/opt/dovecot/bin$

However, I see nothing in the normal logs. I normally see a message similar
to "Indexed 500 new messages" when I force an fts update but I get nothing
in this case.

My config for plugins is pretty simple:

10-mail.conf:
mail_plugins = zlib fts fts_lucene

90-plugin.conf:
plugin {
  zlib_save_level = 6 # 1..9
  zlib_save = gz # or bz2
  fts = lucene
  fts_lucene = whitespace_chars="@.-_()[]{}<>/\\+"
}

Is it normal to not get output in the normal log files in this case, or did
i miss something?



>
> > - Is there a way to update the index of the entire email account instead
> of
> > doing it for each folder (mailbox)?
>
> You should be able to use '*' as the mailbox name.



I think there is an issue with the '*' wildcard. It doesn't seem to do
anything. It returns instantly, doesn't give any message or error, even in
verbose mode. however, when I specify a folder, it works as expected:

joe@:/opt/dovecot/bin$ sudo ./doveadm -v index -u form *
joe@:/opt/dovecot/bin$ sudo ./doveadm -v index -u form form_positif
doveadm(form): Info: form_positif: Caching mails seq=130044..130095
52/52
joe@:/opt/dovecot/bin$


Your help is greatly appreciated.

-Joe


Re: [Dovecot] BEWARE: you might be supporting the lists owner!!

2012-05-19 Thread Timo Sirainen
There haven't been any new points raised in this thread since the first day. 
There's no point in replying to to this thread anymore.



Re: [Dovecot] BEWARE: you might be supporting the lists owner!!

2012-05-19 Thread Noel Butler
On Sat, 2012-05-19 at 08:25 -0400, Jerry wrote:


> 
> Hell I bitch about a lot of things; however, that does not change the
> facts of the case. Only a subset of this list received the message in
> question -


Likely to see how many people bitched before the rest


> - and I was not one of them. Secondly, The FreeBSD forum is
> constantly under siege from spammers because the operators of that
> forum are to stupid/lazy/naive(place your adjective here) to require at


Well, that's to "a list", where you subbed to received anything from
"the list", personally I wouldn't be on any list that had no opt-in
confirmation.


> Now, correct me if I am wrong, but wasn't Timo aware of this message
> being sent? And, isn't this list controlled by Timo? Ipso facto,
> doesn't that give him the right to do pretty much what he wants with
> the list?
> 


Again, to "the list", certainly NOT by targeting list members
individually "off-list" and direct, especially when there is no prior
granted authority to do so.




signature.asc
Description: This is a digitally signed message part


Re: [Dovecot] Best way to change index location on mdbox

2012-05-19 Thread Timo Sirainen
On 20.5.2012, at 1.23, Patrick Westenberg wrote:

> Timo Sirainen schrieb:
> 
>> No. Director is simply about making sure that more than one server won't 
>> access the same user's mailbox simultaneously. I'm not recommending 
>> per-backend index files to any kind of setups. Perhaps the NFS wiki page 
>> should be changed also.
> 
> So using a director it should be possible to have my mailstore on a Ext3/4 
> filesystem? I won't need a cluster filesystem or NFS?

Using a regular proxy with permanent user assignments you can distribute your 
mailboxes to a bunch of ext3/4 fs servers.

Using a director you get temporary user assignments and you need a 
clusterfs/NFS.



Re: [Dovecot] Best way to change index location on mdbox

2012-05-19 Thread Patrick Westenberg

Timo Sirainen schrieb:


No. Director is simply about making sure that more than one server won't access 
the same user's mailbox simultaneously. I'm not recommending per-backend index 
files to any kind of setups. Perhaps the NFS wiki page should be changed also.


So using a director it should be possible to have my mailstore on a 
Ext3/4 filesystem? I won't need a cluster filesystem or NFS?


Re: [Dovecot] dovecot fts_lucene indexes not being updated

2012-05-19 Thread Timo Sirainen
On 20.5.2012, at 0.12, Joe Beaubien wrote:

>> You can run "doveadm index -u user" to get new mails indexed.
> 
> Awesome, this does seem to work.
> 
> 2 last questions:
> 
> - Does it update both indexes (dovecot and fts) or only
> dovecot.index.cache? I ask because I didn't see any index messages in log
> files.

It should update both. If it doesn't then there's some kind of a configuration 
problem.

> - Is there a way to update the index of the entire email account instead of
> doing it for each folder (mailbox)?

You should be able to use '*' as the mailbox name.

Re: [Dovecot] Best way to change index location on mdbox

2012-05-19 Thread Timo Sirainen
On 20.5.2012, at 1.03, Patrick Westenberg wrote:

> Timo Sirainen schrieb:
> 
>> But you really don't want any of this with mdbox, not deleting index
>> files or having per-backend index files.
> 
> What is the director/backend-stuff useful for if per-backend index files
> is not recommended? As far as I understood, that's what it's all about.

No. Director is simply about making sure that more than one server won't access 
the same user's mailbox simultaneously. I'm not recommending per-backend index 
files to any kind of setups. Perhaps the NFS wiki page should be changed also.



Re: [Dovecot] Best way to change index location on mdbox

2012-05-19 Thread Patrick Westenberg

Timo Sirainen schrieb:


But you really don't want any of this with mdbox, not deleting index
files or having per-backend index files.


What is the director/backend-stuff useful for if per-backend index files
is not recommended? As far as I understood, that's what it's all about.

Patrick


Re: [Dovecot] Maildir filename has wrong S value

2012-05-19 Thread Wouter de Geus
* Timo Sirainen  [2012-05-19 22:17:01 +0300]:

> > My question here is: Why does dovecot abort? Isn't the issue fixed after 
> > the rename?
> 
> That file was fixed, but you probably have tons of them and it aborts
> after each one. With IMAP protocol there's really no other good way to
> do this. I guess if it notices one file being wrong it could just decide
> to go into error recovery check and read through all of the maildir
> files, but that's annoying extra piece of code for something that
> shouldn't happen anyway..

Ah, good point on the protocol. However, as far as I'm concerned this automatic
recovery would be a good thing (under the "self healing" statement from the 
dovecot site?)
Just a suggestion though, I understand that it's a lot of work for this 
specific issue.

> You should be able to manually fix them by reading them via doveadm,
> something like:
> 
> doveadm fetch -u benv text all > /dev/null

Thanks for that one, worked great for my maildir. (and saved me from writing a 
shell script) :)

> Old Dovecot versions didn't notice the problem. You can make v2.1 also
> just ignore the wrong sizes with maildir_broken_filename_sizes=yes.

Ah, that explains.

Well, thanks for the support :)

Regards,

Wouter.


Re: [Dovecot] dovecot fts_lucene indexes not being updated

2012-05-19 Thread Joe Beaubien
Answers inline.

On Sat, May 19, 2012 at 4:47 PM, Timo Sirainen  wrote:

> On 19.5.2012, at 23.40, Joe Beaubien wrote:
>
> > Ok, I enabled rawlog and noticed the code was only sending "SEARCH
> FROM". I
> > modified it to also send a "SEARCH TEXT" and it triggered the fts index
> > update.
> >
> > However, in my use case, that's not the search that needs to be done. The
> > search needed is "SEARCH FROM". It's not practical (or efficient I
> imagine)
> > to send a "SEARCH TEXT" for every folder before sending a "SEARCH FROM",
> > just to be sure the indexes are up-to-date.
>
> SEARCH FROM doesn't update the Lucene index, because it can usually be
> looked up quite fast also from dovecot.index.cache file. Of course if
> you're not delivering mails via dovecot-lda/lmtp that doesn't get updated.
>
> > If i could just do an update of the entire account (all folders) right
> > after I download new emails, that would be the least painful (I think). I
> > thought "fts_index_timeout" or "doveadm fts rescan -u my_user" would help
> > me achieve this, but those 2 options never seem to trigger an update on
> the
> > fts indexes. Any idea if I did something wrong there?
>
> You can run "doveadm index -u user" to get new mails indexed.


Awesome, this does seem to work.

2 last questions:

- Does it update both indexes (dovecot and fts) or only
dovecot.index.cache? I ask because I didn't see any index messages in log
files.

- Is there a way to update the index of the entire email account instead of
doing it for each folder (mailbox)?

Thanks alot for your awesome support.


Re: [Dovecot] Public mailboxes

2012-05-19 Thread Timo Sirainen
On 19.5.2012, at 23.40, Frank Bonnet wrote:

> Le 19/05/2012 20:44, Timo Sirainen a écrit :
>> On Fri, 2012-05-18 at 14:31 +0200, Frank Bonnet wrote:
>> 
>>> I'm trying to setup a server with public mailboxes only
>>> but I cannot succeed.
>> Do you still have specific users? Do you want the users to have
>> subscriptions? Do you need ACLs?
> 
> yes I need specific users using ACL
> and yes I would like users have subsciptions

OK, so then you need to have a per-user mail_location for the subscriptions. 
Something like:

namespace {
 list = children
 location = maildir:/var/mail/public
 prefix = public/
 separator = /
 subscriptions = no
 type = public
}
namespace inbox {
 location = maildir:/var/lib/dovecot/empty:CONTROL=/var/mail/user/%u
 prefix = /
 inbox = yes
}

With the "empty" directory being non-writable, the users can't create any 
private mailboxes, but with the writable control directory they can store 
subscriptions there.

Re: [Dovecot] dovecot fts_lucene indexes not being updated

2012-05-19 Thread Timo Sirainen
On 19.5.2012, at 23.40, Joe Beaubien wrote:

> Ok, I enabled rawlog and noticed the code was only sending "SEARCH FROM". I
> modified it to also send a "SEARCH TEXT" and it triggered the fts index
> update.
> 
> However, in my use case, that's not the search that needs to be done. The
> search needed is "SEARCH FROM". It's not practical (or efficient I imagine)
> to send a "SEARCH TEXT" for every folder before sending a "SEARCH FROM",
> just to be sure the indexes are up-to-date.

SEARCH FROM doesn't update the Lucene index, because it can usually be looked 
up quite fast also from dovecot.index.cache file. Of course if you're not 
delivering mails via dovecot-lda/lmtp that doesn't get updated.

> If i could just do an update of the entire account (all folders) right
> after I download new emails, that would be the least painful (I think). I
> thought "fts_index_timeout" or "doveadm fts rescan -u my_user" would help
> me achieve this, but those 2 options never seem to trigger an update on the
> fts indexes. Any idea if I did something wrong there?

You can run "doveadm index -u user" to get new mails indexed.

Re: [Dovecot] dovecot fts_lucene indexes not being updated

2012-05-19 Thread Joe Beaubien
See answers inline.

I just want to add that i also tried the parameter "fts_index_timeout = 10"
in the plugin section. Unfortunately the logs never showed me any indexing
taking place. I also tried "fts_index_timeout = 10s" in case i had the
wrong syntax.

I also tried "doveadm fts rescan -u my_user". The command returned
instantly and nothing appeared in the logs to indicate that a rescan
happened.

Thanks,

-Joe



On Sat, May 19, 2012 at 2:21 PM, Timo Sirainen  wrote:

> On Sat, 2012-05-19 at 13:19 -0400, Joe Beaubien wrote:
>
> > I have a dovecot 2.1.6 setup with fts_lucene.
> >
> > The lucene indexes get created/updated fine when I do a manual search
> thru
> > telnet.
>
> So you run SEARCH TEXT or SEARCH BODY?
>


Yes, with telnet i send a SEARCH TEXT command: 4 search text "test"



>
> > However, if I run a webapp that uses the php::imap_search function, the
> > index never gets created/updated.
>
> What IMAP command is this search sending? You could check by e.g.
> running rawlog: http://wiki2.dovecot.org/Debugging/Rawlog



Ok, I enabled rawlog and noticed the code was only sending "SEARCH FROM". I
modified it to also send a "SEARCH TEXT" and it triggered the fts index
update.

However, in my use case, that's not the search that needs to be done. The
search needed is "SEARCH FROM". It's not practical (or efficient I imagine)
to send a "SEARCH TEXT" for every folder before sending a "SEARCH FROM",
just to be sure the indexes are up-to-date.

If i could just do an update of the entire account (all folders) right
after I download new emails, that would be the least painful (I think). I
thought "fts_index_timeout" or "doveadm fts rescan -u my_user" would help
me achieve this, but those 2 options never seem to trigger an update on the
fts indexes. Any idea if I did something wrong there?




>
> > I run indo the same problem with
> > thunderbird and full-body search.
>
> Thunderbird probably isn't using IMAP SEARCH at all, but using its own
> local indexes. Although this is configurable I think.
>

You are right, let's forget about thunderbird.


Re: [Dovecot] Public mailboxes

2012-05-19 Thread Frank Bonnet




Le 19/05/2012 20:44, Timo Sirainen a écrit :

On Fri, 2012-05-18 at 14:31 +0200, Frank Bonnet wrote:


I'm trying to setup a server with public mailboxes only
but I cannot succeed.

Do you still have specific users? Do you want the users to have
subscriptions? Do you need ACLs?


yes I need specific users using ACL
and yes I would like users have subsciptions



If it's simply a fully public server, you wouldn't really need to set up
namespaces at all.



the server is not really public , what I need is to have some users's groups
shared mailboxes to work together in the same mailbox.
I also need acls because some users will have read only access

The Maildir format is a must because I also need the last seen feature


Thak you for your help


Re: [Dovecot] Dovecot usage values differ from actual disk usage

2012-05-19 Thread Daniel Parthey
Timo Sirainen wrote:
> 
> This behavior is intentional.
> > 
> > Move Email two times between Trash and INBOX (4 moves in total).
> > There is still only one physical message, just moved it around a bit.
> 
> You're not moving a message, you're copying and setting \deleted flag
> for the original message. Until client issues EXPUNGE command, the
> messages exist.

OK.

> The message still has 5 visible instances, even though in mdbox they
> don't use up any more disk space than 1. It would be nice for quota
> plugin to realize this, but it's a big and probably difficult change.
> I've thought about it once in a while though.

Maybe I should have a deeper look into how to reproduce this.
Originally, I did an imap-sync[1] from dbmail to dovecot through the
director IMAP port. After some days of mailbox usage in dovecot the
quota values were obviously incorrect from the administrators view,
but I'm not sure whether the user kept his mailbox and IMAP connection
open the whole week. I will try to find this out.

Regards
Daniel

[1] http://imapsync.lamiral.info/


Re: [Dovecot] wrong search results with fts_solr

2012-05-19 Thread Timo Sirainen
On Wed, 2012-05-16 at 16:39 -0400, Joe Beaubien wrote:
> I am getting some very weird search results with fts_solr.
> 
> 1) when I do a search for "testin" I get 0 results.
> 2) when I do a search for "testing" i get 44 results.
> 
> The problem is that I am expecting only 1 result.

Solr uses "stemming" for indexing/searching words. After that it
searches those stemmed words, it doesn't do prefix searching by default.
So:

1) You don't have any mails with a word "testin" in it.

2) "testing" probably gets stemmed to "test", and you get a combined
result of "test", "testing", "tests" and maybe some other words.




Re: [Dovecot] High level of pop3 popping causing server to become unresponsive

2012-05-19 Thread Timo Sirainen
On Fri, 2012-05-18 at 09:21 -0400, Root Kev wrote:
> During the last time that the load went up, it became unable to login / su
> to root for the entire period that dovecot was running, we had to kill
> dovecot and go back to Popa3d until the mailq was cleared up.  We are
> running CentOS 5.6 server.  Based on TOP running at the time the CPU usage
> was running under 10%.  Once Dovecot was killed, we were then able to log
> in /su again.

Like Kelsey said, a very high disk IO might explain this, although
normally the login should still eventually succeed. Another thing I'm
wondering is if some process limit reached. How does the login/su fail,
does it just hang or immediately fail with some error?

> We were under the impression that checking to shadow directly should be the
> fastest and least amount of overhead, is any of the other ways to connect
> have less load on authentication to PAM?

Your passwords really are in /etc/shadow file, not LDAP/something else?
I don't think the problem is with authentication. Reading /etc/shadow is
pretty fast (unless maybe if it's a huge file) and it anyway can't block
login/su from working.




Re: [Dovecot] Maildir filename has wrong S value

2012-05-19 Thread Timo Sirainen
On Tue, 2012-05-15 at 12:23 +0200, Wouter de Geus wrote:
> Hello folks,
> 
> This morning I tried to open an old archive mail folder using Mutt.
> However, while fetching headers it aborted.
> Checking the dovecot log gave me this:
> 
> @40004fb21996267d37d4 imap(benv): Error: Cached message size smaller than 
> expected (9115 < 9420)
> @40004fb21996267e8bac imap(benv): Error: Maildir filename has wrong S 
> value, renamed the file from 
> /home/vpopmail/domains/benv.junerules.com/benv/Maildir/.Old.2009/cur/1260395566.28175.black,S=9115:2,S
>  to 
> /home/vpopmail/domains/benv.junerules.com/benv/Maildir/.Old.2009/cur/1260395566.28175.black,S=9420:2,S
> @40004fb21996267e937c imap(benv): Error: Corrupted index cache file 
> /home/vpopmail/domains/benv.junerules.com/benv/Maildir/.Old.2009/dovecot.index.cache:
>  Broken physical size for mail UID 294
> @40004fb21996267eaaec imap(benv): Error: 
> read(/home/vpopmail/domains/benv.junerules.com/benv/Maildir/.Old.2009/cur/1260395566.28175.black,S=9115:2,S)
>  failed: Input/output error (uid=294)
> @40004fb219962680683c imap(benv): Info: Disconnected: Internal error 
> occurred. Refer to server log for more information. [2012-05-15 10:53:32] 
> in=6503 out=192718
> 
> I've retried opening this folder several times, but each time Dovecot only 
> fixes 1 file and then aborts.
> (the folder apparently has a lot more files with incorrect sizes).
> My question here is: Why does dovecot abort? Isn't the issue fixed after the 
> rename?

That file was fixed, but you probably have tons of them and it aborts
after each one. With IMAP protocol there's really no other good way to
do this. I guess if it notices one file being wrong it could just decide
to go into error recovery check and read through all of the maildir
files, but that's annoying extra piece of code for something that
shouldn't happen anyway..

You should be able to manually fix them by reading them via doveadm,
something like:

doveadm fetch -u benv text all > /dev/null

> Also: The files are not corrupted or unreadable, reading them through the 
> commandline works fine.
> I've looked through my backups and saw that at least half a year ago this 
> mismatch in size was already present.
> 
> I've been running dovecot for quite a while, so the cause of this size 
> mismatch might very well be a issue in an older version of dovecot / my 
> configuration.
> Right now I'm running dovecot 2.1.6, but I've been running the v1.2 version 
> for quite a while before that.

Old Dovecot versions didn't notice the problem. You can make v2.1 also
just ignore the wrong sizes with maildir_broken_filename_sizes=yes.




Re: [Dovecot] [PATCH] dovecot-lda with expire plugin segfaults if dict failed

2012-05-19 Thread Timo Sirainen
On Tue, 2012-05-15 at 15:08 +0200, Lazy wrote:
> Program received signal SIGSEGV, Segmentation fault.
> 0x7f1975cccdee in expire_mailbox_transaction_commit (t= optimized out>, changes_r=) at
> expire-plugin.c:169
> 169 } else if (strcmp(value, "0") == 0) {

Fixed a bit differently:
http://hg.dovecot.org/dovecot-2.1/rev/8f72002cb394




Re: [Dovecot] ..::MBOX ISSUE::..

2012-05-19 Thread Timo Sirainen
With IMAP the users must have a mail directory. So you should create
home directories for the users. Also see
http://wiki2.dovecot.org/VirtualUsers/Home

On Tue, 2012-05-15 at 09:12 -0500, Alfonso Alejandro Reyes Jimenez
wrote:
> There are no home directory for those users, I think I should start with 
> that information.
> 
> Regards.
> 
> On 5/15/12 9:06 AM, Alfonso Alejandro Reyes Jimenez wrote:
> > Thanks I did it that way and it still download all the mboxes :( but 
> > only with imail.
> >
> > You cant see those emails but you still can see the mboxes.
> >
> > Regards.
> >
> > On 5/15/12 8:58 AM, Timo Sirainen wrote:
> >> You shouldn't have removed the "mail_location = " part.
> >>
> >> On 15.5.2012, at 16.41, Alfonso Alejandro Reyes Jimenez wrote:
> >>
> >>> Thanks for your advice, I tried changing the configuration but I got 
> >>> the following error:
> >>>
> >>> /conf.d/10-mail.conf line 31: Unknown setting: mbox:~/mail:INBOX
> >>>
> >>> Is there anything else I can do?
> >>>
> >>> Regards.
> >>>
> >>> Alfonso.
> >>>
> >>> On 5/14/12 10:56 AM, Timo Sirainen wrote:
>  On Fri, 2012-05-11 at 08:29 -0500, Alfonso Alejandro Reyes Jimenez
>  wrote:
> > mail_location = mbox:/var/spool/mail/:INBOX=/var/spool/mail/%u
>  This just isn't going to work. You're now specifying that all of the
>  users' folders are in a common /var/spool/mail directory. You need to
>  figure out something else. Common configs are e.g.:
> 
>  mail_location = mbox:~/mail:INBOX=/var/spool/mail/%u
> 
>  or:
> 
>  mail_location = 
>  mbox:/var/spool/mail-folders/%u:INBOX=/var/spool/mail/%u
> 
> 
> 
> >>
> >
> >
> 




Re: [Dovecot] Very High Load on Dovecot 2 and Errors in mail.err.

2012-05-19 Thread Timo Sirainen
On Wed, 2012-05-16 at 08:59 +0200, Urban Loesch wrote:

> The Server was running about 1 year without any problems. 15Min Load was 
> between 0,5 and max 8.
> No high IOWAIT. CPU Idletime about 98%.
..
> #  iostat -k
> Linux 3.0.28-vs2.3.2.3-rol-em64t (mailstore4) 16.05.2012  
> _x86_64_(24 CPU)

Did you change the kernel just before it broke? I'd try another version.




Re: [Dovecot] Authentication with AD and quick mbox question

2012-05-19 Thread Timo Sirainen
On Wed, 2012-05-16 at 09:32 +0100, Kaya Saman wrote:
> I managed to find this on the wiki:
> 
> http://wiki2.dovecot.org/HowTo/ActiveDirectoryNtlm
> 
> and followed it - though I don't think it's for Dovecot2 even though
> it's on the portion of the Wiki for Dovecot v2. lot's of
> references to Dovecot v1 are mentioned and additionally some of the
> syntax is not the same as Dovecot v2.

wiki2 was originally a copy of wiki1, and I haven't updated the HowTos
for v2.x. Feel free to update it yourself. :)

> Why doesn't Dovecot know about the auth_ntlm_use_winbind string?
> 
> Even from this link: 
> http://wiki2.dovecot.org/Authentication/Mechanisms/Winbind
> 
> it shows that the string should work for version 2.

auth_use_winbind=yes is for v2 (and v1.2). auth_ntlm_use_winbind is only
for v1.1.




Re: [Dovecot] namespace from snapshots

2012-05-19 Thread Timo Sirainen
On Wed, 2012-05-16 at 12:39 +0200, Lazy wrote:
> May 16 12:11:36 thebe2 dovecot: imap(lazy): Error:
> open(/snapshot/h1/vmail/la/lazy/Maildir/.SPAM/dovecot-uidlist.lock)
> failed: Read-only file system

Does the attached patch help?

> maybe it will be easier to move all dovecot metadata to separate (non
> snapshot) location ?

It could also be a bit problematic. At least message keywords (=custom
flags) wouldn't work because the dovecot-keywords file exists only in
the snapshot dir.

diff -r 42cca8a1d179 src/lib-storage/index/maildir/maildir-uidlist.c
--- a/src/lib-storage/index/maildir/maildir-uidlist.c	Sat May 19 21:18:04 2012 +0300
+++ b/src/lib-storage/index/maildir/maildir-uidlist.c	Sat May 19 21:54:38 2012 +0300
@@ -173,6 +173,11 @@
 			return 0;
 		}
 		if (errno != ENOENT || i == MAILDIR_DELETE_RETRY_COUNT) {
+			if (errno == EROFS) {
+mail_storage_set_error(box->storage,
+	MAIL_ERROR_NOTPOSSIBLE, "Read-only namespace");
+return 0;
+			}
 			if (errno == EACCES) {
 mail_storage_set_critical(box->storage, "%s",
 	eacces_error_get_creating("file_dotlock_create", path));


Re: [Dovecot] Best way to change index location on mdbox

2012-05-19 Thread Timo Sirainen
On Sat, 2012-05-19 at 20:43 +0200, Patrick Westenberg wrote:
> Timo Sirainen schrieb:
> 
> > You must not lose indexes with mdbox or you'll lose message flags and
> > mails may also end up going to wrong mailboxes.
> 
> Yes, have been there but this behaviour is confusing me as I find 
> conflicting information in the wiki:
> 
> http://wiki2.dovecot.org/IndexFiles
> "If index files are missing, Dovecot creates them automatically when the 
> mailbox is opened."

This and maybe other parts of documentation was written before dbox
format was created. It's true for maildir/mbox, but not for dbox. I
updated that page now.

> http://wiki2.dovecot.org/MailboxFormat/dbox
> This data cannot be automatically recreated, so it is important that 
> Index files are treated with the same care as message data files.
> 
> So why do I lose mails if I delete index file but if e.g. a director
> connects to a backend with non existing index files yet, they are created.

Losing mails probably happens only when imap crashes while it's trying
to recreate the indexes. Once that bug is fixed it should happen.

But you really don't want any of this with mdbox, not deleting index
files or having per-backend index files.



Re: [Dovecot] Maildir - Need script to delete old unread messages

2012-05-19 Thread Timo Sirainen
On Sat, 2012-05-19 at 11:41 -0700, Marc Perkel wrote:
> Trying to clean out old undead messages from users to reduce disk space. 
> Need a script that will recurse all the user directories and delete all 
> unread email that is over 90 days old.
> 
> Anyone have that?

doveadm -A expunge mailbox '*' savedbefore 90d unseen

Test first without -A with one user. :)




Re: [Dovecot] Public mailboxes

2012-05-19 Thread Timo Sirainen
On Fri, 2012-05-18 at 14:31 +0200, Frank Bonnet wrote:

> I'm trying to setup a server with public mailboxes only
> but I cannot succeed.

Do you still have specific users? Do you want the users to have
subscriptions? Do you need ACLs?

If it's simply a fully public server, you wouldn't really need to set up
namespaces at all.




Re: [Dovecot] Best way to change index location on mdbox

2012-05-19 Thread Patrick Westenberg

Timo Sirainen schrieb:


You must not lose indexes with mdbox or you'll lose message flags and
mails may also end up going to wrong mailboxes.


Yes, have been there but this behaviour is confusing me as I find 
conflicting information in the wiki:


http://wiki2.dovecot.org/IndexFiles
"If index files are missing, Dovecot creates them automatically when the 
mailbox is opened."


http://wiki2.dovecot.org/MailboxFormat/dbox
This data cannot be automatically recreated, so it is important that 
Index files are treated with the same care as message data files.


So why do I lose mails if I delete index file but if e.g. a director
connects to a backend with non existing index files yet, they are created.


Re: [Dovecot] Dovecot usage values differ from actual disk usage

2012-05-19 Thread Timo Sirainen
On Thu, 2012-05-17 at 20:11 +0200, Daniel Parthey wrote:

> Maybe this is not the original problem, but here is some way to
> reproduce a similar behaviour.

This behavior is intentional.

> #
> # Move Email around #
> #
> 
> Move Email two times between Trash and INBOX (4 moves in total).
> There is still only one physical message, just moved it around a bit.

You're not moving a message, you're copying and setting \deleted flag
for the original message. Until client issues EXPUNGE command, the
messages exist.

> #
> # Check quota again #
> #
> 
> # doveadm quota get -u us...@example.org
> Quota name
>TypeValue Limit %
> User quota
>STORAGE  6918 - 0
> User quota
>MESSAGE 5 - 0
> 
> Quota now displays 5 messages and 6 MB, even though there is only one message 
> with 1.5 MB.
> 
> ###
> # Check mdbox storage #
> ###
> 
> # du -sk /mail/dovecot/example.org/user1
> 1472/mail/dovecot/example.org/user1
> 
> The actual disk usage did not increase, but the "usage value" did increase
> with every move operation.

The message still has 5 visible instances, even though in mdbox they
don't use up any more disk space than 1. It would be nice for quota
plugin to realize this, but it's a big and probably difficult change.
I've thought about it once in a while though.



[Dovecot] Maildir - Need script to delete old unread messages

2012-05-19 Thread Marc Perkel
Trying to clean out old undead messages from users to reduce disk space. 
Need a script that will recurse all the user directories and delete all 
unread email that is over 90 days old.


Anyone have that?




Re: [Dovecot] Migration between namespaces breaks outlook on mac's

2012-05-19 Thread Timo Sirainen
On Thu, 2012-05-17 at 15:59 +0300, Mark Zealey wrote:
> We're now migrating customers onto a dovecot-2 platform, switching from 
> Maildir to sdbox (using dsync mirror) & changing the namespace at the 
> same time. New namespace configuration looks like (as taken from 
> http://wiki2.dovecot.org/Namespaces)
> 
> # This is for courier-imap namespace compatability
> namespace {
>  type = private
>  separator = /
>  prefix =
>  inbox = yes
> }
> 
> namespace {
>  type = private
>  prefix = INBOX.
>  separator = .
>  inbox = no
>  hidden = yes
>  list = no
>  alias_for =
> }
> 
> For 99% of clients this works fine eg thunderbird on first login after 
> migration notices the folder structure has changed & automagically 
> redownloads folders & emails. 

Since you have the migration namespace, that should keep the clients
that have prefix=INBOX. in their configuration working like they did
before. But yeah, if the client hadn't configured a prefix I guess
they'll redownload.

> However I have noticed some really strange 
> messages in the logs which seems to be related to customers running 
> outlook on macos. When they login after migration they are generating 
> commands like:
> 
> dovecot: imap(): Mailbox created: INBOX 1 1 1 1 1
> dovecot: imap(): Mailbox created: INBOX 1 1 1 1 1 1
> dovecot: imap(): Mailbox created: INBOX 1 1 1 1 1 1 1
> ...
> 
> this goes on a long time and we've not yet found a solution other than 
> delete the imap config on their outlook and reconfigure. Does anyone 
> have any idea why this might be happening, 

No idea.

> or if there is a way we can 
> somehow have old namespaces for old customers, new namespaces for new 
> customers (we are using sql login code so should be possible to do 
> something like this in theory I think?)

See the bottom of http://wiki2.dovecot.org/PostLoginScripting on how to
modify namespaces in a post-login script. You can then have your
user_query return "old_namespace" field and based on that you either
modify the namespaces or don't.



Re: [Dovecot] Only method=PLAIN

2012-05-19 Thread Timo Sirainen
Sendmail configuration isn't relevant with Dovecot. Set
auth_debug_passwords=yes to debug why the authentication isn't working.

On Fri, 2012-05-18 at 09:19 +0200, Manuel Fernández Panzuela wrote:
> Then, which is the correct configuration ? Are my config files ok ?
> Openldap stores passwords encrypted with sha algorithm
> 
> Sendmail could be the problem? Sendmail works with PAM authentication
> /etc/pam.d/smtp to work with LDAP too.
> 
> When I connect outlook with (Sendmail + Dovecot) password is requested, but
> for all attempts I get the following error in /var/log/maillog
> 
> Using TLS
> dovecot: pop3-login: Disconnected: user=,
> method=PLAIN, rip=:::10.237.208.211, lip=:::10.237.193.133, TLS
> 
> Without TLS
> dovecot: pop3-login: Disconnected: user=,
> method=PLAIN, rip=:::10.237.208.211, lip=:::10.237.193.133
> 
> 
> Sendmail.mc
> FEATURE(correo_MFP)dnl
> LDAPROUTE_DOMAIN(ldapserver.mfernandez.es)dnl
> SMTPINI_JA(smtpinicial.mfernandez.es)dnl
> OLD_DOMAIN(correo.mfernandez.es)dnl
> LOCAL_MAIL_HOST(smtp-incial.mfernandez.es)dnl
> define(confLDAP_DEFAULT_SPEC,`-h xxx.xxx.xxx.xxx -p 389 -b
> "o=usuarios,o=mfernandez,c=es" -d "cn=Admin,o=usuarios,o=mfernandez,c=es"
> -M simple -P /etc/mail/passcorreo')dnl
> define(`ALIAS_FILE', `ldap:')dnl
> FEATURE(virtusertable, `LDAP')dnl
> define(`confAUTH_MECHANISMS', `PLAIN')dnl
> TRUST_AUTH_MECH(`PLAIN')dnl
> define(SMART_HOST,`mail.mfernandez.es')dnl
> dnl define(SMART_HOST,`localhost')dnl
> dnl define(`ALIAS_FILE', `ldap:-b"" -v rfc822MailMember -k
> &(objectClass=nisMailAlias)(cn=%0)')dnl
> dnl correo_MFP - Fin de modificaciones necesarias
> dnl **
> MAILER(smtp)dnl
> MAILER(procmail)dnl
> Cwcorreo.mfernandez.es
> 
> Thank you so much!
> 
> 2012/5/17 Timo Sirainen 
> 
> > On 16.5.2012, at 19.36, Manuel Fernández Panzuela wrote:
> >
> > > Hello
> > >
> > > I need to authenticate dovecot against openldap. OpenLdap's
> > authentication
> > > method requires SHA.
> > > How must I set dovecot ?
> > ..
> > >#mechanisms = plain SHA
> > ..
> > > If I uncomment #mechanisms = plain SHA  Dovecot doesn't start, the error:
> > > dovecot: auth(default): Unknown authentication mechanism 'SHA'
> >
> > You're confusing the difference between authentication mechanism and
> > password scheme. http://wiki2.dovecot.org/Authentication
> >
> > You want to use SHA1 as password scheme but still PLAIN mechanism.




Re: [Dovecot] Only method=PLAIN

2012-05-19 Thread Timo Sirainen
On Thu, 2012-05-17 at 22:10 +0100, Tim Smith wrote:
> Interesting - just so I have this clear in my own head. The password 
> scheme is the way the password is encrypted 

Yes.

> but the authentication 
> mechanism is whether the password is sent encrypted as well?

Something like that. It's about the protocol how the authentication is
done.




Re: [Dovecot] Best way to change index location on mdbox

2012-05-19 Thread Timo Sirainen
On Fri, 2012-05-18 at 23:44 +0200, Patrick Westenberg wrote:
> right now my index directory is part of the users home directory:
> mail_home = /var/mail/%d/%n
> mail_location = mdbox:~/mdbox
> 
> I want the indexes to be stored in a different location:
> mail_home = /var/mail/%d/%n
> mail_location = mdbox:~/mdbox:INDEX=/var/indexes/%d/%n
> 
> If I just switch this setting and reload the configuration, no e-mails 
> are shown to the user.

You must not lose indexes with mdbox or you'll lose message flags and
mails may also end up going to wrong mailboxes.

> After restoring the whole maildir I deleted all dovecot.index.*-files 
> from that user and starting dovecot with the new index directory
> setting, I got the following error after connecting.
> I expected the index files to be regenerated but I got an error:
> 
> May 18 23:11:12 imap(t...@example.com): Panic: file mail-storage.c: line 
> 787 (mailbox_check_mismatching_separators): assertion fail
> ed: (strncmp(vname, ns->prefix, ns->prefix_len-1) == 0)

This is a little bit strange bug that is also happening to another guy.
I haven't been able to reproduce it.

> How can I change the index directory without losing mails?

The easiest and the most reliable solution would be to just move the
index files to their new location while Dovecot is stopped.



Re: [Dovecot] dovecot fts_lucene indexes not being updated

2012-05-19 Thread Timo Sirainen
On Sat, 2012-05-19 at 13:19 -0400, Joe Beaubien wrote:

> I have a dovecot 2.1.6 setup with fts_lucene.
> 
> The lucene indexes get created/updated fine when I do a manual search thru
> telnet.

So you run SEARCH TEXT or SEARCH BODY?

> However, if I run a webapp that uses the php::imap_search function, the
> index never gets created/updated. 

What IMAP command is this search sending? You could check by e.g.
running rawlog: http://wiki2.dovecot.org/Debugging/Rawlog

> I run indo the same problem with
> thunderbird and full-body search.

Thunderbird probably isn't using IMAP SEARCH at all, but using its own
local indexes. Although this is configurable I think.




Re: [Dovecot] dovecot fts_lucene indexes not being updated

2012-05-19 Thread Joe Beaubien
Sorry for double-posting, but i forgot to mention something:

If I run php::imap_search() AFTER having manually updated the lucene
indexes (thru a telnet command), I see a HUGE gain in search performance
compared to before creating the lucene indexes (at least 1 order of
magnitude).

-Joe





On Sat, May 19, 2012 at 1:19 PM, Joe Beaubien wrote:

> Hi everyone,
>
> I have a dovecot 2.1.6 setup with fts_lucene.
>
> The lucene indexes get created/updated fine when I do a manual search thru
> telnet.
>
> However, if I run a webapp that uses the php::imap_search function, the
> index never gets created/updated. I run indo the same problem with
> thunderbird and full-body search.
>
> Anyone has some insight into this?
>
> Regards,
>
> -Joe
>


[Dovecot] dovecot fts_lucene indexes not being updated

2012-05-19 Thread Joe Beaubien
Hi everyone,

I have a dovecot 2.1.6 setup with fts_lucene.

The lucene indexes get created/updated fine when I do a manual search thru
telnet.

However, if I run a webapp that uses the php::imap_search function, the
index never gets created/updated. I run indo the same problem with
thunderbird and full-body search.

Anyone has some insight into this?

Regards,

-Joe


Re: [Dovecot] BEWARE: you might be supporting the lists owner!!

2012-05-19 Thread Jerry
On Sat, 19 May 2012 11:36:24 +1000
Noel Butler articulated:

>non-event? You wouldnt be saying that if certain other operators with
>their products did that. I've seen you bitch and whinge about far far
>far less over the years Jerry.

Hell I bitch about a lot of things; however, that does not change the
facts of the case. Only a subset of this list received the message in
question -- and I was not one of them. Secondly, The FreeBSD forum is
constantly under siege from spammers because the operators of that
forum are to stupid/lazy/naive(place your adjective here) to require at
a minimum that posters be registered to the list. I wish I had the
problems there that you are complaining about here.

Now, correct me if I am wrong, but wasn't Timo aware of this message
being sent? And, isn't this list controlled by Timo? Ipso facto,
doesn't that give him the right to do pretty much what he wants with
the list?

In any case, this whole thread is starting to remind me of my wife,
bitching over nothing that happened months ago.

-- 
Jerry ♔

Disclaimer: off-list followups get on-list replies or get ignored.
Please do not ignore the Reply-To header.
__


Re: [Dovecot] BEWARE: you might be supporting the lists owner!!

2012-05-19 Thread Charles Marcus

On 2012-05-18 10:18 PM, Tamsy  wrote:

This thread has already evolved into an ideological conflict. Better to
leave it now since every word, every further argument is just heating
the atmosphere up and is scaring other users off the list…


Best just to PLONK Noel, as I did a long time ago...

But I totally agree, please, everyone, just let this thread die. It was 
a ONE TIME thing, and Timo already admitted he didn't think it through.


Anyone who can't see the difference between this (non) event and what 
real spammers do is just brain-dead.


--

Best regards,

Charles