Re: [Dovecot] director ignoring director_mail_servers for lmtp connections

2011-09-12 Thread Jan-Frode Myklebust
On Mon, Sep 12, 2011 at 04:55:51PM +0100, mailing lists wrote:
> 
> how I can redirect incoming lmtp request to backend lmtp servers (and not 
> just one)? what I'm missing here? 
> 
> director_mail_servers = 101.180.245.101
> director_servers = 101.180.245.101

Is this a loop maybe?  director_mail_servers should list all
your backend dovecot servers, space separated. Here's mine:

director_mail_servers = 192.168.42.7 192.168.42.8 192.168.42.9 
192.168.42.10 192.168.42.11 192.168.42.28 192.168.42.29

and director_servers should list all your director servers so that they
can share info on where to direct each user, like:

director_servers = 192.168.42.15 192.168.42.17

Then, if this is configured correctly "doveadm director status" should 
list your backend director_mail_servers:

$ sudo doveadm  director status 
mail server ip   vhosts users
192.168.42.28   100  5220
192.168.42.29   100  4733

$ sudo doveadm  director status janfr...@tanso.net
Current: 192.168.42.28 (expires 2011-09-13 08:46:42)
Hashed: 192.168.42.28
Initial config: 192.168.42.11



  -jf


Re: [Dovecot] signal 11 crash, sometimes, during mbox bz2 decompression

2011-09-12 Thread Mike Brown

On 9/12/2011 5:28 AM, Timo Sirainen wrote:
Oh, wonder why no one else has complained about that. Fixed: 
http://hg.dovecot.org/dovecot-2.0/rev/a930318a74a1 

I tested this patch, and it's working like a charm. Thanks!


Re: [Dovecot] Sieve envelope :detail "to" "extention" does not deliver to fileinto destination

2011-09-12 Thread Jerry
On Tue, 13 Sep 2011 00:42:44 +0200
Aleksandar Lazic articulated:

