Re: [Dovecot] How about a "pipe" plugin?

2007-05-25 Thread Johannes Berg
On Thu, 2007-05-24 at 23:22 +0200, Marc Delling wrote:
> The spam learning would be fine with your plugin  
> but is there a way to trigger ham learning when a mail is added to  
> any other mail folder than spam?

He said that after the message was piped away it's still copied to the
destination folder. Hence, you'd only need to run the pipe plugin on all
available folders. Should probably be doable. Though I don't see the
point much then vs. modifying my plugin which actually gives feedback
when something goes wrong (though of course I don't know if the pipe
plugin also does)

johannes


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


Re: [Dovecot] Will pay $500 towards a Dovecot feature

2007-05-25 Thread Johannes Berg
On Thu, 2007-05-24 at 14:53 -0500, Eric Rostetter wrote:

> I learned the last time this came up that people who can't understand
> why overloading IMAP with other protocols is bad also can't understand
> how ssh authentication works or what the difference is between a
> protocol and an application.

Hm. I guess so. I haven't followed most threads in depth, just threw in
a comment here and there...

> The fact is, 99% of the people who want to add additional protocols to
> the IMAP protocol just don't care about any alternatives.  They want
> to overload the IMAP protocol and they won't consider any other options.

Which is sad since other protocols can give them so much more
flexibility with so much less headwind.

> Trying to explain to them that ssh authentication can handle virtual
> users is just going to result in being flamed as ignorant.  I say this
> from experience on this list.

Well, here's to hoping that this misfeature will never make it into
anything I end up supporting. Nightmare.

johannes


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


Re: [Dovecot] How about a "pipe" plugin?

2007-05-25 Thread Marc Delling

25.05.2007 11:52 Johannes Berg:


He said that after the message was piped away it's still copied to the
destination folder. Hence, you'd only need to run the pipe plugin  
on all

available folders. Should probably be doable.


Yes, but as I understand it there is not easy way to manage that. The  
plugin cannot be configured like:


pipe 1: all mail added to folders named spam
pipe 2: all mail added to folders not named spam

so you have to create a pipe for each folder where all except one do  
the same thing. And you would have restrict users capability to  
create new folders, otherwise you would have to edit the plugins  
config everytime a user decides to have a new one. Regex-matching on  
foldernames would do the trick. Or a pipe triggered on copy-and-delete.


Marc

Re: [Dovecot] How about a "pipe" plugin?

2007-05-25 Thread Johannes Berg
On Fri, 2007-05-25 at 13:45 +0200, Marc Delling wrote:

> Yes, but as I understand it there is not easy way to manage that. The  
> plugin cannot be configured like:

Oh, true, but I'm sure once the code shows up you could easily modify
the plugin for that.

johannes


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


Re: [Dovecot] Dovecot crashes with malformed Qpopper's mbox

2007-05-25 Thread MAEDA, Go

Timo Sirainen wrote:

 - Instead of requiring "\n[\r]From ", require "\n[\r]\n[\r]From "
 - in mbox-save.c make sure that the extra empty line is always added 
(I'm not sure if this already is done, I think it isn't)
 - preferrably also fix broken mboxes in mbox-sync.c and mbox-save.c: If 
you notice that it doesn't end with two linefeeds, add one or two so it 
does


  At first, I have modified istream-raw-mbox.c and now my Dovecot stops 
mistaking the secound "From " line for a message separator.


  But RETRed message contains unnecessary (may be harmful for some pop3 
clients) "From " line.



+OK Dovecot ready.
user 
+OK
pass 
+OK Logged in.
top 1 0
+OK
X-UIDL: i[f"!$h*!!S67!!/RW!!
From [EMAIL PROTECTED]  Sat Feb 17 19:27:47 2007
Return-Path: <[EMAIL PROTECTED]>
:
:
:


  I have thought that save_header_callback() in mbox-save.c should drop 
the "From " line but it still left in the message.


  Timo, please give me more advice. What should I do to workaround this?

--
// --
// MAEDA, Go <[EMAIL PROTECTED]>
*** dovecot-1.0.0/src/lib-storage/index/mbox/istream-raw-mbox.c 2007-03-14 
00:32:37.0 +0900
--- dovecot-1.0.0-fix/src/lib-storage/index/mbox/istream-raw-mbox.c 
2007-05-25 20:23:07.0 +0900
***
*** 243,255 
i++;
from_after_pos = i;
from_start_pos = i - 6;
!   if (from_start_pos > 0 &&
!   buf[from_start_pos-1] == '\r') {
!   /* CR also belongs to it. */
!   crlf_ending = TRUE;
from_start_pos--;
!   } else {
crlf_ending = FALSE;
}
}
fromp = mbox_from;
--- 243,260 
i++;
from_after_pos = i;
from_start_pos = i - 6;
! 
!   if (from_start_pos > 2 && 
!   memcmp(buf + from_start_pos - 3,
! "\r\n\r", 3) == 0) {
from_start_pos--;
!   crlf_ending = TRUE;
!   } else if (from_start_pos > 0 &&
!   buf[from_start_pos - 1] == '\n') {
crlf_ending = FALSE;
+   } else {
+   from_start_pos = (size_t)-1;
+   from_after_pos = (size_t)-1;
}
}
fromp = mbox_from;


[Dovecot] Variable expansion in LDA vs POP/IMAP

2007-05-25 Thread Stephane Enten
Hello all,

I'm trying to understand when exactly the variable substitution
happens in Dovecot, as I get different results in the LDA and in the POP/IMAP 
server.

Here's my general setup:
 - Postfix MTA, delivers mail via Dovecot LDA
 - users list sits in a database 
 - mail directory is stored in the database, but with
   Dovecot variables inside

Delivery works perfectly fine, Dovecot's deliver get a "mail"
column from the database (that looks like this: 
/mail/01/%2LMd/%2.2LMd/%LMd/mail/%Ln/ ) and expands variables,
delivers the mail into the maildir's location.

Now if I try to access the mailbox through Dovecot's POP/IMAP server,
it looks like it gets the right field from the database, but won't expand
the variables:

May 24 18:31:14 mail1 dovecot: imap-login: Login: user=, method=PLAIN, 
rip=127.0.0.1, lip=127.0.0.1, secured
May 24 18:31:14 mail1 dovecot: IMAP(X): Effective uid=1021, gid=304, home=
May 24 18:31:14 mail1 dovecot: IMAP(X): maildir: 
data=/mail/01/%2LMd/%2.2LMd/%LMd/mail/%Ln/
May 24 18:31:14 mail1 dovecot: IMAP(X): maildir: 
root=/mail/01/%2LMd/%2.2LMd/%LMd/mail/%Ln, index=/srv/mail/01/%2LMd
/%2.2LMd/%LMd/mail/%Ln, control=, inbox=
May 24 18:31:14 wmail1-v dovecot: IMAP(X): Disconnected

Am I missing something to get the pop/imap part expand those ?

-- 
Stephane Enten
# /etc/dovecot/dovecot.conf
log_timestamp: %Y-%m-%d %H:%M:%S
protocols: pop3 pop3s imap imaps
disable_plaintext_auth: no
shutdown_clients: 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
login_process_per_connection: no
login_processes_count: 5
verbose_proctitle: yes
first_valid_uid: 1000
mail_debug: yes
maildir_copy_with_hardlinks: yes
mail_executable(default): /usr/lib/dovecot/imap
mail_executable(imap): /usr/lib/dovecot/imap
mail_executable(pop3): /usr/lib/dovecot/pop3
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
pop3_uidl_format(default):
pop3_uidl_format(imap):
pop3_uidl_format(pop3): %08Xu%08Xv
pop3_client_workarounds(default):
pop3_client_workarounds(imap):
pop3_client_workarounds(pop3): outlook-no-nuls oe-ns-eoh
auth default:
  verbose: yes
  passdb:
driver: sql
args: /etc/dovecot/dovecot-sql.conf
  userdb:
driver: sql
args: /etc/dovecot/dovecot-sql.conf
  socket:
type: listen
client:
master:
  path: /var/run/dovecot/auth-master
  mode: 384
  user: dovecot
  group: dovecot



Re: [Dovecot] Variable expansion in LDA vs POP/IMAP

2007-05-25 Thread Jason Godsey

Stephane Enten wrote:

Hello all,

I'm trying to understand when exactly the variable substitution
happens in Dovecot, as I get different results in the LDA and in the POP/IMAP 
server.


Here's my general setup:
 - Postfix MTA, delivers mail via Dovecot LDA
 - users list sits in a database 
 - mail directory is stored in the database, but with

   Dovecot variables inside

Delivery works perfectly fine, Dovecot's deliver get a "mail"
column from the database (that looks like this: 
/mail/01/%2LMd/%2.2LMd/%LMd/mail/%Ln/ ) and expands variables,

delivers the mail into the maildir's location.

Now if I try to access the mailbox through Dovecot's POP/IMAP server,
it looks like it gets the right field from the database, but won't expand
the variables:

May 24 18:31:14 mail1 dovecot: imap-login: Login: user=, method=PLAIN, 
rip=127.0.0.1, lip=127.0.0.1, secured
May 24 18:31:14 mail1 dovecot: IMAP(X): Effective uid=1021, gid=304, home=
May 24 18:31:14 mail1 dovecot: IMAP(X): maildir: 
data=/mail/01/%2LMd/%2.2LMd/%LMd/mail/%Ln/
May 24 18:31:14 mail1 dovecot: IMAP(X): maildir: 
root=/mail/01/%2LMd/%2.2LMd/%LMd/mail/%Ln, index=/srv/mail/01/%2LMd
/%2.2LMd/%LMd/mail/%Ln, control=, inbox=
May 24 18:31:14 wmail1-v dovecot: IMAP(X): Disconnected

Am I missing something to get the pop/imap part expand those ?

  



# /etc/dovecot/dovecot.conf
log_timestamp: %Y-%m-%d %H:%M:%S
protocols: pop3 pop3s imap imaps
disable_plaintext_auth: no
shutdown_clients: 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
login_process_per_connection: no
login_processes_count: 5
verbose_proctitle: yes
first_valid_uid: 1000
mail_debug: yes
maildir_copy_with_hardlinks: yes
mail_executable(default): /usr/lib/dovecot/imap
mail_executable(imap): /usr/lib/dovecot/imap
mail_executable(pop3): /usr/lib/dovecot/pop3
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
pop3_uidl_format(default):
pop3_uidl_format(imap):
pop3_uidl_format(pop3): %08Xu%08Xv
pop3_client_workarounds(default):
pop3_client_workarounds(imap):
pop3_client_workarounds(pop3): outlook-no-nuls oe-ns-eoh
auth default:
  verbose: yes
  passdb:
driver: sql
args: /etc/dovecot/dovecot-sql.conf
  userdb:
driver: sql
args: /etc/dovecot/dovecot-sql.conf
  socket:
type: listen
client:
master:
  path: /var/run/dovecot/auth-master
  mode: 384
  user: dovecot
  group: dovecot

  
Expansion happens before the query, you didn't include dovecot-sql.conf 
so I'm not sure where it's going wrong.


you should NOT be doing select 
concat('/mail/01/%2LMd/%2.2LMd/%LMd/mail/%Ln') as maildir


Those expansions work as:

mail_location = /mail/01/%2LMd/%2.2LMd/%LMd/mail/%Ln





[Dovecot] locking question

2007-05-25 Thread Paul Amaral
Hi, I'm using Maildir with dovecot .99, I'm getting some errors with fcntl
locks. Do I still need to use a locking mechanism if I'm using maildir with
pop3 access.

For reasons I won't go into I cant upgrade from .99 to version one at the
time.

I'm getting this error with some users, I have tried to manually delete the
.imap.index file but the error comes back, any thoughts?

May 24 12:11:21 pop imap(generalg): Timeout while waiting for release of
exclusive fcntl() lock for index file /home/g/generalg/Ma
ildir/.INBOX/.imap.index



TIA, Paul



[Dovecot] Quick question on multiple access to dovecot indexes

2007-05-25 Thread Adam McDougall
I have up to 4 servers that will run dovecot behind a load balancer, which means
the same user might be accessing the same mailbox from multiple servers, and it 
seems like dovecot doesn't like multiple access to the dovecot indexes for the 
one user since I currently have them stored in a nfs home directory.  Is this
a bad thing?  Must I keep a seperate index location per server? 

Just today I started running dovecot on more than one server like this and 
started
seeing things in the logs like:

May 25 11:19:13 boomhauer dovecot: IMAP(mcdouga9): Corrupted transaction log 
file 
/home/mcdouga9/Maildir/dovecot/public/indexes/decs/.support.In/dovecot.index.log:
 end_offset (1332) > current 
sync_offset (1244)
May 25 11:19:13 boomhauer dovecot: IMAP(mcdouga9): broken sync positions in 
index file 
/home/mcdouga9/Maildir/dovecot/public/indexes/decs/.support.In/dovecot.index
May 25 11:19:13 boomhauer dovecot: IMAP(mcdouga9): fscking index file 
/home/mcdouga9/Maildir/dovecot/public/indexes/decs/.support.In/dovecot.index
May 25 11:19:13 boomhauer dovecot: IMAP(mcdouga9): Fixed index file 
/home/mcdouga9/Maildir/dovecot/public/indexes/decs/.support.In/dovecot.index: 
log file sync pos 2,1332 -> 2, 1244
May 25 11:19:13 boomhauer dovecot: IMAP(mcdouga9): Unexpected transaction log 
desync with index 
/home/mcdouga9/Maildir/dovecot/public/indexes/decs/.support.In/dovecot.index
May 25 11:19:13 boomhauer dovecot: IMAP(mcdouga9): Disconnected: Mailbox is in 
inconsistent state, please relogin.


May 25 11:19:17 dauterive dovecot: IMAP(mcdouga9): file mail-index.c: line 983 
(mail_index_sync_from_transactions): 
assertion failed: (hdr.messages_count == (*map)->hdr.messages_count)
May 25 11:19:17 dauterive dovecot: child 16386 (imap) killed with signal 6
...
May 25 11:19:53 dauterive in.imapproxyd[17211]: LOGIN: '"mcdouga9"' 
(127.0.0.1:53650) on existing sd [9]
May 25 11:19:53 dauterive dovecot: IMAP(mcdouga9): Transaction log file 
/home/mcdouga9/Maildir/dovecot/public/indexes/decs/.support.In/dovecot.index.log:
 marked corrupted
May 25 11:19:53 dauterive dovecot: IMAP(mcdouga9): Transaction log file 
/home/mcdouga9/Maildir/dovecot/public/indexes/decs/.support.In/dovecot.index.log.2:
 marked corrupted



[Dovecot] Quota warning not generated

2007-05-25 Thread Doug Council
I am testing out the unofficial quota warning patch with Dovecot 1.0.0, 
and no matter what values I use for the storage or messages values, the 
warning script is never executed.


My plugin settings are:

plugin {
  quota = maildir:storage=20480
  quota_warning = storage=80%:messages=10 /usr/local/bin/quota-warning.sh
}

I've tried the following quota_warning lines without any luck:

quota_warning = storage=80% /usr/local/bin/quota-warning.sh
quota_warning = messages=10 /usr/local/bin/quota-warning.sh
quota_warning = storage=80%:messages=10 /usr/local/bin/quota-warning.sh

The quota-warning.sh script is set to 0755 and currently just syslogs a 
warning using logger(1).  Run independently of Dovecot, it works fine.


