Re: [Dovecot] expire plugin + --exec-mail in 1.2.6 version

2009-10-31 Thread Nikita Koshikov
On Fri, 30 Oct 2009 13:16:47 -0400
Timo Sirainen t...@iki.fi wrote:

 On Fri, 2009-10-30 at 14:03 +0200, Nikita Koshikov wrote:
The  problem that some users have their own quotas stored in ldap. 
 
 See if the attached patch helps? I'm a bit afraid that it could also
 break something. If it does, there's really no easy way to get this
 fixed before v2.0.
 

The patch helped with quotas, but it raises new error - segmentation error

Here details:
# /usr/sbin/dovecot --exec-mail ext /usr/libexec/dovecot/expire-tool.sh 
Info: Loading modules from directory: /usr/lib/dovecot/imap
Info: Module loaded: /usr/lib/dovecot/imap/lib10_quota_plugin.so
Info: Module loaded: /usr/lib/dovecot/imap/lib11_trash_plugin.so
Info: Module loaded: /usr/lib/dovecot/imap/lib20_autocreate_plugin.so
Info: Module loaded: /usr/lib/dovecot/imap/lib20_expire_plugin.so
Info: Module loaded: /usr/lib/dovecot/imap/lib20_virtual_plugin.so
Info: Module loaded: /usr/lib/dovecot/imap/lib20_zlib_plugin.so

--koshiko...@domain.com - have own quota in ldap, expire-tool is working fine:

Info: expire: pattern=Trash type=expunge secs=2592000
Info: expire: pattern=Spam type=expunge secs=2592000
Info: auth input: quota_rule=*:bytes=629145600
Info: auth input: uid=8
Info: auth input: gid=12
Info: auth input: home=/data/mail/domain.com/koshikov.n
Info: auth input: mail=maildir:~/data
Info: Quota root: name=Mailbox quota backend=maildir args=
Info: Quota rule: root=Mailbox quota mailbox=* bytes=629145600 messages=0
Info: Quota rule: root=Mailbox quota mailbox=Trash bytes=62914560 (10%) 
messages=0
Info: Quota warning: bytes=566231040 (90%) messages=0 
command=/etc/dovecot/plugins/quota_warning.sh 90
Info: Namespace: type=private, prefix=, sep=/, inbox=yes, hidden=no, list=yes, 
subscriptions=yes
Info: maildir: data=~/data
Info: maildir++: root=/data/mail/domain.com/koshikov.n/data, index=, control=, 
inbox=/data/mail/domain.com/koshikov.n/data
Info: Namespace: type=private, prefix=Company/, sep=/, inbox=no, hidden=no, 
list=yes, subscriptions=no
Info: virtual: data=/var/mail/virtual:INDEX=MEMORY:LAYOUT=maildir++
Info: maildir++: root=/var/mail/virtual, index=, control=, inbox=
Info: Namespace : Using permissions from /data/mail/domain.com/koshikov.n/data: 
mode=0700 gid=-1
Info: trash plugin: Added 'Trash' with priority 1
Info: trash plugin: Added 'Spam' with priority 2

-- bunkin...@domain.com have default quota value, expire-tool is working fine:

Info: auth input: uid=8
Info: auth input: gid=12
Info: auth input: home=/data/mail/domain.com/bunkina.l
Info: auth input: mail=maildir:~/data
Info: Quota root: name=Mailbox quota backend=maildir args=
Info: Quota rule: root=Mailbox quota mailbox=* bytes=524288000 messages=0
Info: Quota rule: root=Mailbox quota mailbox=Trash bytes=52428800 (10%) 
messages=0
Info: Quota warning: bytes=471859200 (90%) messages=0 
command=/etc/dovecot/plugins/quota_warning.sh 90
Info: Namespace: type=private, prefix=, sep=/, inbox=yes, hidden=no, list=yes, 
subscriptions=yes
Info: maildir: data=~/data
Info: maildir++: root=/data/mail/domain.com/bunkina.l/data, index=, control=, 
inbox=/data/mail/domain.com/bunkina.l/data
Info: Namespace: type=private, prefix=Company/, sep=/, inbox=no, hidden=no, 
list=yes, subscriptions=no
Info: virtual: data=/var/mail/virtual:INDEX=MEMORY:LAYOUT=maildir++
Info: maildir++: root=/var/mail/virtual, index=, control=, inbox=
Info: Namespace : Using permissions from /data/mail/domain.com/bunkina.l/data: 
mode=0700 gid=-1
Info: trash plugin: Added 'Trash' with priority 1
Info: trash plugin: Added 'Spam' with priority 2

