Re: [Dovecot] Custom sql query for keeping quota with dict-sql

2011-06-05 Thread Marcin Mirosław
W dniu 2011-06-03 15:47, Timo Sirainen pisze:
> On Fri, 2011-06-03 at 15:17 +0200, Marcin Mirosław wrote:
>> DICT_QUOTA_DEL= ...
>> DICT_QUOTA_INSERT=
>> DICT_QUOTA_OTHER_ACTIONS=
> 
> It's not that simple.

If it would be simple, probably it would be done;)
Thanks Timo, Duane, Marcus for all replies.

Regards,
Marcin


Re: [Dovecot] sieve script tracing

2011-06-05 Thread Stephan Bosch
On 06/04/2011 12:11 PM, Maciej Uhlig wrote:
> Could it be possible to trace Sieve script using method other than
> "enotify", i.e. to write a message to syslog using some action?
> 

Not currently. There is a vnd.dovecot.debug extension, but that is only
available for the command line tools and not for the actual LDA plugin.

What is your application?

Regards,

Stephan.


[Dovecot] Help with Trash setup

2011-06-05 Thread Ivan Rodrigues
Folks,

I'm trying to setup a mail server just to store my mail, i use fetchmail to
retrieve my messages and I want to configure the trash can, can you guys
please help me with this mater?


Dovecot Version: 1.2.9

No SQL nor LDAP installed

dovecot -n
# 1.2.9: /etc/dovecot/dovecot.conf
# OS: Linux 2.6.32-24-generic-pae i686 Ubuntu 10.04.2 LTS
log_timestamp: %Y-%m-%d %H:%M:%S
login_dir: /var/run/dovecot/login
login_executable: /usr/lib/dovecot/imap-login
mail_privileged_group: mail
mail_location: maildir:~/Maildir
mbox_write_locks: fcntl dotlock
mail_plugins: delete_to_trash
auth default:
  passdb:
driver: pam
  userdb:
driver: passwd
plugin:
  deleted_to_trash_folder: Trash


Re: [Dovecot] Help with Trash setup

2011-06-05 Thread Xavier Maillard
Hi,

On Sun, 5 Jun 2011 13:08:00 -0300, Ivan Rodrigues  
wrote:
> Folks,
> 
> I'm trying to setup a mail server just to store my mail, i use fetchmail to
> retrieve my messages and I want to configure the trash can, can you guys
> please help me with this mater?

I am not an expert (and I do not use this plugin) but:

> mail_plugins: delete_to_trash
 ^^^

shouldn't it be *deleted_to_trash* ?

/Xavier


[Dovecot] file rights for dictionary file

2011-06-05 Thread Michael Köhler
Hi,

I use Debian Squeeze and the sources from Stephan Bosch. A few weeks ago I´ve 
upgraded from 2.0.11 to 2.0.13 and got an error

May 29 20:01:53 mailserver dovecot: dict: Error: Can't open configuration file 
/etc/dovecot/dovecot-dict-sql.conf.ext: Permission denied
May 29 20:01:53 mailserver dovecot: dict: Error: Failed to initialize 
dictionary 'quota'

and I could see that /etc/dovecot/dovecot-dict-sql.conf.ext is owning by 
root:root with 600. After changing to root:root 644 all works, but after each 
upgrade all files in /etc/dovecot will be set to 600.

Is it a problem of the dovecot package or should I do some changes to config to 
allow dovecot reading the dict file?

Here is my config:

# 2.0.13 (9ae30e5d6935): /etc/dovecot/dovecot.conf
# OS: Linux 2.6.32-5-xen-amd64 x86_64 Debian 6.0.1 ext3
auth_mechanisms = plain login cram-md5
dict {
  quota = mysql:/etc/dovecot/dovecot-dict-sql.conf.ext
}
first_valid_uid = 106
lda_mailbox_autocreate = yes
lda_mailbox_autosubscribe = yes
mail_location = maildir:/var/mail/%d/%u
mail_plugins = quota
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.ext
  driver = sql
}
plugin {
  autocreate = Sent Messages
  autocreate2 = Deleted Messages
  autocreate3 = Drafts
  autosubscribe = Sent Messages
  autosubscribe2 = Deleted Messages
  autosubscribe3 = Drafts
  quota = dict:User quota::proxy::quota
  quota_rule2 = Deleted Messages:storage=+1GB
  sieve = ~/.dovecot.sieve
  sieve_dir = ~/sieve
}
protocols = imap lmtp
service auth {
  unix_listener /var/spool/postfix/private/auth {
group = postfix
mode = 0660
user = postfix
  }
}
service dict {
  unix_listener dict {
group = mail
mode = 0660
  }
}
service imap-login {
  inet_listener imap {
port = 0
  }
 inet_listener imaps {
port = 993
ssl = yes
  }
}
service lmtp {
  unix_listener /var/spool/postfix/private/dovecot-lmtp {
group = postfix
mode = 0660
user = postfix
  }
}
ssl = required
ssl_cert = 

Re: [Dovecot] sieve script tracing

2011-06-05 Thread Maciej Uhlig

W dniu 2011-06-05 11:37, Stephan Bosch pisze:

What is your application?


Actually it's something like this:

>>>

if anyof (
# example #1
allof (
...
anyof (
...
)
),
# example #2
allof (
...
anyof (
...
)
),
# example #3
allof (
...
anyof (
...
)
),
# example #4
allof (
...
),
# example #4a
allof (
...
),

# example #5
allof (
...
),
# example #6
allof (
...
),
# example #7
allof (
...
)
)
{
discard;
}

>>>

I'd like to know which condition was the actual reason of e-mail 
discarding. I thought about log message.


Regards,

MU



Re: [Dovecot] sieve script tracing

2011-06-05 Thread Jerry
On Sun, 05 Jun 2011 22:48:16 +0200
Maciej Uhlig  articulated:

{snip}

> I'd like to know which condition was the actual reason of e-mail 
> discarding. I thought about log message.

An actual way to step through the execution of the code is something
that I have been waiting for, for quite awhile. My coding skills are
certainly not up to the task of writing such an application and I have
not been able to locate one. I have literally spent hours debugging a
logic problem with sieve scripts. It ain't fun. ☹

-- 
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] sieve script tracing

2011-06-05 Thread Stephan Bosch

On 6/5/2011 10:48 PM, Maciej Uhlig wrote:

W dniu 2011-06-05 11:37, Stephan Bosch pisze:

What is your application?


Actually it's something like this:

>>>

if anyof (
# example #1
allof (
...
anyof (
...
)
),
# example #2
allof (
...
anyof (
...
)
),
# example #3
allof (
...
anyof (
...
)
),
# example #4
allof (
...
),
# example #4a
allof (
...
),

# example #5
allof (
...
),
# example #6
allof (
...
),
# example #7
allof (
...
)
)
{
discard;
}

>>>

I'd like to know which condition was the actual reason of e-mail 
discarding. I thought about log message.


If you have a sample message, you can use the sieve-test tool for that. 
You can check the individual steps the interpreter takes while 
processing the message. Refer to the man page for more info.


Regards,

Stephan.





[Dovecot] doveadm problem with mail_plugins in database

2011-06-05 Thread Ralf Zimmermann
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi all,

I use this user_query:

- ---%<
user_query = SELECT LOWER(CONCAT(t2.login,'@',t1.name)) AS
user,t2.home,t2.mail,5000 AS uid,5000 AS
gid,CONCAT('*:storage=',quota_mb,'MB') AS quota_rule,t2.acl_groups,case
when '%s'='lda' then 'acl quota sieve' when '%s'='lmtp' then 'acl quota
sieve' when '%s'='doveadm' then mail_plugins when '%s'='sieve' then 'acl
quota' else t2.mail_plugins end as mail_plugins FROM virtual_users as
t2, virtual_domains as t1 WHERE ( t2.login='%n' OR t2.email='%u' ) AND
t1.enabled IS true AND t2.enabled IS true AND t1.id=t2.domain_id
- ---%<

When I use some doveadm commands I get this error for example:

- ---%<
# doveadm fetch -u rzimmermann "hdr" savedbefore 3d

doveadm(rzimmermann): Error:
dlopen(/usr/local/lib/dovecot/lib02_imap_acl_plugin.so) failed:
/usr/local/lib/dovecot/lib02_imap_acl_plugin.so: undefined symbol:
client_fail_mailbox_name_status
doveadm(rzimmermann): Error: Can't load plugin imap_acl_plugin: Plugin
is intended to be used only by imap binary (we're doveadm)
doveadm(rzimmermann): Fatal: Couldn't load required plugins
- ---%<

Some doveadm commands runs fine. Here a example:

- ---%<
# doveadm user rzimmermann

userdb: rzimmermann
  home  : /var/vmail/virtusers/boardfreunde.de/rzimmermann
  mail  : maildir:~/Maildir
  uid   : 5000
  gid   : 5000
  quota_rule: *:storage=4000MB
  acl_groups: admins,boe-admins
  mail_plugins: quota imap_quota acl imap_acl autocreate fts fts_squat
- ---%<

If I change the user_query part "'%s'='doveadm' then mail_plugins" to
"'%s'='doveadm' then 'acl quota" all works fine, but I get a wrong
mail_plugin output:

- ---%<
userdb: rzimmermann
  home  : /var/vmail/virtusers/boardfreunde.de/rzimmermann
  mail  : maildir:~/Maildir
  uid   : 5000
  gid   : 5000
  quota_rule: *:storage=4000MB
  acl_groups: admins,boe-admins
  mail_plugins: acl quota
- ---%<

What can I do to get doveadm working with "'%s'='doveadm' then
mail_plugins"? Or must I use "'%s'='doveadm' then 'acl quota" in the
user_query?

I use dovecot 2.0.13.

Greets
Ralf

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (GNU/Linux)

iQEcBAEBAgAGBQJN7BDnAAoJENVjhbwuX+/H6F4H/ROB/J4/icebgAQdpqQxYgDt
PEUR87dlgIufQWT7KVyYVYBxzfjRqk20+f/Djpxy6RGl2jVHajvtOpsovQQz92Dy
C1ulagZ2mimhbP8qa6VSh3Ozjv9xASbXDJHEDhSR3i45V0bPFpN1resaP8pHHJkl
bdvqrdXlvIdMvJ83fSTcElMdIrmg0wyUJMTB900NVkvndlGO1xs1vtfv2c+PhNDe
9nq9Vs2/uVt7NO6ct/d9tqd57X5fzqxzIvjWWCIyHB38W6KgNFM6TiHI1WtSFsKn
4UOcE9FKmePq17ugaj1yrn0gmOSgU1TqnSjRwEM0xoteUlio2NsuhzFSVojkq9s=
=NzcM
-END PGP SIGNATURE-


[Dovecot] restore lost emails

2011-06-05 Thread Daminto Lie
Hi,

I was wondering if anyone might be able to help me with this. I am running 
Postfix 2.7.0, Dovecot 1.2.9 and squirrelmail. Every week, I perform a back-up 
on both Postfix and Dovecot (maildir and conf folders). That's good because I 
have all the emails backed up. And now what I would like to ask is whether or 
not there are any easy way of restoring e-mails if some emails got deleted by 
accident or for other reason. So far, I have tried to look up the answer on the 
Internet but got a bit of vague answer. 


Any help would be greatly appreciated.

Thank you