Here is a sample maildirsize file (if that is at all important) from when 
I tried the messages=10 setting:


10485760S
335322 12
14016 1
58058 1
46529 1
37623 1
55252 1
61901 1
53422 1
56228 1

There are more than 10 messages in the mailbox, but the quota-warning.sh 
script never gets executed.  When using storage=80%, the maildirsize file 
has the correct values (not included in this message), but it never 
executes the script as well.


Does anyone have any ideas?

Thanks,
-Doug


[Dovecot] question mailbox format

2007-05-25 Thread sc2

i set mail_location = mbox:/var/spool/mail/%u
and protocols = pop3s pop3
why he trys to create and use imap format?`

in log are
May 25 18:52:25 mail dovecot: pop3-login: Login: user=, 
method=PLAIN,

rip=80.xx.xx.xx, lip=xx.xx.24.29, TLS
May 25 18:52:26 mail dovecot: POP3(richard): 
open(/var/spool/mail/richard/inbo

x, O_CREAT) failed: Not a directory
May 25 18:52:26 mail dovecot: POP3(richard): 
mkdir_parents(/var/spool/mail/richard/.imap/INBOX) failed: Not a directory
May 25 18:52:26 mail dovecot: POP3(richard): stat() failed with mbox file 
/var/

spool/mail/richard/inbox: Not a directory
May 25 18:52:26 mail dovecot: POP3(richard): Couldn't init INBOX: Internal 
erro

r occurred. Refer to server log for more information. [2007-05-25 18:52:25]
May 25 18:52:26 mail dovecot: POP3(richard): Mailbox init failed top=0/0, 
retr=

0/0, del=0/0, size=0

friendly regards and thx



Re: [Dovecot] question mailbox format

2007-05-25 Thread Charles Marcus

[EMAIL PROTECTED] wrote:

i set mail_location = mbox:/var/spool/mail/%u
and protocols = pop3s pop3
why he trys to create and use imap format?`


Platform?
OS Version?
Dovecot version?
Dovecot -n output?

--

Best regards,

Charles


Re: [Dovecot] Converting mbox to Maildir, all prior read messages are downloaded as new

2007-05-25 Thread FiL

Timo Sirainen wrote:

On 24.5.2007, at 22.22, Eric and Barbara Sammons wrote:

I am running dovecot 0.99.  Everything works great; however, now I am 
looking at several different tools to convert mbox to Maildir.  It 
seems the tools, mb2md.pl, perfect_maildir.pl, and others all do what 
they claim; however, when the messages are converted and they are 
stored in Maildir/cur, the email clients download these messages as new.


I guess you're talking about POP3. You'd need to be able to preserve 
the POP3 UIDLs (see http://wiki.dovecot.org/Migration), which would 
require that you also preserve the IMAP UIDs in the mbox -> Maildir 
switch. Unfortunately I'm not aware of any scripts that preserves the 
UIDs, although it wouldn't be difficult to write support for that.



This is not only about POP3, as far as I can tell. If you converting
mbox to Maildir (dovecot to dovecot) - UIDs change. And if you have your
client set to cache all the messages and
you have over 1Gb in your mail... well, it will be transferring all your
mail again. Deleting the old one (as it is not on the server anymore)
and re-downloading new ones.
It would be nice to have Convert plugin, that preserves UIDs and
UIDVALIDITY values.

P.S. A little unrelated question about convert plugin.

I have all my mbox-es in /raid/mbox/%u
I have set convert_mail = mbox:/raid/mbox/%u:INBOX=/var/mail/%u in the
dovecot.conf.
But for some reason the folder with mail doesn't get renamed after
conversion. Is that the way it should be?

Of course, it tries to convert the same boxes next time I log in.

FiL





Re: [Dovecot] Converting mbox to Maildir, all prior read messages are downloaded as new

2007-05-25 Thread FiL @ Kpoxa

Timo Sirainen wrote:

On 24.5.2007, at 22.22, Eric and Barbara Sammons wrote:

I am running dovecot 0.99.  Everything works great; however, now I am 
looking at several different tools to convert mbox to Maildir.  It 
seems the tools, mb2md.pl, perfect_maildir.pl, and others all do what 
they claim; however, when the messages are converted and they are 
stored in Maildir/cur, the email clients download these messages as new.


I guess you're talking about POP3. You'd need to be able to preserve 
the POP3 UIDLs (see http://wiki.dovecot.org/Migration), which would 
require that you also preserve the IMAP UIDs in the mbox -> Maildir 
switch. Unfortunately I'm not aware of any scripts that preserves the 
UIDs, although it wouldn't be difficult to write support for that.


This is not only about POP3, as far as I can tell. If you converting 
mbox to Maildir (dovecot to dovecot) - UIDs change. And if you have your 
client set to cache all the messages and
you have over 1Gb in your mail... well, it will be transferring all your 
mail again. Deleting the old one (as it is not on the server anymore) 
and re-downloading new ones.
It would be nice to have Convert plugin, that preserves UIDs and 
UIDVALIDITY values.


P.S. A little unrelated question about convert plugin.

I have all my mbox-es in /raid/mbox/%u
I have set convert_mail = mbox:/raid/mbox/%u:INBOX=/var/mail/%u in the 
dovecot.conf.
But for some reason the folder with mail doesn't get renamed after 
conversion. Is that the way it should be?


Of course, it tries to convert the same boxes next time I log in.

FiL






Re: [Dovecot] Quota warning not generated

2007-05-25 Thread Nicolas Boullis

Quoting Doug Council <[EMAIL PROTECTED]>:


I am testing out the unofficial quota warning patch with Dovecot 1.0.0,
and no matter what values I use for the storage or messages values, the
warning script is never executed.

My plugin settings are:

plugin {
  quota = maildir:storage=20480
  quota_warning = storage=80%:messages=10 /usr/local/bin/quota-warning.sh
}


(...)


There are more than 10 messages in the mailbox, but the
quota-warning.sh script never gets executed.  When using storage=80%,
the maildirsize file has the correct values (not included in this
message), but it never executes the script as well.

Does anyone have any ideas?


As I wrote the patch, I do. ;-)
The warning is triggered when the free space goes below the specified  
value, not when the used space goes above. Hence, if you have no limit  
on the message count, no warning on the message count will ever be  
executed.


Moreover, if the free space is already below the specified value, no  
warning is triggered. It is only triggered when a message *brings* the  
free space below the specified value.



Hope this helps,

Nicolas Boullis



[Dovecot] delivery and quota question

2007-05-25 Thread Arkadiusz Miskiewicz

Hi,

I'm considering using delivery for delivering emails. The question is about 
quota. Does delivery check quota for single maildir or for entire collection 
of user folders?

Example:
/var/mail/user/{new,cur,tmp}
/var/mail/user/.Some_Folder/{new,cur,tmp}
/var/mail/user/.Some_Other_Folder/{new,cur,tmp}

Can I somehow get deliver checking size for all these folders? I need quota 
per user not per folder.

-- 
Arkadiusz MiƛkiewiczPLD/Linux Team
arekm / maven.plhttp://ftp.pld-linux.org/


Re: [Dovecot] Quota warning not generated

2007-05-25 Thread Doug Council

On Fri, 25 May 2007, Nicolas Boullis wrote:

As I wrote the patch, I do. ;-)


Always good to go to the source :)

The warning is triggered when the free space goes below the specified value, 
not when the used space goes above. Hence, if you have no limit on the 
message count, no warning on the message count will ever be executed.


Fair enough, I knew I wasn't setting a message count quota, but I didn't 
realize it was smart enough to know that.


Moreover, if the free space is already below the specified value, no warning 
is triggered. It is only triggered when a message *brings* the free space 
below the specified value.


I had it reversed and correcting the percentage to be how much of the 
storage quota is left, things worked as they should.


Thanks for clarification.

-Doug