-- podburt...@domain.com - have default quota, this account cause segmentation 
error, while running expire-tool:

Info: auth input: uid=8
Info: auth input: gid=12
Info: auth input: home=/data/mail/domain.com/podburtniy
Info: auth input: mail=maildir:~/data
Info: Quota root: name=Mailbox quota backend=maildir args=
Info: Quota rule: root=Mailbox quota mailbox=* bytes=524288000 messages=0
Info: Quota rule: root=Mailbox quota mailbox=Trash bytes=52428800 (10%) 
messages=0
Info: Quota warning: bytes=471859200 (90%) messages=0 
command=/etc/dovecot/plugins/quota_warning.sh 90
Ошибка сегментирования

The only difference with mailbox podburt...@domain.com that it's ldap mail 
field is different from samaccountname:

podburt...@domain.com
mail: podburt...@domain.com
sAMAccountName: podburtn

koshiko...@domain.com
mail: koshiko...@domain.com
sAMAccountName: koshikov.n

But, I'm using only mail/maxstorage/useraccountcontrol attributes for mail 
staff.
Users login to their accounts using full e-mail address and AD password.


Re: [Dovecot] mailbox count folders issues

2009-10-31 Thread Nikita Koshikov
On Thu, 29 Oct 2009 12:38:22 -0400
Timo Sirainen t...@iki.fi wrote:

 On Thu, 2009-10-29 at 12:11 +0200, Nikita Koshikov wrote:
  On Wed, 28 Oct 2009 14:17:52 -0400
  Timo Sirainen t...@iki.fi wrote:
  
   On Wed, 2009-10-28 at 10:39 +0200, Nikita Koshikov wrote:
  Oct 26 15:26:38 IMAP(gozhd...@domain.com): Panic: data stack: Out 
  of memory when allocating 268435472 bytes
  Oct 26 15:26:38 IMAP(gozhd...@domain.com): Error: *** glibc 
  detected *** imap: double free or corruption (!prev): 0x0812ba00 ***
   
   Oh, the double free is because of broken handling of out-of-memory
   error. http://hg.dovecot.org/dovecot-1.2/rev/acfef2f0fec3 probably fixes
   that.
  
  Sorry, but this patch didn't help.
 
 Not with the out of memory, but did it get rid of the double free or
 corruption error?
 
   Hmm. So I guess there's no memory corruption causing this, but I don't
   really see why it would try to allocate that much memory. 268435472 in
   hex is 0x1010, which is an interesting number but doesn't really
   help much either.
  268435456 is 256M which is max mail_process_size config setting, maybe this 
  values is in use ? 
 
 I guess it's just exponentially increasing the buffer size then until it
 reaches mail_process_size.
 
  I recompile dovecot binaries with debug symbols, but seemed that gdb 
  backtrace is broken.
 
 Yeah, it is. Hmm. Since the core isn't working, can you attach gdb to
 imap process while it's still running? So something like:
 
  - open the account so imap process starts
  - gdb -p imap process pid
  - gdb command: c
  - cause imap to crash - gdb should stop
  - gdb command: bt full
 

One more note:
version 1.2.4 also has this bug. 


Re: [Dovecot] expire plugin + --exec-mail in 1.2.6 version

2009-10-31 Thread Nikita Koshikov
On Fri, 30 Oct 2009 13:16:47 -0400
Timo Sirainen t...@iki.fi wrote:

 On Fri, 2009-10-30 at 14:03 +0200, Nikita Koshikov wrote:
The  problem that some users have their own quotas stored in ldap. 
 
 See if the attached patch helps? I'm a bit afraid that it could also
 break something. If it does, there's really no easy way to get this
 fixed before v2.0.
 

Note:
I rechecked expire-tool behavior with version 1.2.4 and it's working the same 
way as 1.2.6, 
so my problem have more long history, than I thought.