> Dear Jerry,
> 
> On Mon 12.09.2011 14:22, Jerry wrote:
> >On Mon, 12 Sep 2011 19:14:48 +0200
> >Aleksandar Lazic articulated:
> >
> >
> >
> >> dovecot   unix  -   n   n   -   -   pipe
> >>flags=DRhu user=vmail:vmail argv=/usr/lib/dovecot/deliver -f
> >> ${sender} -d ${user}@${nexthop} -a ${original_recipient}
> >> #  flags=DRhu user=vmail:vmail argv=/usr/lib/dovecot/deliver -f
> >> ${sender} -d ${user}@${nexthop} -m ${extension} -a
> >> ${original_recipient}
> >
> >I use plus addressing and this is the entry in the master.cf file
> >from Postfix:
> >
> >dovecot   unix  -   n   n   -   -   pipe
> >  flags=DRhu user=vmail:vmail
> > argv=/usr/local/libexec/dovecot/deliver -f ${sender} -d
> > ${user}@${nexthop} -a ${recipient}
> >
> >The "argv" could be different on your system; however the rest should
> >be the same as mine I would assume. If you do make a change, you will
> >have to restart Postfix for it to take effect.
> 
> thanks for your info.
> I have changed the -a to recipient but nothing changed.
> 
> I have now changed the if statement to
> 
> ###
> if header :contains "Delivered-To" "pdnsusers" {
> ###
> 
> this works, but the best would be to be able to use
> 
> ###
> if envelope :contains :detail "to" "pdnsusers" {
> ###
> 
> Is there a command like 'print envelope' or something else to see what
> variables and envelope deliver have?

This is what I use, and it works fine. The example is something I use
for FreeBSD.

Example address: user+f...@example.com

This is my sieve recipe:

if envelope :detail "To" "fbsd" {fileinto "FreeBSD"; stop;}

I hope this helps.

-- 
Jerry ✌
dovecot.u...@seibercom.net

Disclaimer: off-list followups get on-list replies or get ignored.
Please do not ignore the Reply-To header.
__
Quidquid latine dictum sit, altum viditur.

(Whatever is said in Latin sounds profound.)


Re: [Dovecot] two little fixes for 2.0.14

2011-09-12 Thread Timo Sirainen
On 13.9.2011, at 2.00, Mike Abbott wrote:

> --- a/dovecot/src/lib-index/mail-index-view.c
> +++ b/dovecot/src/lib-index/mail-index-view.c
> @@ -9,7 +9,7 @@
> void mail_index_view_clone(struct mail_index_view *dest,
>  const struct mail_index_view *src)
> {
> - memset(dest, 0, sizeof(dest));
> + memset(dest, 0, sizeof(*dest));
>   dest->refcount = 1;
>   dest->v = src->v;
>   dest->index = src->index;

Luckily the only caller had it already cleared. Fixed anyway.

> --- a/dovecot/src/lib-storage/mail-storage-service.c
> +++ b/dovecot/src/lib-storage/mail-storage-service.c
> @@ -870,7 +870,7 @@
>   }
> 
>   user = p_new(user_pool, struct mail_storage_service_user, 1);
> - memset(user_r, 0, sizeof(user_r));
> + memset(user_r, 0, sizeof(*user_r));
>   user->pool = user_pool;
>   user->input = *input;
>   user->input.userdb_fields = NULL;

Here the sizeof() is the same in both cases, but the entire memset() is rather 
pointless, so removed it.

Did you find these with some tool, or grepping manually? :)

[Dovecot] two little fixes for 2.0.14

2011-09-12 Thread Mike Abbott
--- a/dovecot/src/lib-index/mail-index-view.c
+++ b/dovecot/src/lib-index/mail-index-view.c
@@ -9,7 +9,7 @@
 void mail_index_view_clone(struct mail_index_view *dest,
   const struct mail_index_view *src)
 {
-   memset(dest, 0, sizeof(dest));
+   memset(dest, 0, sizeof(*dest));
dest->refcount = 1;
dest->v = src->v;
dest->index = src->index;


--- a/dovecot/src/lib-storage/mail-storage-service.c
+++ b/dovecot/src/lib-storage/mail-storage-service.c
@@ -870,7 +870,7 @@
}
 
user = p_new(user_pool, struct mail_storage_service_user, 1);
-   memset(user_r, 0, sizeof(user_r));
+   memset(user_r, 0, sizeof(*user_r));
user->pool = user_pool;
user->input = *input;
user->input.userdb_fields = NULL;



Re: [Dovecot] Sieve envelope :detail "to" "extention" does not deliver to fileinto destination

2011-09-12 Thread Aleksandar Lazic

Dear Jerry,

On Mon 12.09.2011 14:22, Jerry wrote:

On Mon, 12 Sep 2011 19:14:48 +0200
Aleksandar Lazic articulated:




dovecot   unix  -   n   n   -   -   pipe
   flags=DRhu user=vmail:vmail argv=/usr/lib/dovecot/deliver -f
${sender} -d ${user}@${nexthop} -a ${original_recipient}
#  flags=DRhu user=vmail:vmail argv=/usr/lib/dovecot/deliver -f
${sender} -d ${user}@${nexthop} -m ${extension} -a
${original_recipient}


I use plus addressing and this is the entry in the master.cf file from
Postfix:

dovecot   unix  -   n   n   -   -   pipe
 flags=DRhu user=vmail:vmail argv=/usr/local/libexec/dovecot/deliver -f 
${sender}
 -d ${user}@${nexthop} -a ${recipient}

The "argv" could be different on your system; however the rest should
be the same as mine I would assume. If you do make a change, you will
have to restart Postfix for it to take effect.


thanks for your info.
I have changed the -a to recipient but nothing changed.

I have now changed the if statement to

###
if header :contains "Delivered-To" "pdnsusers" {
###

this works, but the best would be to be able to use

###
if envelope :contains :detail "to" "pdnsusers" {
###

Is there a command like 'print envelope' or something else to see what
variables and envelope deliver have?

Here is the log, maybe you can see more the I ;-)

###
Sep 13 00:33:18 lvps46-163-74-15 postfix/smtpd[6011]: connect from
localhost.localdomain[127.0.0.1]
Sep 13 00:33:52 lvps46-163-74-15 postfix/smtpd[6011]: B1EFE9FECC15:
client=localhost.localdomain[127.0.0.1]
Sep 13 00:34:12 lvps46-163-74-15 postfix/cleanup[5999]: B1EFE9FECC15:
message-id=<20110912223352.b1efe9fec...@external.non
e.at>
Sep 13 00:34:12 lvps46-163-74-15 postfix/qmgr[22260]: B1EFE9FECC15:
from=, size=357, nrcpt=1 (queue active)
Sep 13 00:34:12 lvps46-163-74-15 dovecot: lda: Debug: Loading modules
from directory: /usr/lib/dovecot/modules
Sep 13 00:34:12 lvps46-163-74-15 dovecot: lda: Debug: Module loaded:
/usr/lib/dovecot/modules/lib15_notify_plugin.so
Sep 13 00:34:12 lvps46-163-74-15 dovecot: lda: Debug: Module loaded:
/usr/lib/dovecot/modules/lib20_mail_log_plugin.so
Sep 13 00:34:12 lvps46-163-74-15 dovecot: lda: Debug: Module loaded:
/usr/lib/dovecot/modules/lib90_sieve_plugin.so
Sep 13 00:34:12 lvps46-163-74-15 dovecot: lda: Debug: auth input:
a...@none.at uid=5000 gid=5000 home=/var/vmail/none.at/al
Sep 13 00:34:12 lvps46-163-74-15 dovecot: lda(a...@none.at): Debug:
Effective uid=5000, gid=5000, home=/var/vmail/none.at/al
Sep 13 00:34:12 lvps46-163-74-15 dovecot: lda(a...@none.at): Debug:
maildir: root exists (/var/vmail/none.at/al/Maildir)
Sep 13 00:34:12 lvps46-163-74-15 dovecot: lda(a...@none.at): Debug:
maildir++: root=/var/vmail/none.at/al/Maildir, index=, control=,
inbox=/var/vmail/none.at/al/Maildir, alt=
Sep 13 00:34:12 lvps46-163-74-15 dovecot: lda(a...@none.at): Debug: none:
root=, index=, control=, inbox=, alt=
Sep 13 00:34:12 lvps46-163-74-15 dovecot: lda(a...@none.at): Debug:
Destination address: al-pdnsus...@none.at (source: -a parameter)
Sep 13 00:34:12 lvps46-163-74-15 dovecot: lda(a...@none.at): Debug: sieve:
using sieve path for user's script: /var/vmail/none.at/al/.dovecot.sieve
Sep 13 00:34:12 lvps46-163-74-15 dovecot: lda(a...@none.at): Debug: sieve:
opening script /var/vmail/none.at/al/.dovecot.sieve
Sep 13 00:34:12 lvps46-163-74-15 dovecot: lda(a...@none.at): Debug: sieve:
script binary /var/vmail/none.at/al/.dovecot.svbin successfully loaded
Sep 13 00:34:12 lvps46-163-74-15 dovecot: lda(a...@none.at): Debug: sieve:
binary save: not saving binary /var/vmail/none.at/al/.dovecot.svbin,
because it is already stored
Sep 13 00:34:12 lvps46-163-74-15 dovecot: lda(a...@none.at): Debug: sieve:
executing script from /var/vmail/none.at/al/.dovecot.svbin
Sep 13 00:34:12 lvps46-163-74-15 dovecot: lda(a...@none.at): save:
box=INBOX, uid=61, msgid=<20110912223352.b1efe9fec...@external.none.at>,
size=412
Sep 13 00:34:12 lvps46-163-74-15 dovecot: lda(a...@none.at): sieve:
msgid=<20110912223352.b1efe9fec...@external.none.at>: stored mail into
mailbox 'INBOX'
Sep 13 00:34:12 lvps46-163-74-15 postfix/pipe[6001]: B1EFE9FECC15:
to=, relay=dovecot, delay=28, delays=28/0/0/0.02,
dsn=2.0.0, status=sent (delivered via dovecot service)
Sep 13 00:34:12 lvps46-163-74-15 postfix/qmgr[22260]: B1EFE9FECC15:
removed
Sep 13 00:34:14 lvps46-163-74-15 postfix/smtpd[6011]: disconnect from
localhost.localdomain[127.0.0.1]
###


Re: [Dovecot] 2.1: imapc SUBSCRIBE problem

2011-09-12 Thread Lutz Preßler
On Mo, 12 Sep 2011, Timo Sirainen wrote:
> On 12.9.2011, at 21.15, Lutz Preßler wrote:
> > Not really. No error on SUBSCRIBE anymore, but it does not work
> > permanently:
> > 
> > 0 lsub "" "*"
> > * LSUB () "." "INBOX.test.test2"
> > [... further entries ...]
> > 0 OK Lsub completed.
> > 0 subscribe "INBOX.gmail.[Gmail].Spam"
> > 0 OK Subscribe completed.
> >   <--- now subscriptions file includes
> >"gmail.[Gmail]/Spam"
The problem seems to be the different separators (I missed the "/"
earlier). First level mailboxes on gmail do work (I mixed it up...
INBOX.gmail.INBOX is fine, as is INBOX.gmail.test).
> 
> There shouldn't be any changes to subscriptions file! The subscriptions are 
> stored on remote IMAP server.
Why? With subscriptions=no I would expect the local subscriptions file beeing
used (and this is useful!)
> What exactly have you set to your namespaces now?
The imapc namespace has subscriptions=no.
I also tested subscriptions=yes now. That works as expected. (Some glitch
with "INBOX.gmail.[Gmail]" not beeing UNSUBSCRIBEbable when \Noselect,
but that's probably a Gmail IMAP problem).

Lutz


Re: [Dovecot] mysql auth failover failing

2011-09-12 Thread Paul B. Henson

On 9/12/2011 5:30 AM, Timo Sirainen wrote:


This works okay enough with PostgreSQL because it does asynchronous
lookups, so two simultaneous lookups create a second connection.
MySQL does synchronous lookups though, so the second connection is
normally never created.


If I could, I think I'd rather run postgres; but so many things only
support mysql you can't really get away with running only postgres, and
it's not worth the effort to run two separate sql services .


I suppose the fix to this would be to always connect to all SQL
servers at startup.


Perhaps it could be an option, either load balancing between all
available servers, or only using later listed servers when the earlier
listed ones are failing. For my purposes, either way is fine, as long as
authentications don't fail :). The other contributor to this thread, who
has a local mysql replica listed first and the central master listed
second probably wouldn't want the load balanced between them.


It should have created the second connection here and not fail..


Based on the network traffic, it is really pounding the primary trying
to connect, and occasionally connecting to the secondary only to
immediately disconnect after either only one or very few queries.


I'll try to debug this soon.


Thanks; let me know if there's anything I could do to help, or if there
are any potential fixes you would like tested.


--
Paul B. Henson  |  (909) 979-6361  |  http://www.csupomona.edu/~henson/
Operating Systems and Network Analyst  |  hen...@csupomona.edu
California State Polytechnic University  |  Pomona CA 91768


Re: [Dovecot] MySQL, map files

2011-09-12 Thread Steve Fatula
- Original Message -

> From: Timo Sirainen 
> To: Steve Fatula 
> Cc: Dovecot List 
> Sent: Monday, September 12, 2011 6:52 AM
> Subject: Re: [Dovecot] MySQL, map files
> 
>>  The reason I am asking is I have seen web pages that reference all
>>  sorts of statements within the map statement, and I have no idea where
>>  they are documented. Specifically, I see an example here (which is
>>  LDAP), look in section 3:
>> 
>>  http://dovecot.org/patches/1.2/ldap/HOWTO_dictldap+extdata.txt
>> 
>> 
>>  You will see lots of statements, not sure which ones can be used for
>>  MySQL (instead of LDAP). 
> 
> That patch's mapping references to Pigeonhole's extdata plugin. If you
> install that plugin you can use SQL or flat file for the same maps.
> 


Ok, so, now we get to the issue. What syntax can be used for the extdata 
plugin? 

If I have an existing MySQL table with the structure:

username
preference
value

Username would be the dovecot user name. preference would be a constant, and, 
value is the variable I want to set via the extdata plugin. The primary key is 
username + preference (constant, in this case, say it's set to "POP3"). I want 
to use extdata to retrieve that value. Can it be done using extdata and MySQL 
map syntax, and if so, can you provide an example? Can I specify the query 
itself (i.e., select value from table t, another table at where)


Re: [Dovecot] Sieve envelope :detail "to" "extention" does not deliver to fileinto destination

2011-09-12 Thread Jerry
On Mon, 12 Sep 2011 19:14:48 +0200
Aleksandar Lazic articulated:



> dovecot   unix  -   n   n   -   -   pipe
>flags=DRhu user=vmail:vmail argv=/usr/lib/dovecot/deliver -f
> ${sender} -d ${user}@${nexthop} -a ${original_recipient}
> #  flags=DRhu user=vmail:vmail argv=/usr/lib/dovecot/deliver -f
> ${sender} -d ${user}@${nexthop} -m ${extension} -a
> ${original_recipient}

I use plus addressing and this is the entry in the master.cf file from
Postfix:

dovecot   unix  -   n   n   -   -   pipe
  flags=DRhu user=vmail:vmail argv=/usr/local/libexec/dovecot/deliver -f 
${sender}
  -d ${user}@${nexthop} -a ${recipient}

The "argv" could be different on your system; however the rest should
be the same as mine I would assume. If you do make a change, you will
have to restart Postfix for it to take effect.

-- 
Jerry ✌
dovecot.u...@seibercom.net

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



Re: [Dovecot] 2.1: imapc SUBSCRIBE problem

2011-09-12 Thread Timo Sirainen
On 12.9.2011, at 21.15, Lutz Preßler wrote:

>> Yeah, but then remote subscriptions don't work. I think the imapc
>> subscription problems and namespace prefix problems are now fixed in hg.
> Not really. No error on SUBSCRIBE anymore, but it does not work
> permanently:
> 
> 0 lsub "" "*"
> * LSUB () "." "INBOX.test.test2"
> [... further entries ...]
> 0 OK Lsub completed.
> 0 subscribe "INBOX.gmail.[Gmail].Spam"
> 0 OK Subscribe completed.
>   <--- now subscriptions file includes
>"gmail.[Gmail]/Spam"

There shouldn't be any changes to subscriptions file! The subscriptions are 
stored on remote IMAP server. What exactly have you set to your namespaces now?



Re: [Dovecot] Custom error messages.

2011-09-12 Thread Timo Sirainen
On 12.9.2011, at 21.10, Lauro C. wrote:

> Is it possible to have custom error messages? I want to translate some of
> the messages (for instance mailbox full), so it can be more user friendly. I
> already use the quota warning feature. But I need to translate the messages
> anyways, is it possible?

For "mailbox full", yes: 
http://wiki2.dovecot.org/Quota/Configuration#Custom_Quota_Exceeded_Message

Anything else: no. Do you have specific examples of anything else you'd want to 
change?



Re: [Dovecot] 2.1: imapc SUBSCRIBE problem

2011-09-12 Thread Lutz Preßler
On Mon, 12 Sep 2011, Timo Sirainen wrote:

> On Sun, 2011-09-11 at 21:50 +0200, Lutz Preßler wrote:
> > On Fri, 09 Sep 2011, Lutz Preßler wrote:
> > > LIST is now working correctly in my setup, but SUBSCRIBE ist not.
> > > With subscriptions=no, as written (but same behaviour with 
> > > subscriptions=yes),
> > > SUBSCRIBE INBOX.gmail.INBOX (or others) yields
> > > 0 NO [SERVERBUG] Internal error occurred. Refer to server log for more 
> > > information. [2011-09-09 16:39:40]
> > > logging (with mail_debug=yes) only
> > > Sep  9 16:39:40 host dovecot: imap(1143, user): Error: stat((null)) 
> > > failed: Bad address
> > After putting (with subscriptions=no) an entry manually into the root
> > subscriptions file, everything including UNSUBSCRIBE works fine.
> 
> Yeah, but then remote subscriptions don't work. I think the imapc
> subscription problems and namespace prefix problems are now fixed in hg.
Not really. No error on SUBSCRIBE anymore, but it does not work
permanently:

0 lsub "" "*"
* LSUB () "." "INBOX.test.test2"
[... further entries ...]
0 OK Lsub completed.
0 subscribe "INBOX.gmail.[Gmail].Spam"
0 OK Subscribe completed.
   <--- now subscriptions file includes
"gmail.[Gmail]/Spam"
0 lsub "" "*"
* LSUB () "." "INBOX.test.test2"
[... further entries, but NOT INBOX.gmail.[Gmail].Spam ...]
0 OK Lsub completed.
   <--- now the "gmail.[Gmail]/Spam" line is gone
from subscriptions file again!

The same happens with INBOX.gmail.INBOX, so it's not the "[]" characters.
I have to test with debugging turned on later.

Lutz


[Dovecot] Custom error messages.

2011-09-12 Thread Lauro C.
 I am using Dovecot 1.2.9.

 Is it possible to have custom error messages? I want to translate some of
the messages (for instance mailbox full), so it can be more user friendly. I
already use the quota warning feature. But I need to translate the messages
anyways, is it possible?

 Lauro


Re: [Dovecot] quota percents

2011-09-12 Thread Timo Sirainen
On 12.9.2011, at 19.17, Micah Anderson wrote:

>>> However, it doesn't seem to work in practice, because I have a user that
>>> is at 99% of quota, with nothing in the Trash who cannot move a 77KB
>>> message into the Trash without getting the quota_exceeded message and
>>> refusing to move it.
>> 
>> dovecot -n output?
> 
> namespace {
>  inbox = yes
>  location = 
>  prefix = 
>  separator = .
> }
> namespace {
>  hidden = yes
>  inbox = no
>  list = no
>  location = 
>  prefix = INBOX.
>  separator = .
> }

Maybe the client is using the INBOX. namespace and trying to copy to 
INBOX.Trash instead of Trash? You could try adding another quota rule for 
INBOX.Trash. I should probably also change the quota code to follow "alias_for" 
directives. Then you could have only a single Trash, if you add "alias_for = " 
to the INBOX. namespace.

Re: [Dovecot] Possible to Customize File Naming Scheme?

2011-09-12 Thread Timo Sirainen
On 12.9.2011, at 21.00, Dave Stubbs wrote:

>>> One of the nice things about the maildir "each email is a separate file" 
>>> idea is that you are not limited to maildir or dovecot or any other piece 
>>> of software to handle, read, and process the files.
>> Well, sdbox isn't good for that then anymore. Cydir backend could possibly 
>> work, although it is missing some features that dbox has and was mainly 
>> intended as an example code for super simple mailbox format.
> Well, maybe sdbox could still work.  Just a quick question - what is the 
> format of the u.* file?  Is it still a raw (possibly partially) mime-encoded 
> file that contains the all-important From: line, just like a mail file in a 
> maildir folder?  If so, I could sync the sdbox files elsewhere and index them 
> if I could convince dovecot to use the filename scheme u.*.eml instead of u.*

sdbox begins with a small dbox header, followed by the message text and finally 
a dbox metadata footer. Something like:

2 M1e C4e327f7d
^A^BN  0906

^A^C
R4e327f7d
V94e
G39670b147d7f324e0e1d74ccac23

dbox-file.h describes the headers and lists the metadata characters and what 
they mean. Because of this extra metadata I don't really know if it would be a 
good idea to name them *.eml.

Yes, you could copy specific sdbox files elsewhere and run "doveadm 
force-resync" on them. All message flags would be lost though, since they're 
stored only in Dovecot's index files.

Re: [Dovecot] Possible to Customize File Naming Scheme?

2011-09-12 Thread Dave Stubbs



On 9/12/2011 12:22 PM, Timo Sirainen wrote:

On 12.9.2011, at 19.10, Dave Stubbs wrote:


I'm watching how my mail system works, and I see that procmail creates a new file in 
the/new directory, each time an email is received.  This file is some 
complex combination of UIDs and things, suffixed by the server name.  So far, the 
filename has alphanumerics, a couple underscores, and a dot or two only.

But once dovecot gets it's hands on the file and moves it to the/cur directory, it starts 
doing "terrible" things to the file name.  Now, the filename starts to have "evil" 
things in it, like colons and commas.  Is there a way to change this?

That's how Maildir works to store message flags. If you don't like it, use 
something else.

Fair enough



I'm asking this primarily because I use dovecot as a massive long-term email archiving 
system.  One of the things one needs to be able to do when running a long-term archive 
like this is keep things as simple and accessible as possible.  The reason I use maildir 
is that I totally buy into the "one email, one file" idea - it means I don't 
have to store messages in big consolidated database files that are changeable with each 
new version of the vendor's software release (such as exchange DBs or Outlook PST files) 
or that are horrible performers (such as mbox).

Dovecot v2.0's sdbox format could work for you.


One of the nice things about the maildir "each email is a separate file" idea 
is that you are not limited to maildir or dovecot or any other piece of software to 
handle, read, and process the files.

Well, sdbox isn't good for that then anymore. Cydir backend could possibly 
work, although it is missing some features that dbox has and was mainly 
intended as an example code for super simple mailbox format.
Well, maybe sdbox could still work.  Just a quick question - what is the 
format of the u.* file?  Is it still a raw (possibly partially) 
mime-encoded file that contains the all-important From: line, just like 
a mail file in a maildir folder?  If so, I could sync the sdbox files 
elsewhere and index them if I could convince dovecot to use the filename 
scheme u.*.eml instead of u.*


Possible?  Or is the sdbox file format different?




Re: [Dovecot] How to get rid of sub-folders ?

2011-09-12 Thread Spyros Tsiolis
On Fri, 2011-09-09 at 16:22 +0100, Spyros Tsiolis wrote:


> OK, no answers on my previous e-mail. I'll rephrase it.
> How can I get rid of subfolders on a users' tree-like structure on dovecot ?
> Which file must I "touch" ?

This still isn't very understandable. You can delete subfolders with
either IMAP client (= IMAP DELETE command) or simply rm -rf in the
filesystem.

Or do you mean moving the subfolders to be root level folders? Again
IMAP client should be able to do this, or in filesystem level (assuming
Maildir++) you'd do something like:
mv ~/Maildir/.root.subfolder ~/Maildir/.subfolder





Timo,

thank you kindly for your time and patience,
It's a weird scenario where the user uses Thunderbird and managed to 

create folders underneath the subscribers' (her) root folder with symbols that
are not accepted by thunderbird.
Hence, the trouble of not being able to get rid of these folders.
Thanks for the pointer. I'll have to look more closely to the help pages
for the IMAP protocol.

Best Regards,

spyros


 

"I merely function as a channel that filters 
music through the chaos of noise"
- Vangelis


[Dovecot] Sieve envelope :detail "to" "extention" does not deliver to fileinto destination

2011-09-12 Thread Aleksandar Lazic

Dear Listmember.

I resend this with different Subject so that the spamfilter does not
drop the mail, I hope ;-)

I try to migrate from my current courier-mta setup fo postfix dovecot
setup.

I use the following scirpt to filter to the destination mailbox.

### /var/vmail/none.at/al/.dovecot.sieve
# from http://wiki.dovecot.org/LDA/Sieve
require ["fileinto", "envelope", "subaddress", "include"];

include "lists.sieve";

if envelope :detail "to" "work" {
  fileinto "INBOX.work";
}
###

### /var/vmail/none.at/al/sieve/lists.sieve
require ["fileinto", "subaddress", "envelope" ];

if envelope :detail "to" "pdnsusers" {
 fileinto "Lists.pdnsusers";
}
###

postfix/master

###
dovecot   unix  -   n   n   -   -   pipe
  flags=DRhu user=vmail:vmail argv=/usr/lib/dovecot/deliver -f ${sender}
  -d ${user}@${nexthop} -a ${original_recipient}
#  flags=DRhu user=vmail:vmail argv=/usr/lib/dovecot/deliver -f
${sender} -d ${user}@${nexthop} -m ${extension} -a ${original_recipient}
###

Log
###
Sep 11 21:47:48 lvps46-163-74-15 postfix/smtpd[7788]: connect from

Sep 11 21:48:12 lvps46-163-74-15 postfix/smtpd[7788]: 495EF9FECAF9:

Sep 11 21:48:27 lvps46-163-74-15 postfix/cleanup[7795]: 495EF9FECAF9:
message-id=<>
Sep 11 21:48:27 lvps46-163-74-15 postfix/qmgr[7785]: 495EF9FECAF9:
from=, size=268, nrcpt=1 (queue active)
Sep 11 21:48:27 lvps46-163-74-15 dovecot: lda: Debug: Loading modules
from directory: /usr/lib/dovecot/modules
Sep 11 21:48:27 lvps46-163-74-15 dovecot: lda: Debug: Module loaded:
/usr/lib/dovecot/modules/lib90_sieve_plugin.so
Sep 11 21:48:27 lvps46-163-74-15 dovecot: lda: Debug: auth input:
a...@none.at uid=5000 gid=5000 home=/var/vmail/none.at/al
Sep 11 21:48:27 lvps46-163-74-15 dovecot: lda(a...@none.at): Debug:
Effective uid=5000, gid=5000, home=/var/vmail/none.at/al
Sep 11 21:48:27 lvps46-163-74-15 dovecot: lda(a...@none.at): Debug:
maildir: root exists (/var/vmail/none.at/al/Maildir)
Sep 11 21:48:27 lvps46-163-74-15 dovecot: lda(a...@none.at): Debug:
maildir++: root=/var/vmail/none.at/al/Maildir, index=, control=,
inbox=/var/vmail/none.at/al/Maildir, alt=
Sep 11 21:48:27 lvps46-163-74-15 dovecot: lda(a...@none.at): Debug: none:
root=, index=, control=, inbox=, alt=
Sep 11 21:48:27 lvps46-163-74-15 dovecot: lda(a...@none.at): Debug:
Destination address: al-pdnsu...@none.at (source: -a parameter)
Sep 11 21:48:27 lvps46-163-74-15 dovecot: lda(a...@none.at): Debug: sieve:
using sieve path for user's script: /var/vmail/none.at/al/.dovecot.sieve
Sep 11 21:48:27 lvps46-163-74-15 dovecot: lda(a...@none.at): Debug: sieve:
opening script /var/vmail/none.at/al/.dovecot.sieve
Sep 11 21:48:27 lvps46-163-74-15 dovecot: lda(a...@none.at): Debug: sieve:
script binary /var/vmail/none.at/al/.dovecot.svbin successfully loaded
Sep 11 21:48:27 lvps46-163-74-15 dovecot: lda(a...@none.at): Debug: sieve:
binary save: not saving binary /var/vmail/none.at/al/.dovecot.svbin,
because it is already stored
Sep 11 21:48:27 lvps46-163-74-15 dovecot: lda(a...@none.at): Debug: sieve:
executing script from /var/vmail/none.at/al/.dovecot.svbin
Sep 11 21:48:27 lvps46-163-74-15 dovecot: lda(a...@none.at): sieve:
msgid=unspecified: stored mail into mailbox 'INBOX'
Sep 11 21:48:27 lvps46-163-74-15 postfix/pipe[7797]: 495EF9FECAF9:
to=, relay=dovecot, delay=28,
delays=28/0.02/0/0.22, dsn=2.0.0, status=sent (delivered via dovecot
service)
Sep 11 21:48:27 lvps46-163-74-15 postfix/qmgr[7785]: 495EF9FECAF9:
removed
Sep 11 21:48:28 lvps46-163-74-15 postfix/smtpd[7788]: disconnect from
xxx
###

dovecot -n => attachment dovecot_-n

~#: egrep -v '^(#|$)' /etc/dovecot/dovecot-sql.conf   


driver = mysql
connect = host=127.0.0.1 dbname=mailserver user=$USER \
password=$PASSWORD
default_pass_scheme = PLAIN-MD5
password_query = SELECT user_email AS user, \
user_password AS password \
FROM virtual_users WHERE user_email='%u';


Due to the fact that I'am new to dovecot and sieve I hope anybody can
help the solve this issue.

My target is to filter the mailinglists based on address extention or is
it better to filter on to header?

Is there a 'log' or 'print' command in the sieve filter or how can I
write a message to the log file?

Many thanks for your help

BR
Aleks
# 2.0.14: /etc/dovecot/dovecot.conf
# OS: Linux 2.6.18-028stab092.1 x86_64 Ubuntu 10.04.3 LTS 
auth_mechanisms = plain login digest-md5 cram-md5
disable_plaintext_auth = no
log_timestamp = "%Y-%m-%d %H:%M:%S "
mail_debug = yes
mail_privileged_group = mail
managesieve_notify_capability = mailto
managesieve_sieve_capability = fileinto reject envelope encoded-character 
vacation subaddress comparator-i;ascii-numeric relational regex imap4flags copy 
include variables body enotify environment mailbox date
passdb {
  args = /etc/dovecot/dovecot-sql.conf
  driver = sql
}
protocols = imap
recipient_delimiter = -
service auth {
  unix_listener auth-userdb {
group = vmail
mode = 0755
user = vmail
  }
  user = 

Re: [Dovecot] Possible to Customize File Naming Scheme?

2011-09-12 Thread Timo Sirainen
On 12.9.2011, at 19.10, Dave Stubbs wrote:

> I'm watching how my mail system works, and I see that procmail creates a new 
> file in the /new directory, each time an email is received.  This 
> file is some complex combination of UIDs and things, suffixed by the server 
> name.  So far, the filename has alphanumerics, a couple underscores, and a 
> dot or two only.
> 
> But once dovecot gets it's hands on the file and moves it to the /cur 
> directory, it starts doing "terrible" things to the file name.  Now, the 
> filename starts to have "evil" things in it, like colons and commas.  Is 
> there a way to change this?  

That's how Maildir works to store message flags. If you don't like it, use 
something else.

> I'm asking this primarily because I use dovecot as a massive long-term email 
> archiving system.  One of the things one needs to be able to do when running 
> a long-term archive like this is keep things as simple and accessible as 
> possible.  The reason I use maildir is that I totally buy into the "one 
> email, one file" idea - it means I don't have to store messages in big 
> consolidated database files that are changeable with each new version of the 
> vendor's software release (such as exchange DBs or Outlook PST files) or that 
> are horrible performers (such as mbox).

Dovecot v2.0's sdbox format could work for you.

> One of the nice things about the maildir "each email is a separate file" idea 
> is that you are not limited to maildir or dovecot or any other piece of 
> software to handle, read, and process the files.

Well, sdbox isn't good for that then anymore. Cydir backend could possibly 
work, although it is missing some features that dbox has and was mainly 
intended as an example code for super simple mailbox format.

>  For instance, I would like to backup my maildir by using rsync to 
> synchronize my dovecot-managed maildir to a Windows server running NFS.  From 
> there the files are synchronized via Windows DFS ( to which there is no open 
> source solution that is even close) to several other servers around the 
> continent.  Only thing:  The evil commas and colons in the filenames are 
> anathema to Windows.  So instead I tar the maildir folders to tgz files on 
> the windows server, and the tgz's are synchronized to other DR sites.

You could patch Dovecot's maildir code to use something else than commas and 
colons in maildir-storage.h:

#define MAILDIR_INFO_SEP ':'
#define MAILDIR_EXTRA_SEP ','
#define MAILDIR_FLAGS_SEP ','

#define MAILDIR_INFO_SEP_S ":"
#define MAILDIR_EXTRA_SEP_S ","
#define MAILDIR_FLAGS_SEP_S ","

> If I could do without the need for tar (mandated solely because of the colons 
> and commas in the dovecot filename scheme) I could minimize the time to 
> backup (only synchronizing changes) and suddenly I would have a lot of other 
> benefits opened up.  One simple one would be that if I could configure 
> dovecot to append the .eml extension to the end of every file (technically 
> each file in a maildir is an eml file regardless of the extension being 
> present or not - eml is just a raw mail file just like what you'd find in a 
> maildir) I would have instant access to them using Search Server Express, 
> which can read eml files but strongly prefers to use extentions to recognize 
> files as such.

The message flags should still be stored somewhere if not in the filename. dbox 
and cydir stores them in Dovecot's index files.

> To be clear:  I'm not requesting that dovecot's file naming convention be 
> changed to match my quirky requirements - I'm just asking if it could be made 
> configurable, so I could change it to match my needs and others could change 
> it to match theirs.  In the interests of REALLY being able to use the 
> elegantly simple idea of each mail being a separate file, I'm trying to get 
> more out of that great pile of folders and files I'm amassing in my mail 
> archive server.  The more use I can make of them with other software other 
> than dovecot (i.e. data crawling, indexing, easy recovery in a catastrophe, 
> etc) the more valuable this format is.
> 
> Is this possible?

One last possibility is to create your own mailbox format that works exactly 
like you want.

Re: [Dovecot] Possible to Customize File Naming Scheme?

2011-09-12 Thread Eduardo M KALINOWSKI

On Seg, 12 Set 2011, Dave Stubbs wrote:

Hello all,

I'm watching how my mail system works, and I see that procmail  
creates a new file in the /new directory, each time an email  
is received.  This file is some complex combination of UIDs and  
things, suffixed by the server name.  So far, the filename has  
alphanumerics, a couple underscores, and a dot or two only.


But once dovecot gets it's hands on the file and moves it to the  
/cur directory, it starts doing "terrible" things to the  
file name.  Now, the filename starts to have "evil" things in it,  
like colons and commas.


The colon and commas are part of the Maildir spec[0], so no, it can't  
be changed.


[0]http://cr.yp.to/proto/maildir.html


--
If you want to read about love and marriage you've got to buy two separate
books.
-- Alan King

Eduardo M KALINOWSKI
edua...@kalinowski.com.br




Re: [Dovecot] quota percents

2011-09-12 Thread Micah Anderson
Timo Sirainen  writes:

> On Fri, 2011-09-09 at 16:05 -0400, Micah Anderson wrote:
>
>> its incorrect because if you change it to what it suggests ('+10%') it
>> wont work because that wont be 10% more, rather, it is set to bytes=+10:
>
> Well, that's a more complex problem. The %% escaping needs to be done in
> dovecot.conf, but it doesn't need to be done elsewhere. If this said
> that "use +10%%" and someone gives that in SQL user_query, it will
> break. So I'm not changing the warning.

Ok, that makes sense.

>> However, it doesn't seem to work in practice, because I have a user that
>> is at 99% of quota, with nothing in the Trash who cannot move a 77KB
>> message into the Trash without getting the quota_exceeded message and
>> refusing to move it.
>
> dovecot -n output?

NOTE: i turned off the quota plugins while this is sorted, so you wont
see them enabled below.

# 2.0.13: /etc/dovecot/dovecot.conf
# OS: Linux 2.6.32-5-amd64 x86_64 Debian 6.0.2 
auth_default_realm = example.net
auth_verbose = yes
default_process_limit = 256
default_vsz_limit = 512 M
dict {
  expire = mysql:/etc/dovecot/dovecot-dict-sql.conf
  quota = mysql:/etc/dovecot/dovecot-dict-sql.conf
}
disable_plaintext_auth = no
first_valid_gid = 8
first_valid_uid = 8
last_valid_gid = 8
last_valid_uid = 8
listen = *
login_greeting = howdy, ready.
mail_location = mdbox:~/mdbox
mail_plugins = expire
maildir_very_dirty_syncs = yes
namespace {
  inbox = yes
  location = 
  prefix = 
  separator = .
}
namespace {
  hidden = yes
  inbox = no
  list = no
  location = 
  prefix = INBOX.
  separator = .
}
passdb {
  args = /etc/dovecot/dovecot-sql.conf
  driver = sql
}
plugin {
  expire = Trash
  expire2 = Trash/*
  expire3 = Spam
  expire_dict = proxy::expire
  quota = dict:Your mail quota::proxy::quota
  quota_exceeded_message = You are over quota. To avoid losing mail, 
immediately empty your Trash and Sent folders and delete emails with large 
attachments. 
  quota_rule = *:bytes=24117248
  quota_rule2 = Trash:bytes=+50%%
  quota_rule3 = Spam:bytes=+20%%
}
postmaster_address = postmas...@example.net
protocols = imap pop3
service dict {
  unix_listener dict {
group = mail
mode = 0600
user = mail
  }
}
service imap-login {
  process_min_avail = 10
  service_count = 0
  vsz_limit = 512 M
}
service imap-postlogin {
  executable = script-login /maildir/postlogin_imap
  user = $default_internal_user
}
service pop3-postlogin {
  executable = script-login /maildir/postlogin_pop
  user = $default_internal_user
}
ssl_cert = 

[Dovecot] Possible to Customize File Naming Scheme?

2011-09-12 Thread Dave Stubbs

Hello all,

[Sorry if this has been covered already - I searched back a little way 
in the archive and didn't find anything recent on the topic.]


I'm wondering if it is possible to customize the way dovecot creates or 
modifies filenames in the maildir directories?


I'm watching how my mail system works, and I see that procmail creates a 
new file in the /new directory, each time an email is received.  
This file is some complex combination of UIDs and things, suffixed by 
the server name.  So far, the filename has alphanumerics, a couple 
underscores, and a dot or two only.


But once dovecot gets it's hands on the file and moves it to the 
/cur directory, it starts doing "terrible" things to the file 
name.  Now, the filename starts to have "evil" things in it, like colons 
and commas.  Is there a way to change this?  I'm asking this primarily 
because I use dovecot as a massive long-term email archiving system.  
One of the things one needs to be able to do when running a long-term 
archive like this is keep things as simple and accessible as possible.  
The reason I use maildir is that I totally buy into the "one email, one 
file" idea - it means I don't have to store messages in big consolidated 
database files that are changeable with each new version of the vendor's 
software release (such as exchange DBs or Outlook PST files) or that are 
horrible performers (such as mbox).


One of the nice things about the maildir "each email is a separate file" 
idea is that you are not limited to maildir or dovecot or any other 
piece of software to handle, read, and process the files.  For instance, 
I would like to backup my maildir by using rsync to synchronize my 
dovecot-managed maildir to a Windows server running NFS.  From there the 
files are synchronized via Windows DFS ( to which there is no open 
source solution that is even close) to several other servers around the 
continent.  Only thing:  The evil commas and colons in the filenames are 
anathema to Windows.  So instead I tar the maildir folders to tgz files 
on the windows server, and the tgz's are synchronized to other DR sites.


If I could do without the need for tar (mandated solely because of the 
colons and commas in the dovecot filename scheme) I could minimize the 
time to backup (only synchronizing changes) and suddenly I would have a 
lot of other benefits opened up.  One simple one would be that if I 
could configure dovecot to append the .eml extension to the end of every 
file (technically each file in a maildir is an eml file regardless of 
the extension being present or not - eml is just a raw mail file just 
like what you'd find in a maildir) I would have instant access to them 
using Search Server Express, which can read eml files but strongly 
prefers to use extentions to recognize files as such.


To be clear:  I'm not requesting that dovecot's file naming convention 
be changed to match my quirky requirements - I'm just asking if it could 
be made configurable, so I could change it to match my needs and others 
could change it to match theirs.  In the interests of REALLY being able 
to use the elegantly simple idea of each mail being a separate file, I'm 
trying to get more out of that great pile of folders and files I'm 
amassing in my mail archive server.  The more use I can make of them 
with other software other than dovecot (i.e. data crawling, indexing, 
easy recovery in a catastrophe, etc) the more valuable this format is.


Is this possible?


Re: [Dovecot] userdb static & Quota from LDAP?

2011-09-12 Thread Christian Schmidt
Hello Timo,

Timo Sirainen, 12.09.2011 (d.m.y):

> On Fri, 2011-09-09 at 23:58 +0200, Christian Schmidt wrote:
> > userdb {
> >   driver = static
> >   args = uid=vmail gid=vmail home=/var/maildir/%u
> > }
> 
> These can be replaced with global settings:
> 
> mail_uid = vmail
> mail_gid = vmail
> mail_home = /var/maildir/%u
> 
> > Now I'd like to add per-user quotas that will also be stored in the
> > LDAP directory, and I'm not sure how to put things together.
> > IMHO quota is the only "userdb information" requested from LDAP, and
> > I'd like to leave all the other "userdb pieces" as the are. I changed
> > the userdb definition to:
> > userdb {
> >   driver = ldap
> >   args = /etc/dovecot/conf.d/ldap-userdb.ext
> > }
> > 
> > My /etc/dovecot/conf.d/ldap-userdb.ext contains (along other lines):
> > 
> > user_attrs = 
> > uid=vmail,gid=vmail,home=/var/maildir/%u,mailQuota=quota=quota_rule=*:storage=%$
> 
> Just set those global settings and drop uid/gid/home from here. Or you
> could get them working here too, but the syntax is slightly wrong:
> 
> user_attrs = =uid=vmail, =gid=vmail, ..
> 
> (With the above settings you're telling Dovecot that LDAP "uid" field
> will be assigned to Dovecot's "vmail" field, and the "gid" field
> immediately overrides it, and LDAP "home" field's value is set to
> Dovecot's "/var/maildir/%u" field.)

This is working now:

user_attrs = mailQuota=quota_rule=*:bytes=%$

Thank you, Timo!

Gruss/Regards,
Christian Schmidt

-- 
You're at the end of the road again.


[Dovecot] director ignoring director_mail_servers for lmtp connections

2011-09-12 Thread mailing lists
Hello,

Following Jan-Frode's advise I am trying this configuration:


{postfix} ---lmtp---> {director} ---lmtp---> {dovecot}

so I have two dovecot instances for director/proxy and lmtp delivery on ports 
1024 and 24 respectively.

whilst for imap connections I can specify a pool of imap backend servers via 
'director_mail_servers' it seems is not possible with lmtp.

Sep 12 17:14:13 imap1 dovecot: auth: Debug: master in: PASS   1   
user...@example.com    service=lmtp    lip=::1 lport=1024  rip=::1 rpor5
Sep 12 17:14:13 imap1 dovecot: auth: Debug: static(user...@example.com,::1): 
lookup
Sep 12 17:14:13 imap1 dovecot: auth: Debug: password(user...@eexample.com,::1): 
Credentials:
Sep 12 17:14:13 imap1 dovecot: auth: Debug: master out: PASS  1   
user=user...@example.com   proxy   port=24
Sep 12 17:14:13 imap1 dovecot: lmtp(25682): Debug: auth input: 
user=user...@example.com proxy port=24
Sep 12 17:14:13 imap1 dovecot: lmtp(25682): Error: proxy: host not given
Sep 12 17:14:13 imap1 dovecot: lmtp(25682): Debug: Loading modules from 
directory: /usr/lib64/dovecot/modules
Sep 12 17:14:13 imap1 dovecot: lmtp(25682): Debug: Module loaded: 
/usr/lib64/dovecot/modules/lib01_acl_plugin.so
Sep 12 17:14:13 imap1 dovecot: auth: Debug: master in: USER   2   
user...@example.com    service=lmtp    lip=::1 rip=::1
Sep 12 17:14:13 imap1 dovecot: auth: Debug: static(user...@example.com,::1): 
lookup
Sep 12 17:14:13 imap1 dovecot: auth: Debug: password(user...@example.com,::1): 
Credentials:
Sep 12 17:14:13 imap1 dovecot: auth: Debug: master out: USER  2   
user...@example.com
Sep 12 17:14:13 imap1 dovecot: lmtp(25682): Debug: auth input: 
user...@example.com
Sep 12 17:14:43 imap1 dovecot: lmtp(25682): Disconnect from ::1: Client quit 
(in RCPT TO)


how I can redirect incoming lmtp request to backend lmtp servers (and not just 
one)? what I'm missing here? 

    /--/

# dovecot -c /etc/dovecot-director/dovecot.conf -n
# 2.0.14: /etc/dovecot-director/dovecot.conf
# OS: Linux 2.6.34.7-0.7-xen x86_64 openSUSE 11.3 (x86_64) 
auth_debug = yes
auth_debug_passwords = yes
auth_verbose = yes
auth_verbose_passwords = plain
base_dir = /var/run/dovecot-director/
director_mail_servers = 101.180.245.101
director_servers = 101.180.245.101
disable_plaintext_auth = no
lmtp_proxy = yes
mail_debug = yes
mail_fsync = always
mail_gid = 5000
mail_nfs_index = yes
mail_nfs_storage = yes
mail_plugins = acl
mail_uid = 5000
managesieve_notify_capability = mailto
managesieve_sieve_capability = fileinto reject envelope encoded-character 
vacation subaddress comparator-i;ascii-numeric relational regex imap4flags copy 
include variables body enotify environment mailbox date
mmap_disable = yes
passdb {
  args = proxy=y nopassword=y
  driver = static
}
plugin {
  acl = vfile
  sieve = ~/.dovecot.sieve
  sieve_dir = ~/sieve
}
protocols = imap lmtp
service auth {
  unix_listener auth-userdb {
    group = vmail
    mode = 0666
    user = vmail
  }
}
service director {
  fifo_listener login/proxy-notify {
    mode = 0666
  }
  inet_listener {
    port = 9090
  }
  unix_listener director-userdb {
    mode = 0666
  }
  unix_listener login/director {
    mode = 0666
  }
}
service imap-login {
  executable = imap-login director
  inet_listener imap {
    port = 10143
  }
}
service lmtp {
  inet_listener lmtp {
    port = 1024
  }
}
ssl = no
verbose_proctitle = yes
protocol lmtp {
  passdb {
    args = proxy=y nopassword=y port=24
    driver = static
  }
}
protocol imap {
  mail_max_userip_connections = 100
}



Re: [Dovecot] Attacking Dovecot

2011-09-12 Thread Ken A


That's all normal activity (failed logins) for any internet facing 
machine. They may be dictionary attacks, or not... If they get on your 
nerves, block them. Strong passwords will help more.


Also, it's likely that you have forged mail coming in from outside, and 
not really "spam from local users" ?


If it is really locally generated, then disable the account.

Ken


On 9/9/2011 4:45 PM, Nikos Papadopoulos wrote:

Hello,



I am using Dovecot ver.1.0.7 on an x86 server with RedHat Linux Enterprise 5
and the following configuration:



# 1.0.7: /etc/dovecot.conf

protocols: pop3

login_dir: /var/run/dovecot/login

login_executable: /usr/libexec/dovecot/pop3-login

mail_location: mbox:~/mail:INBOX=/var/mail/%u

mail_executable: /usr/libexec/dovecot/pop3

mail_plugin_dir: /usr/lib/dovecot/pop3

pop3_client_workarounds: outlook-no-nuls oe-ns-eoh

auth default:

   passdb:

 driver: pam

   userdb:

 driver: passwd





It seems that my mail server is being attacked by someone who tries to
retrieve users' credentials. Please read below an output of logwatch.



dovecot-auth: pam_succeed_if(dovecot:auth): error retrieving information
about

user sandra

  dovecot-auth: pam_succeed_if(dovecot:auth): error retrieving information
about

user tanya

  dovecot-auth: pam_succeed_if(dovecot:auth): error retrieving information
about

user tanya

  dovecot-auth: pam_succeed_if(dovecot:auth): error retrieving information
about

user dark

  dovecot-auth: pam_succeed_if(dovecot:auth): error retrieving information
about

user dark

  dovecot-auth: pam_succeed_if(dovecot:auth): error retrieving information
about

user gibson

  dovecot-auth: pam_succeed_if(dovecot:auth): error retrieving information
about

user frank

  dovecot-auth: pam_succeed_if(dovecot:auth): error retrieving information
about

user frank







Besides, some of the local users receive "spam" emails, which seem to be
sent by another local user.



Please assist me on how to prevent the aforementioned attack.



Best Regards,



Nikos






--
Ken Anderson
Pacific Internet - http://www.pacific.net
Latest Pacific.Net Status - http://twitter.com/pacnetstatus


Re: [Dovecot] dovecot 2.0.12: mdbox & quota=dirsize

2011-09-12 Thread Roman Zakharov

12.09.2011 15:04, Timo Sirainen пишет:

On Fri, 2011-09-09 at 15:24 +0400, Роман Захров wrote:

#doveconf -v
..
   quota = dirsize:User quota
   quota_debug = yes

There's no such setting as quota_debug.

Yes, really, not used adjustment, but doesn't cause errors :)



then i change ./dovecot-2.0.12/src/plugins/quota/quota-dirsize.c
165--path = mailbox_list_get_path(namespaces[i]->list, NULL,
166-- 
MAILBOX_LIST_PATH_TYPE_MAILBOX);
165++path = mailbox_list_get_path(namespaces[i]->list, NULL,
166++  
MAILBOX_LIST_PATH_TYPE_DIR);

Well.. Hmm. I suppose that's ok. Done:
http://hg.dovecot.org/dovecot-2.0/rev/9ea79795088d
(Looks like hg web doesn't like UTF-8 in your name.)



Roman Zakharov, it is not important, i think


Re: [Dovecot] Mails repopping

2011-09-12 Thread Simon Brereton
> -Original Message-
> From: dovecot-boun...@dovecot.org [mailto:dovecot-
> boun...@dovecot.org] On Behalf Of Simon Brereton
> > -Original Message-
> > From: Timo Sirainen [mailto:t...@iki.fi] On Fri, 2011-09-09 at 13:07
> > -0400, Simon Brereton wrote:
> >
> > > I have a server that's been running Courier for about 6 years and
> > in
> > > all that time I think I've only ever had 1 issues where an entire
> > mail
> > > box was repopped by a webmail client.  However, since moving to a
> > new
> > > server and dovecot 4 weeks ago, I've now had the webmail client
> > repop
> > > this account 4 times (there are about 230 mails in the account).
> > >
> > > Is there a setting I need to tighten to prevent/remedy this?  I
> > have
> > > no idea if it's happening on other accounts, but this is one that
> I
> > > see.  The format is maildir.  There has been no changes to the
> > webmail
> > > client.
> >
> > dovecot -n output would have been nice. Also do you see anything in
> > error logs?
> 
> Ah.  My apologies of course.  Here it is..
> 
> mail:~# dovecot -n
> # 1.2.15: /etc/dovecot/dovecot.conf
> # OS: Linux 2.6.32-5-amd64 x86_64 Debian 6.0.2 ext3

I've only just noticed that installing from apt-get on Debian 64-bit installs 
Dovecot 1.2 - does anyone know when 2.x will be available via apt?

Simon





Re: [Dovecot] Mails repopping

2011-09-12 Thread Simon Brereton
> -Original Message-
> From: Timo Sirainen [mailto:t...@iki.fi]
> On Fri, 2011-09-09 at 13:07 -0400, Simon Brereton wrote:
> 
> > I have a server that's been running Courier for about 6 years and
> in
> > all that time I think I've only ever had 1 issues where an entire
> mail
> > box was repopped by a webmail client.  However, since moving to a
> new
> > server and dovecot 4 weeks ago, I've now had the webmail client
> repop
> > this account 4 times (there are about 230 mails in the account).
> >
> > Is there a setting I need to tighten to prevent/remedy this?  I
> have
> > no idea if it's happening on other accounts, but this is one that I
> > see.  The format is maildir.  There has been no changes to the
> webmail
> > client.
> 
> dovecot -n output would have been nice. Also do you see anything in
> error logs?

Ah.  My apologies of course.  Here it is..

mail:~# dovecot -n
# 1.2.15: /etc/dovecot/dovecot.conf
# OS: Linux 2.6.32-5-amd64 x86_64 Debian 6.0.2 ext3
log_timestamp: %Y-%m-%d %H:%M:%S
protocols: imap imaps pop3 pop3s
ssl_ca_file: /etc/ssl/keys/rhodes-ca.crt
ssl_cert_file: /etc/ssl/keys/mail.domain.net.crt
ssl_key_file: /etc/ssl/private/mail.domain.net.key
disable_plaintext_auth: no
login_dir: /var/run/dovecot/login
login_executable(default): /usr/lib/dovecot/imap-login
login_executable(imap): /usr/lib/dovecot/imap-login
login_executable(pop3): /usr/lib/dovecot/pop3-login
mail_privileged_group: mailsystem
mail_location: maildir:/var/spool/mail/virtual/%d/%n
maildir_very_dirty_syncs: yes
mbox_write_locks: fcntl dotlock
mail_executable(default): /usr/lib/dovecot/imap
mail_executable(imap): /usr/lib/dovecot/imap
mail_executable(pop3): /usr/lib/dovecot/pop3
mail_plugins(default): quota imap_quota
mail_plugins(imap): quota imap_quota
mail_plugins(pop3): quota
mail_plugin_dir(default): /usr/lib/dovecot/modules/imap
mail_plugin_dir(imap): /usr/lib/dovecot/modules/imap
mail_plugin_dir(pop3): /usr/lib/dovecot/modules/pop3
imap_client_workarounds(default): outlook-idle delay-newmail
imap_client_workarounds(imap): outlook-idle delay-newmail
imap_client_workarounds(pop3):
pop3_client_workarounds(default):
pop3_client_workarounds(imap):
pop3_client_workarounds(pop3): outlook-no-nuls oe-ns-eoh
lda:
  postmaster_address: postmas...@domain.net
  mail_plugins: quota
  log_path:
  info_log_path:
  deliver_log_format: msgid=%m: %f: %$
auth default:
  mechanisms: plain login
  user: mailsystem
  verbose: yes
  passdb:
driver: sql
args: /etc/dovecot/dovecot-sql.conf
  userdb:
driver: prefetch
  userdb:
driver: static
args: uid=999 gid=115 home=/var/spool/mail/virtual/%d/%n allow_all_users=yes
  socket:
type: listen
client:
  path: /var/spool/postfix/private/auth
  mode: 432
  user: postfix
  group: mailsystem
master:
  path: /var/run/dovecot/auth-master
  mode: 432
  user: mailsystem
  group: mailsystem
plugin:
  quota: maildir

Could you make dovecot -n munge the certificate and postmaster email addresses? 
 I'm not comfortable with that floating on the internet..

The only thing I have in the logs is 2 sessions where mail was popped (note, it 
doesn't even add up to the 183 messages in the mail box).  But those sessions 
are vastly longer than the regular ones (tens of minutes compared to a few 
seconds).  Since both IPs are on the back-bone, that's quite a while to 
download 100 mails (none of which are over 

Sep 11 21:36:25 mail dovecot: pop3-login: Login: user=, 
method=PLAIN, rip=64.88.168.84, lip=83.170.65.xxx, TLS
Sep 11 21:36:34 mail dovecot: POP3(u...@domain.com): Disconnected: Logged out 
top=0/0, retr=0/0, del=0/183, size=14025971
Sep 11 21:43:44 mail dovecot: pop3-login: Login: user=, 
method=PLAIN, rip=64.88.168.84, lip=83.170.65.xxx, TLS
Sep 11 21:44:54 mail dovecot: POP3(u...@domain.com): Disconnected: Logged out 
top=0/0, retr=0/0, del=0/183, size=14025971
Sep 11 21:52:31 mail dovecot: pop3-login: Login: user=, 
method=PLAIN, rip=64.88.168.84, lip=83.170.65.xxx, TLS
Sep 11 22:56:01 mail dovecot: POP3(u...@domain.com): Disconnected: Logged out 
top=0/0, retr=100/9182678, del=0/183, size=14025971
Sep 11 23:08:58 mail dovecot: pop3-login: Login: user=, 
method=PLAIN, rip=64.88.168.84, lip=83.170.65.xxx, TLS
Sep 11 23:37:57 mail dovecot: POP3(u...@domain.com): Disconnected: Logged out 
top=0/0, retr=75/4748674, del=0/183, size=14025971
Sep 12 00:04:11 mail dovecot: pop3-login: Login: user=, 
method=PLAIN, rip=64.88.168.84, lip=83.170.65.xxx, TLS
Sep 12 00:04:26 mail dovecot: POP3(u...@domain.com): Disconnected: Logged out 
top=0/0, retr=0/0, del=0/183, size=14025971
Sep 12 00:07:40 mail dovecot: pop3-login: Login: user=, 
method=PLAIN, rip=64.88.168.84, lip=83.170.65.xxx, TLS
Sep 12 00:07:53 mail dovecot: POP3(u...@domain.com): Disconnected: Logged out 
top=0/0, retr=0/0, del=0/183, size=14025971


> If you're using the default pop3_uidl_format it'll rely on IMAP UIDs
> to stay the same, and I guess it's possible that due to some ot

Re: [Dovecot] Dsync and hidden files

2011-09-12 Thread Dick Middleton
On 09/12/11 14:32, Timo Sirainen wrote:
> On Mon, 2011-09-12 at 12:03 +0100, Dick Middleton wrote:

>> It would be nice if they were ignored (or copied unchanged).  Is there 
>> another
>> way to deal with them other than by deleting thm?
> 
> Here: http://hg.dovecot.org/dovecot-2.0/raw-rev/3c8b44bb1974

Did you just do that?  For me?  Wow, I'm flattered.

Many thanks.

Dick


Re: [Dovecot] problem migrating from maildir to dbox

2011-09-12 Thread Timo Sirainen
You changed the mail_location globally to dbox? You should instead do it
one user at a time, like explained in
http://wiki2.dovecot.org/Tools/Dsync (with initial dsync done before
user's mail_location is ever changed).

Otherwise you'll get these duplicate INBOXes and you'll need to somehow
manually figure out how to merge them. There are "doveadm move" and
"doveadm mailbox delete" commands for example.

On Mon, 2011-09-12 at 15:38 +0200, Ramón Frontera wrote:
> While the dovecot is running with the new mail_location to dbox, I try to 
> migrate the maildir content.
> This is the reason because INBOX already exists.
> 
> --
> --
>   Ramon Frontera Gallardo
>   Centre de Tecnologies de la Informació  
>   Universitat de les Illes Balears
>   Ctra. Valldemossa km 7,5
>   07122 Palma de Mallorca
> 
> 
> 
> 
> El 12/09/2011, a las 14:06, Timo Sirainen escribió:
> 
> > On Mon, 2011-09-12 at 13:52 +0200, Ramón Frontera wrote:
>  After that we use dsync -u user mirror maildir:~/Maildir.
>  The problem is that if INBOX exists the dsync create a new folder with 
>  name like b5893c0a93ff694e55122dfa3112
>  Can I migrate to the existing INBOX? or How can I merge the 2 INBOX 
>  folders?
> > 
> > Have you created the dbox directory before running dsync? And opened it
> > with some tool? I tried with your config and it worked fine.
> > 
> > The reason why these duplicate INBOXes happen is when INBOX exists both
> > in source and in destination when dsync is run. Typically this means
> > that you've created the destination INBOX already by e.g. logging in or
> > delivering a mail there or something..
> > 
> > 
> 




Re: [Dovecot] problem migrating from maildir to dbox

2011-09-12 Thread Ramón Frontera
While the dovecot is running with the new mail_location to dbox, I try to 
migrate the maildir content.
This is the reason because INBOX already exists.

--
--
  Ramon Frontera Gallardo
  Centre de Tecnologies de la Informació  
  Universitat de les Illes Balears
  Ctra. Valldemossa km 7,5
  07122 Palma de Mallorca




El 12/09/2011, a las 14:06, Timo Sirainen escribió:

> On Mon, 2011-09-12 at 13:52 +0200, Ramón Frontera wrote:
 After that we use dsync -u user mirror maildir:~/Maildir.
 The problem is that if INBOX exists the dsync create a new folder with 
 name like b5893c0a93ff694e55122dfa3112
 Can I migrate to the existing INBOX? or How can I merge the 2 INBOX 
 folders?
> 
> Have you created the dbox directory before running dsync? And opened it
> with some tool? I tried with your config and it worked fine.
> 
> The reason why these duplicate INBOXes happen is when INBOX exists both
> in source and in destination when dsync is run. Typically this means
> that you've created the destination INBOX already by e.g. logging in or
> delivering a mail there or something..
> 
> 



Re: [Dovecot] Dsync and hidden files

2011-09-12 Thread Timo Sirainen
On Mon, 2011-09-12 at 12:03 +0100, Dick Middleton wrote:

>   I'm in the process of changing from Dovecot v1 to v2 and changing to 
> mdbox in
> the process.  I've come across a little problem which I was hoping there would
> be a workaround for.
> 
> There are sieve config files in the home directories which are hidden files.
> Dsync croaks when it finds one of these because they are not mbox format.
> 
> It would be nice if they were ignored (or copied unchanged).  Is there another
> way to deal with them other than by deleting thm?

Here: http://hg.dovecot.org/dovecot-2.0/raw-rev/3c8b44bb1974




Re: [Dovecot] general advice sought

2011-09-12 Thread Timo Sirainen
On Mon, 2011-09-12 at 13:11 +0100, Alan Brown wrote:
> I'd like to hear the thoughts of list members on which type of storage
> method seems "best" for inboxes and for folders.
> 
> The filesystem is GFS2 and for various reasons I can't change it.
..
> If I migrate to other formats (eg mdbox), then it needs to be able to be 
> done on the fly. (Taking the mailservers down for a day won't go down 
> well, even an hour raises howls).

Have you had any trouble with Dovecot's index files in your current
setup? Any errors at all? If not, I'd think mdbox will work fine. You
can do it incrementally per-user (and you really should try it first
with only a few users). http://wiki2.dovecot.org/Tools/Dsync explains
how to do it on the fly.




Re: [Dovecot] mysql auth failover failing

2011-09-12 Thread Timo Sirainen
On Fri, 2011-09-09 at 19:33 -0700, Paul B. Henson wrote:

> According to the sample SQL configuration file "HA / round-robin 
> load-balancing is supported by giving multiple host settings, like: 
> host=sql1.host.org host=sql2.host.org".
> 
> However, as far as I can tell dovecot only connects to the first listed 
> host, and processes all queries through it, there does not appear to be 
> any load-balancing going on.

The current code creates connection to the second server only when the
first connection is already busy with an SQL query, or when it's not
working. Once there are more connections, it starts doing round robin
lookups.

This works okay enough with PostgreSQL because it does asynchronous
lookups, so two simultaneous lookups create a second connection. MySQL
does synchronous lookups though, so the second connection is normally
never created.

I suppose the fix to this would be to always connect to all SQL servers
at startup.

> That's not necessarily a dealbreaker; however, high-availability does 
> not appear to be working either.
> 
> If I shutdown the first mysql server, dovecot starts to log connection 
> failures:
> 
> Sep  9 15:47:34 tweak dovecot: auth: Error: 
> mysql(mysql-1.unx.csupomona.edu): Connect failed to database (idmgmt): 
> Can't connect to MySQL server on 'mysql-1.unx.csupomona.edu' (111) - 
> waiting for 1 seconds before retry
> 
> Sep  9 15:47:39 tweak dovecot: auth: Error: 
> mysql(mysql-1.unx.csupomona.edu): Connect failed to database (idmgmt): 
> Can't connect to MySQL server on 'mysql-1.unx.csupomona.edu' (111) - 
> waiting for 25 seconds before retry

Those are intentional.

> And postfix starts to fail authentications:
> 
> Sep  9 15:47:35 tweak postfix/smtpd[5119]: warning: 
> bender.iitsys.csupomona.edu[134.71.250.134]: SASL DIGEST-MD5 
> authentication failed: Connection lost to authentication server

It should have created the second connection here and not fail..

> Now and again the authentication process dies:
> 
> Sep  9 15:47:39 tweak dovecot: auth: Panic: file auth-request-handler.c: 
> line 697 (auth_request_handler_flush_failures): assertion failed: 
> (auth_request->state == AUTH_REQUEST_STATE_FINISHED)

And this of course shouldn't happen either.

> Requests start to pile up:
> 
> Sep  9 15:51:46 tweak dovecot: auth: Warning: auth workers: Auth request 
> was queued for 25 seconds, 45 left in queue
> 
> Lookups time out:
> 
> Sep  9 15:57:22 tweak dovecot: auth: Error: auth worker: Aborted 
> request: Lookup timed out

These are the result of the previous failures.

> This occasionally pops up:
> 
> Sep  9 15:58:38 tweak dovecot: auth: Fatal: 
> net_connect_unix(auth-worker) failed: Resource temporarily unavailable

Probably this too.

> And sometimes the auth process gets temporarily disabled:
> 
> Sep  9 15:58:57 tweak dovecot: master: Error: service(auth): command 
> startup failed, throttling

Most likely related to the crash, although I think this still shouldn't
have happened.

> I don't think all authentications fail during the scenario, but I think 
> the majority do. Based on the network traffic, dovecot is almost 
> continuously trying to connect to the first listed server. It sometimes 
> connects to the second listed server, but when it does, the connection 
> does not persist, it goes away almost immediately.

There are multiple auth-worker processes, each one having their own
internal MySQL connections with separate retry counters.

I'll try to debug this soon.



[Dovecot] general advice sought

2011-09-12 Thread Alan Brown


I'd like to hear the thoughts of list members on which type of storage
method seems "best" for inboxes and for folders.

The filesystem is GFS2 and for various reasons I can't change it.

Inboxes - currently Mbox format. Some users have upwards of 5000
messages in there (the largest is about 18k entries) and thanks to 
attachments some inboxes are 40-200Mb with a few sitting at 2-3Gb. 
(Suicidal, I know but enforcing rules is politik-laden and getting 
academics to behave sensibly is like herding cats)


Folders: Mdir format. Thanks to GFS2 filesystem limitations(*) I'm 
currently enforcing a limit of 4000 messages/folder. It'd be nice to 
have a "better" way of storing these which doesn't drive up backup loads

tremendously.

The mail spool has around 6 million files in the folders, covering about
400Gb.

GFS2 filesystem limitations are painful.

While there are no hard limits, It really doesn't cope well with a lot
of files in any given directory thanks to limitations in the way that
cluster locking is propagated, There are marked slowdowns about 100
files, this becomes awful above 1000 and effectively unusable above
about 8000 entries as the entire IO system gets halted momentarily when
such directories are opened and the directory may take up to 5 minutes
to return a "ls" result.

Some users had upwards of 80k files in their mail folders (~40k
messages) and accessing these brought the entire system to a halt.

If I migrate to other formats (eg mdbox), then it needs to be able to be 
done on the fly. (Taking the mailservers down for a day won't go down 
well, even an hour raises howls).


Any suggestions?






Re: [Dovecot] problem migrating from maildir to dbox

2011-09-12 Thread Timo Sirainen
On Mon, 2011-09-12 at 13:52 +0200, Ramón Frontera wrote:
> >> After that we use dsync -u user mirror maildir:~/Maildir.
> >> The problem is that if INBOX exists the dsync create a new folder with 
> >> name like b5893c0a93ff694e55122dfa3112
> >> Can I migrate to the existing INBOX? or How can I merge the 2 INBOX 
> >> folders?

Have you created the dbox directory before running dsync? And opened it
with some tool? I tried with your config and it worked fine.

The reason why these duplicate INBOXes happen is when INBOX exists both
in source and in destination when dsync is run. Typically this means
that you've created the destination INBOX already by e.g. logging in or
delivering a mail there or something..




Re: [Dovecot] MySQL, map files

2011-09-12 Thread Timo Sirainen
On Thu, 2011-09-08 at 16:52 -0700, Steve Fatula wrote:
> I'll try and break up my questions the other day about extdata that
> went unanswered into pieces in the hopes it will be more specific and
> clear.
> 
> In general, I am trying to figure out the syntax of the map statement
> and what is allowed in that statement. So, by map statement, I mean
> for example perhaps the dovecot-dict-expire.conf.ext file as shown in
> the doc. Is the syntax the same for the various types of files (quota
> vs expire)? Is there syntax to allow the specification of a different
> key? If so, where is this documented. I have an existing table I want
> to use, not the table shown in the doc.

They aren't really documented anywhere. Also I'm kind of hoping one day
to replace the files anyway with a new syntax that allows mixed
configuration of sql/file/other backends.

The dict configuration itself is anyway generic and works basically the
same for expire/quota/others, except they use different keys (=different
patterns when matching).

I'm not sure if there is any useful way to even explain how it works
now. There is the example SQL configuration for expire and quota.
Somewhere in wiki is example flat file config for them. There's really
not much else you can do with them.

> The reason I am asking is I have seen web pages that reference all
> sorts of statements within the map statement, and I have no idea where
> they are documented. Specifically, I see an example here (which is
> LDAP), look in section 3:
> 
> http://dovecot.org/patches/1.2/ldap/HOWTO_dictldap+extdata.txt
> 
> 
> You will see lots of statements, not sure which ones can be used for
> MySQL (instead of LDAP). 

That patch's mapping references to Pigeonhole's extdata plugin. If you
install that plugin you can use SQL or flat file for the same maps.

> So, would like to find a list of ALL valid syntax within the map.

Plugins can always add more maps.



Re: [Dovecot] problem migrating from maildir to dbox

2011-09-12 Thread Ramón Frontera
hello,
thanks in advance!
Regards,

$ dovecot -n
# 2.0.13: /etc/dovecot/dovecot.conf
# OS: Linux 2.6.32-131.6.1.el6.x86_64 x86_64 Red Hat Enterprise Linux Server 
release 6.1 (Santiago) nfs
base_dir = /var/run/dovecot/
first_valid_uid = 96
listen = 10.80.82.21
log_path = /var/log/dovecot.log
mail_gid = 97
mail_location = sdbox:/vmail/0/%u/dbox
mail_plugins = acl quota mail_log notify
mail_uid = 97
managesieve_notify_capability = mailto
managesieve_sieve_capability = fileinto reject envelope encoded-character 
vacation subaddress comparator-i;ascii-numeric relational regex imap4flags copy 
include variables body enotify environment mailbox date
mbox_write_locks = fcntl
mmap_disable = yes
namespace {
  hidden = no
  inbox = yes
  list = yes
  location = 
  prefix = 
  separator = /
  subscriptions = yes
  type = private
}
namespace {
  hidden = no
  inbox = no
  list = children
  location = maildir:%%h/Maildir:INDEX=~/Maildir/shared/%%n
  prefix = shared/%%n/
  separator = /
  subscriptions = no
  type = shared
}
passdb {
  driver = pam
}
passdb {
  args = /etc/dovecot/dovecot-ldap-pass.conf.ext.local
  driver = ldap
}
passdb {
  args = scheme=plain username_format=%u /etc/dovecot/imap.passwd
  driver = passwd-file
}
plugin {
  acl = vfile
  acl_shared_dict = file:/vmail/1/dovecot/shared-mailboxes
  quota = maildir:User quota
  quota_rule = *:storage=2500M
  quota_rule2 = Trash:storage=+500M
  quota_warning = storage=95%% quota-warning 95 %u
  quota_warning2 = storage=80%% quota-warning 80 %u
}
postmaster_address = xavier.p...@uib.es
protocols = imap pop3 lmtp sieve
service auth {
  unix_listener auth-userdb {
group = vmail
mode = 0660
  }
}
service imap-login {
  inet_listener imap {
port = 143
  }
  inet_listener imaps {
port = 993
ssl = yes
  }
}
service lmtp {
  inet_listener lmtp {
port = 30025
  }
}
service pop3-login {
  inet_listener pop3 {
port = 110
  }
  inet_listener pop3s {
port = 995
ssl = yes
  }
}
service quota-warning {
  executable = script /usr/local/bin/quota-warning.sh
  unix_listener quota-warning {
user = vmail
  }
  user = dovecot
}
ssl = required
ssl_cert =  On Fri, 2011-09-09 at 14:19 +0200, Ramón Frontera wrote:
>> Hello,
>> we want to migrate Mail folders from Maildir to dbox without downtime.
>> We change the mail_location to dbox in 10-mail.conf and restart dovecot.
>> After that we use dsync -u user mirror maildir:~/Maildir.
>> The problem is that if INBOX exists the dsync create a new folder with name 
>> like b5893c0a93ff694e55122dfa3112
>> Can I migrate to the existing INBOX? or How can I merge the 2 INBOX folders?
> 
> dovecot -n output?
> 
> 



Re: [Dovecot] multiple "imapc namespaces" Re: 2.1: imapc LIST problem / usage question

2011-09-12 Thread Timo Sirainen
On Mon, 2011-09-12 at 13:20 +0200, Lutz Preßler wrote:
> > I think you should be able to return e.g. "namespace=ns1 ns2" and then
> > return namespaces for namespace/ns1/* and namespace/ns2/*.
> Now _I_ don't really understand ;-). This is necessary, yes, but how
> do I set different remote parameters (imapc_host, imapc_user, ...)
> for each one?

Oh, yeah, didn't think about that :) I was considering making those
settings per-namespace though.. Then you could change
namespace/ns1/imapc_* settings. I guess most mail-related settings could
be made per-namespace. I'll see if I can manage to do it easily. :)




Re: [Dovecot] signal 11 crash, sometimes, during mbox bz2 decompression

2011-09-12 Thread Timo Sirainen
On Mon, 2011-09-12 at 02:55 -0600, Mike Brown wrote:

> On this system, I have the same setup with bz2-compressed mbox files. 
> They're still inaccessible from Thunderbird, but dovecot isn't crashing 
> with signal 11 anymore. Instead, the maillog says this for every 
> compressed box it tries to check:
> 
> Sep 12 02:37:14 chilled dovecot: imap(mike): Error: 
> read(/home/mike/mail/old/sent-1999-07.bz2) failed: Invalid argument (uid=2)
> Sep 12 02:37:14 chilled dovecot: imap(mike): Disconnected: Internal 
> error occurred. Refer to server log for more information. [2011-09-12 
> 02:37:14] bytes=5492/2664368
> Sep 12 02:37:14 chilled dovecot: imap(mike): Error: Next message 
> unexpectedly lost from mbox file /home/mike/mail/old/sent-1999-07.bz2 at 
> 536 (cached)

Oh, wonder why no one else has complained about that. Fixed:
http://hg.dovecot.org/dovecot-2.0/rev/a930318a74a1





[Dovecot] multiple "imapc namespaces" Re: 2.1: imapc LIST problem / usage question

2011-09-12 Thread Lutz Preßler
On Mo, 12 Sep 2011, Timo Sirainen wrote:

> On Fri, 2011-09-09 at 12:21 +0200, Lutz Preßler wrote:
> 
> > > > Second question: Is there a way to include multiple imapc instances/
> > > > namespaces with e.g. different destinations servers? I don't see how
> > > > because imapc_* parameters seem to be global (now), but it would be a 
> > > > very
> > > > useful feature.
> > > 
> > > I don't really understand. You're already returning per-user imapc
> > > namespace from userdb. What's missing?
> > One local dovecot user, multiple remote IMAP servers included in different
> > namespaces.
> 
> I think you should be able to return e.g. "namespace=ns1 ns2" and then
> return namespaces for namespace/ns1/* and namespace/ns2/*.
Now _I_ don't really understand ;-). This is necessary, yes, but how
do I set different remote parameters (imapc_host, imapc_user, ...)
for each one?

Lutz


Re: [Dovecot] dovecot 2.0.12: mdbox & quota=dirsize

2011-09-12 Thread Timo Sirainen
On Fri, 2011-09-09 at 15:24 +0400, Роман Захров wrote:
> #doveconf -v
> ..
>   quota = dirsize:User quota
>   quota_debug = yes

There's no such setting as quota_debug.

> then i change ./dovecot-2.0.12/src/plugins/quota/quota-dirsize.c
> 165--   path = 
> mailbox_list_get_path(namespaces[i]->list, NULL,
> 166-- 
> MAILBOX_LIST_PATH_TYPE_MAILBOX);
> 165++ path = 
> mailbox_list_get_path(namespaces[i]->list, NULL, 
> 166++  
> MAILBOX_LIST_PATH_TYPE_DIR);

Well.. Hmm. I suppose that's ok. Done:
http://hg.dovecot.org/dovecot-2.0/rev/9ea79795088d
(Looks like hg web doesn't like UTF-8 in your name.)




[Dovecot] Dsync and hidden files

2011-09-12 Thread Dick Middleton
Hi,

I'm in the process of changing from Dovecot v1 to v2 and changing to 
mdbox in
the process.  I've come across a little problem which I was hoping there would
be a workaround for.

There are sieve config files in the home directories which are hidden files.
Dsync croaks when it finds one of these because they are not mbox format.

It would be nice if they were ignored (or copied unchanged).  Is there another
way to deal with them other than by deleting thm?

Dick


Re: [Dovecot] problem migrating from maildir to dbox

2011-09-12 Thread Timo Sirainen
On Fri, 2011-09-09 at 14:19 +0200, Ramón Frontera wrote:
> Hello,
> we want to migrate Mail folders from Maildir to dbox without downtime.
> We change the mail_location to dbox in 10-mail.conf and restart dovecot.
> After that we use dsync -u user mirror maildir:~/Maildir.
> The problem is that if INBOX exists the dsync create a new folder with name 
> like b5893c0a93ff694e55122dfa3112
> Can I migrate to the existing INBOX? or How can I merge the 2 INBOX folders?

dovecot -n output?




Re: [Dovecot] quota percents

2011-09-12 Thread Timo Sirainen
On Fri, 2011-09-09 at 16:05 -0400, Micah Anderson wrote:
> I've noticed that http://wiki2.dovecot.org/Quota/Configuration is out of
> date, it says:
> 
> plugin {
>   quota = maildir:User quota
>   quota_rule = *:storage=1GB
>   # 10% of 1GB = 100MB
>   quota_rule2 = Trash:storage=10%%
>   # 20% of 1GB = 200MB
>   quota_rule3 = Spam:storage=20%%
> }
> 
> but if you use the '10%%' notation, dovecot complains, and *also* incorrectly:
> 
> dovecot: imap(t...@example.net): Warning: quota root mail quota rule 
> Trash:bytes=10%: obsolete configuration for rule 'bytes=10%' should be 
> changed to 'bytes=+10%'

Right, fixed in wiki. Although this was only a warning, so it still
worked.

> its incorrect because if you change it to what it suggests ('+10%') it
> wont work because that wont be 10% more, rather, it is set to bytes=+10:

Well, that's a more complex problem. The %% escaping needs to be done in
dovecot.conf, but it doesn't need to be done elsewhere. If this said
that "use +10%%" and someone gives that in SQL user_query, it will
break. So I'm not changing the warning.

> However, it doesn't seem to work in practice, because I have a user that
> is at 99% of quota, with nothing in the Trash who cannot move a 77KB
> message into the Trash without getting the quota_exceeded message and
> refusing to move it.

dovecot -n output?



Re: [Dovecot] How to get rid of sub-folders ?

2011-09-12 Thread Timo Sirainen
On Fri, 2011-09-09 at 16:22 +0100, Spyros Tsiolis wrote:

> OK, no answers on my previous e-mail. I'll rephrase it.
> How can I get rid of subfolders on a users' tree-like structure on dovecot ?
> Which file must I "touch" ?

This still isn't very understandable. You can delete subfolders with
either IMAP client (= IMAP DELETE command) or simply rm -rf in the
filesystem.

Or do you mean moving the subfolders to be root level folders? Again
IMAP client should be able to do this, or in filesystem level (assuming
Maildir++) you'd do something like:
mv ~/Maildir/.root.subfolder ~/Maildir/.subfolder




Re: [Dovecot] Mails repopping

2011-09-12 Thread Timo Sirainen
On Fri, 2011-09-09 at 13:07 -0400, Simon Brereton wrote:

> I have a server that's been running Courier for about 6 years and in
> all that time I think I've only ever had 1 issues where an entire mail
> box was repopped by a webmail client.  However, since moving to a new
> server and dovecot 4 weeks ago, I've now had the webmail client repop
> this account 4 times (there are about 230 mails in the account).  
> 
> Is there a setting I need to tighten to prevent/remedy this?  I have
> no idea if it's happening on other accounts, but this is one that I
> see.  The format is maildir.  There has been no changes to the webmail
> client.

dovecot -n output would have been nice. Also do you see anything in
error logs?

If you're using the default pop3_uidl_format it'll rely on IMAP UIDs to
stay the same, and I guess it's possible that due to some other problem
they change (that should be logged as an error/warning though).

You could try setting pop3_uidl_format=%f, but it will cause everyone to
redownload mails. With newer Dovecot versions you could set
pop3_save_uidl=yes and when you think everyone's downloaded mails once
you can safely change the pop3_uidl_format.





Re: [Dovecot] userdb static & Quota from LDAP?

2011-09-12 Thread Timo Sirainen
On Fri, 2011-09-09 at 23:58 +0200, Christian Schmidt wrote:
> userdb {
>   driver = static
>   args = uid=vmail gid=vmail home=/var/maildir/%u
> }

These can be replaced with global settings:

mail_uid = vmail
mail_gid = vmail
mail_home = /var/maildir/%u

> Now I'd like to add per-user quotas that will also be stored in the
> LDAP directory, and I'm not sure how to put things together.
> IMHO quota is the only "userdb information" requested from LDAP, and
> I'd like to leave all the other "userdb pieces" as the are. I changed
> the userdb definition to:
> userdb {
>   driver = ldap
>   args = /etc/dovecot/conf.d/ldap-userdb.ext
> }
> 
> My /etc/dovecot/conf.d/ldap-userdb.ext contains (along other lines):
> 
> user_attrs = 
> uid=vmail,gid=vmail,home=/var/maildir/%u,mailQuota=quota=quota_rule=*:storage=%$

Just set those global settings and drop uid/gid/home from here. Or you
could get them working here too, but the syntax is slightly wrong:

user_attrs = =uid=vmail, =gid=vmail, ..

(With the above settings you're telling Dovecot that LDAP "uid" field
will be assigned to Dovecot's "vmail" field, and the "gid" field
immediately overrides it, and LDAP "home" field's value is set to
Dovecot's "/var/maildir/%u" field.)



Re: [Dovecot] Read-only mbox files

2011-09-12 Thread Timo Sirainen
On Fri, 2011-09-09 at 20:44 +0100, Tim Bishop wrote:

> The setup is that my main namespace points at my Maildir mail folders.
> In addition to this I have a second namespace that points at some old
> archived mbox folders. I rarely need to access these folders, but when I
> do Dovecot modifies the files (adding UID headers, etc).
> 
> What I'd like to do is make it so that Dovecot can't change these files.
> I thought there might be a setting to mark a mail_location as read-only,
> but I can't find anything like that. I've looked at ACLs too, but they
> seem to be more about user access that what Dovecot can do to files.

Not possible without modifying Dovecot code, and seems like such a
rarely wanted feature that it's not really worth the trouble, especially
because..:

> I could just do this at the filesystem level, but I'd feel a bit happier
> about working with Dovecot rather than trying to work around it.

Yeah, just chmod a-w them and that'll work. You don't want anything
modifying them anyway, right? So seems like a pretty clean solution to
me.




Re: [Dovecot] setacl on complete mailbox

2011-09-12 Thread Timo Sirainen
On Sun, 2011-09-11 at 18:40 +0200, Tobias Hachmer wrote:
> Hi List,
> 
> how can I grant a user full control on another mailbox (the complete 
> mailbox with all folder and subfolders).
> With the setacl command I could do this but first I have to list all 
> folders and then I have to do one setacl command for each folder.
> 
> Is there a command to this in one line? 

Not currently. I guess doveadm acl commands could be modified to support
wildcards quite easily.

> Also for new created folders?

Newly created folders' ACLs are copied from their parent at the create
time.




Re: [Dovecot] NO Unknown subscription namespace.

2011-09-12 Thread Timo Sirainen
On Mon, 2011-09-12 at 09:14 +0100, mailing lists wrote:
> Hello,
> 
> what this message means?
> 
> "NO Unknown subscription namespace."

It means that the namespace itself has subscriptions=no, and there are
no "parent namespaces" with subscriptions=yes.

> namespace {
>   inbox = yes
>   location = 
>   prefix = INBOX.
>   separator = .
>   subscriptions = yes
> }
> namespace {
>   list = yes
>   location = maildir:/var/virtual-maildir/%%n
>   prefix = shared.%%n.
>   separator = .
>   subscriptions = no
>   type = shared
> }

I guess you'd want INBOX. namespace to handle the subscriptions here,
but it doesn't work like that because in some configuration it could be
ambiguous which namespace to use.. You'll need to create a prefix=""
namespace to handle the subscriptions. For example:

namespace {
  prefix =
  list = no
  hidden = yes
}



Re: [Dovecot] Problem with configuring dovecot to take namespaces from database

2011-09-12 Thread Timo Sirainen
On Fri, 2011-09-09 at 13:24 +0200, Marcin Mirosław wrote:
> Ok, maybe could it be possible to do it in other way:
> 
> |user_id | namespace_full_definition   |
> 
> | 7684   | /name=test1/prefix=test1./location=mdbox:~/test1/.mdbox/
>name=test2/prefix=test2/location=... | 
> 
> 
> but this isn't supported by dovecot as i know.

Not exactly like that, but you should be able to have a field called
"userdb_import" that contains data like:

namespace=n1 n2namespace/n1/prefix=blah.etc. other fields

The s would of course have to be actual tab characters.




Re: [Dovecot] 2.1: imapc LIST problem / usage question

2011-09-12 Thread Timo Sirainen
On Fri, 2011-09-09 at 12:21 +0200, Lutz Preßler wrote:

> > > Second question: Is there a way to include multiple imapc instances/
> > > namespaces with e.g. different destinations servers? I don't see how
> > > because imapc_* parameters seem to be global (now), but it would be a very
> > > useful feature.
> > 
> > I don't really understand. You're already returning per-user imapc
> > namespace from userdb. What's missing?
> One local dovecot user, multiple remote IMAP servers included in different
> namespaces.

I think you should be able to return e.g. "namespace=ns1 ns2" and then
return namespaces for namespace/ns1/* and namespace/ns2/*.




Re: [Dovecot] 2.1: imapc SUBSCRIBE problem

2011-09-12 Thread Timo Sirainen
On Sun, 2011-09-11 at 21:50 +0200, Lutz Preßler wrote:
> On Fri, 09 Sep 2011, Lutz Preßler wrote:
> > LIST is now working correctly in my setup, but SUBSCRIBE ist not.
> > With subscriptions=no, as written (but same behaviour with 
> > subscriptions=yes),
> > SUBSCRIBE INBOX.gmail.INBOX (or others) yields
> > 0 NO [SERVERBUG] Internal error occurred. Refer to server log for more 
> > information. [2011-09-09 16:39:40]
> > logging (with mail_debug=yes) only
> > Sep  9 16:39:40 host dovecot: imap(1143, user): Error: stat((null)) failed: 
> > Bad address
> After putting (with subscriptions=no) an entry manually into the root
> subscriptions file, everything including UNSUBSCRIBE works fine.

Yeah, but then remote subscriptions don't work. I think the imapc
subscription problems and namespace prefix problems are now fixed in hg.




Re: [Dovecot] signal 11 crash, sometimes, during mbox bz2 decompression

2011-09-12 Thread Mike Brown

On 8/23/2011 11:47 AM, Timo Sirainen wrote:

On Tue, 2011-08-16 at 05:00 -0600, Mike Brown wrote:


I'm running dovecot 1.2.16 from the ports collection on FreeBSD 8.1-STABLE,
amd64.

..


Thanks for the reply. Since you recommended updating to dovecot2, I'm 
now testing dovecot 2.0.14 from the ports collection on a different 
machine. Hopefully I got the configuration right.


# dovecot -n
# 2.0.14: /usr/local/etc/dovecot/dovecot.conf
# OS: FreeBSD 8.2-RELEASE-p2 i386
mail_location = mbox:~/mail:INBOX=/var/mail/%u
mail_plugins = " zlib"
passdb {
  args = %s
  driver = pam
}
plugin {
  zlib_save = bz2
  zlib_save_level = 9
}
protocols = imap
ssl_cert = On this system, I have the same setup with bz2-compressed mbox files. 
They're still inaccessible from Thunderbird, but dovecot isn't crashing 
with signal 11 anymore. Instead, the maillog says this for every 
compressed box it tries to check:


Sep 12 02:37:14 chilled dovecot: imap(mike): Error: 
read(/home/mike/mail/old/sent-1999-07.bz2) failed: Invalid argument (uid=2)
Sep 12 02:37:14 chilled dovecot: imap(mike): Disconnected: Internal 
error occurred. Refer to server log for more information. [2011-09-12 
02:37:14] bytes=5492/2664368
Sep 12 02:37:14 chilled dovecot: imap(mike): Error: Next message 
unexpectedly lost from mbox file /home/mike/mail/old/sent-1999-07.bz2 at 
536 (cached)


Did I misconfigure something?


[Dovecot] NO Unknown subscription namespace.

2011-09-12 Thread mailing lists
Hello,

what this message means?

"NO Unknown subscription namespace."

the shared namespace is visible and I can fetch messages from it, but 
subscription fails with the above message.

(user002 is sharing the folder named docs-users002 with user user001)


# telnet localhost 143
Trying ::1...
Connected to localhost.
Escape character is '^]'.
* OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE 
AUTH=PLAIN] Dovecot ready.
. login user001 secret
. OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE SORT 
SORT=DISPLAY THREAD=REFERENCES THREAD=REFS MULTIAPPEND UNSELECT CHILDREN 
NAMESPACE UIDPLUS LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH ESORT 
SEARCHRES WITHIN CONTEXT=SEARCH LIST-STATUS ACL RIGHTS=texk] Logged in
. list "shared." "*"
* LIST (\Noselect \HasChildren) "." "shared.user002"
. OK List completed.
. list "shared.user002." "*"
* LIST (\HasNoChildren) "." "shared.user002.docs-user002"
. OK List completed.
. list "shared.user002.docs-user002." "*"
. OK List completed.
. select "shared.user002.docs-user002"
* FLAGS (\Answered \Flagged \Deleted \Seen \Draft)
* OK [PERMANENTFLAGS (\Answered \Flagged \Deleted \Seen \Draft)] Flags 
permitted.
* 2 EXISTS
* 0 RECENT
* OK [UIDVALIDITY 1315765265] UIDs valid
* OK [UIDNEXT 3] Predicted next UID
* OK [HIGHESTMODSEQ 3] Highest
. OK [READ-WRITE] Select completed.
. fetch 1 all
* 1 FETCH (FLAGS (\Seen) INTERNALDATE "24-Nov-2009 11:58:34 +0100" RFC822.SIZE 
3734 ENVELOPE ("Tue, 24 Nov 2009 07:58:34 -0400 (AST)" "Thank you for 
registering for the Red Hat Virtual Experience" 
(("supp...@virtualevents365.com" NIL "support" "virtualevents365.com")) 
(("supp...@virtualevents365.com" NIL "support" "virtualevents365.com")) 
(("supp...@virtualevents365.com" NIL "support" "virtualevents365.com")) 
(("damocl...@hotmail.com" NIL "damocles-" "hotmail.com")) NIL NIL NIL 
"<6955854.2731259063914762.javamail.r...@app130.vs.int.cgsinc.ca>"))
. OK Fetch completed.
. subscribe "shared.user002.docs-user002"
. NO Unknown subscription namespace.
. logout
* BYE Logging out
. OK Logout completed.
Connection closed by foreign host.

 //

namespace {
  inbox = yes
  location = 
  prefix = INBOX.
  separator = .
  subscriptions = yes
}
namespace {
  list = yes
  location = maildir:/var/virtual-maildir/%%n
  prefix = shared.%%n.
  separator = .
  subscriptions = no
  type = shared
}