Re: [Dovecot] Author wanted for Dovecot article in Linux Magazine (Germany)

2009-10-31 Thread Stefan Onken

Markus Feilner schrieb:

Hi list,
I am an editor at the German Linux Magazine and I am searching for an author or input on Dovecot, 
its advantages and especially the recent features. I had organized some authors, but unfortunately 
they don't have time right now. :-) Nevertheless I heard many positive comments on Dovecot.


I am quite new to Dovecot with a lot of questions, but I have setup a 
few email systems now with Dovecot / Exim under Ubuntu. I will finish my 
howto next week 
http://www.stonki.de/computer/mailserver/ubuntu-exim-dovecot-howto/ 
(It's not finished yet).


Stefan




Re: [Dovecot] expire plugin + --exec-mail in 1.2.6 version

2009-10-31 Thread Nikita Koshikov

 The patch helped with quotas, but it raises new error - segmentation
 error


After some more tests, I find out that crash happens, while trying to
proceed  the third user, and the user's quota and other settings not
important.


[Dovecot] Post login script issue with pop3 protocol

2009-10-31 Thread Zhang Huangbin

Hi, all.

I want to track user last login data (ip address, login date, etc)  
with dovecot, followed dovecot tutorial[1], and it now works with  
IMAP, but failed with POP3. i don't know why.


My script:

LDAP_URI='ldap://127.0.0.1:389'
LDAP_BASEDN='o=domains,dc=iredmail,dc=org'
BIND_DN='cn=vmailadmin,dc=iredmail,dc=org'
BIND_PW='plain_passwd'

if [ X${USER} != Xdump-capability ]; then
ldapmodify -c -x \
-H ${LDAP_URI} \
-D ${BIND_DN} \
-w ${BIND_PW} EOF
dn: mail=${USER},ou=Users,domainName=$(echo ${USER} | awk -F'@'  
'{print $2}'),${LDAP_BASEDN}

changetype: modify
replace: lastLoginDate
lastLoginDate: $(date +%Y%m%d%H%M%SZ)
-
replace: lastLoginIP
lastLoginIP: ${IP}
-
replace: lastLoginProtocol
lastLoginProtocol: pop3
EOF

fi


It works with IMAP protocol, but failed with POP3 protocol.
Error msg in Thunderbird:

The STAT command did not succeed. Error getting message number and  
sizes.

Mail server r6.iredmail.org responsed: ying entry
mail=...@a.cn,ou=Users,domainName=a.cn,o=domains,dc=iredmail,dc=org


[1] Post-login scripting: http://wiki.dovecot.org/PostLoginScripting

--
Best Regards.

Zhang Huangbin

- Open Source Mail Server Solution for Red Hat(R) Enterprise Linux,
  CentOS, Debian, Ubuntu: http://www.iredmail.org/



[Dovecot] something similar to last login but for aliases

2009-10-31 Thread Bradley Giesbrecht

I'm using dovecot deliver with postfix.

Is there a place to hook in a db update when an alias is hit?

I'm wanting to delete aliases that haven't been used in x time.


Thank you,

Brad


[Dovecot] How to create nested dirs

2009-10-31 Thread SKAL

Hi all,

I'm experiencing a problem that several users had, but I could not find 
a solution.


I cannot create any subfolders with my thunderbird 2.0.0.23 client, but 
I can creat other folders.


Any ideas?

tnx

leo


# dovecot -n
# 1.2.4: /etc/dovecot/dovecot.conf
# OS: Linux 2.6.12.6-arm1 armv5tejl Debian 5.0.3
log_timestamp: %Y-%m-%d %H:%M:%S
protocols: imaps
login_dir: /var/run/dovecot/login
login_executable: /usr/lib/dovecot/imap-login
mail_privileged_group: mail
mbox_write_locks: fcntl dotlock
auth default:
  passdb:
driver: pam
  userdb:
driver: passwd
# dovecot -a
# 1.2.4: /etc/dovecot/dovecot.conf
# OS: Linux 2.6.12.6-arm1 armv5tejl Debian 5.0.3
base_dir: /var/run/dovecot
log_path:
info_log_path:
log_timestamp: %Y-%m-%d %H:%M:%S
syslog_facility: mail
protocols: imaps
listen: *
ssl_listen:
ssl: yes
ssl_ca_file:
ssl_cert_file: /etc/ssl/certs/dovecot.pem
ssl_key_file: /etc/ssl/private/dovecot.pem
ssl_key_password:
ssl_parameters_regenerate: 168
ssl_cipher_list:
ssl_cert_username_field: commonName
ssl_verify_client_cert: no
disable_plaintext_auth: yes
verbose_ssl: no
shutdown_clients: yes
nfs_check: yes
version_ignore: no
login_dir: /var/run/dovecot/login
login_executable: /usr/lib/dovecot/imap-login
login_user: dovecot
login_greeting: Dovecot ready.
login_log_format_elements: user=%u method=%m rip=%r lip=%l %c
login_log_format: %$: %s
login_process_per_connection: yes
login_chroot: yes
login_trusted_networks:
login_process_size: 64
login_processes_count: 3
login_max_processes_count: 128
login_max_connections: 256
valid_chroot_dirs:
mail_chroot:
max_mail_processes: 512
mail_max_userip_connections: 10
verbose_proctitle: no
first_valid_uid: 500
last_valid_uid: 0
first_valid_gid: 1
last_valid_gid: 0
mail_access_groups:
mail_privileged_group: mail
mail_uid:
mail_gid:
mail_location:
mail_cache_fields:
mail_never_cache_fields: imap.envelope
mail_cache_min_mail_count: 0
mailbox_idle_check_interval: 30
mail_debug: no
mail_full_filesystem_access: no
mail_max_keyword_length: 50
mail_save_crlf: no
mmap_disable: no
dotlock_use_excl: yes
fsync_disable: no
mail_nfs_storage: no
mail_nfs_index: no
mailbox_list_index_disable: yes
lock_method: fcntl
maildir_stat_dirs: no
maildir_copy_with_hardlinks: yes
maildir_copy_preserve_filename: no
maildir_very_dirty_syncs: no
mbox_read_locks: fcntl
mbox_write_locks: fcntl dotlock
mbox_lock_timeout: 300
mbox_dotlock_change_timeout: 120
mbox_min_index_size: 0
mbox_dirty_syncs: yes
mbox_very_dirty_syncs: no
mbox_lazy_writes: yes
dbox_rotate_size: 2048
dbox_rotate_min_size: 16
dbox_rotate_days: 1
mail_drop_priv_before_exec: no
mail_executable: /usr/lib/dovecot/imap
mail_process_size: 256
mail_plugins:
mail_plugin_dir: /usr/lib/dovecot/modules/imap
mail_log_prefix: %Us(%u):
mail_log_max_lines_per_sec: 10
imap_max_line_length: 65536
imap_capability:
imap_client_workarounds:
imap_logout_format: bytes=%i/%o
imap_id_send:
imap_id_log:
imap_idle_notify_interval: 120
pop3_no_flag_updates: no
pop3_enable_last: no
pop3_reuse_xuidl: no
pop3_lock_session: no
pop3_uidl_format: %08Xu%08Xv
pop3_client_workarounds:
pop3_logout_format: top=%t/%p, retr=%r/%b, del=%d/%m, size=%s
dict_db_config:
dict_process_count: 1
managesieve_max_line_length: 65536
managesieve_logout_format: bytes=%i/%o
managesieve_implementation_string: dovecot
auth default:
  mechanisms: plain
  realms:
  default_realm:
  cache_size: 0
  cache_ttl: 3600
  cache_negative_ttl: 3600
  executable: /usr/lib/dovecot/dovecot-auth
  user: root
  chroot:
  username_chars: 
abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890.-_@
  username_translation:
  username_format:
  master_user_separator:
  anonymous_username: anonymous
  krb5_keytab:
  gssapi_hostname:
  winbind_helper_path: /usr/bin/ntlm_auth
  failure_delay: 2
  verbose: no
  debug: no
  debug_passwords: no
  ssl_require_client_cert: no
  ssl_username_from_cert: no
  use_winbind: no
  count: 1
  worker_max_count: 30
  process_size: 256
  passdb:
driver: pam
args:
deny: no
pass: no
master: no
  userdb:
driver: passwd
args: