[Dovecot] index IO patterns

2012-05-11 Thread Cor Bosman
Hey all, we're in the process of checking out alternatives to our index 
storage.  We're currently storing indexes on a NetApp Metrocluster which works 
fine, but is very expensive. We're planning a few different setups and doing 
some actual performance tests on them.  

Does anyone know some of the IO patterns of the indexes? For instance:

- mostly random reads or linear reads/writes? 
- average size of reads and writes?
- how many read/writes on average for a specific mailbox size?

Anyone do any measurements of this kind?

Alternatively, does anyone have any experience with other redundant storage 
options? Im thinking things like MooseFS, DRBD, etc? 

regards,

Cor



Re: [Dovecot] index IO patterns

2012-05-11 Thread Javier Miguel Rodríguez
 

Indexes are very random, mostly read, some writes if using
dovecot-lda (ej: dbox). The average size is rather small, maybe 5 KB in
our setup. Bandwith is rather low, 20-30 MB/sec 

We are using HP
LeftHand for our replicated storage needs. 

Regards 

Javier 

El
11/05/2012 08:41, Cor Bosman escribió: 

 Hey all, we're in the process
of checking out alternatives to our index storage. We're currently
storing indexes on a NetApp Metrocluster which works fine, but is very
expensive. We're planning a few different setups and doing some actual
performance tests on them. 
 
 Does anyone know some of the IO
patterns of the indexes? For instance:
 
 - mostly random reads or
linear reads/writes? 
 - average size of reads and writes?
 - how many
read/writes on average for a specific mailbox size?
 
 Anyone do any
measurements of this kind?
 
 Alternatively, does anyone have any
experience with other redundant storage options? Im thinking things like
MooseFS, DRBD, etc? 
 
 regards,
 
 Cor

 

Re: [Dovecot] index IO patterns

2012-05-11 Thread Cor Bosman
Hi javier,

 
 
 Indexes are very random, mostly read, some writes if using
 dovecot-lda (ej: dbox). The average size is rather small, maybe 5 KB in
 our setup. Bandwith is rather low, 20-30 MB/sec 

Even without LDA/LMTP dovecot-imap needs to write right? It would 
need to update the index every time an imap connect happens and
new mails are found in the mail store.

Cor



Re: [Dovecot] index IO patterns

2012-05-11 Thread Javier de Miguel Rodríguez

Even without LDA/LMTP dovecot-imap needs to write right? It would
need to update the index every time an imap connect happens and
new mails are found in the mail store.


Well of course. Indexes are also updated when flags are modified, moved 
a messages, delete a message, etc.. But in my setup there are 65% reads 
and the rest writes


Regards

Javier



Cor





Re: [Dovecot] /var/run/dovecot folder gets deleted on server reboot? ubuntu 10.10

2012-05-11 Thread Charles Marcus

On 2012-05-10 10:37 AM, jacques jacq...@itopia-biz.info wrote:

Hi
After rebooting my server connections to the mail system set up there
failed - on closer inspection no dovecot process was running or got
started.
When running as root /usr/share/sbin/dovecot -c
/etc/dovecot/dovecot.conf got error on console
/var/run/dovecot/auth-master could not be opened and found no
/var/run/dovecot folder!.
Is there better script to place in/etc/init.c/  to start dovecot (which
will not fail silently?) Any idea what would remove the folder on ubuntu
10.10, running dovecot 2.1.5 and postfix 2.1.7?


This question really should be asked on an Ubuntu support list, as each 
distro has its own way of doing things.


But - are you sure you have postfix 2.1.7? That is so ancient I shudder 
at the thought - please upgrade asap...


--

Best regards,

Charles


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

2012-05-11 Thread Alfonso Alejandro Reyes Jimenez

Hi everyone.

I have a postfix working with sasl auth and dovecot, everything works 
fine. I just have 2 issues, the first is that if you add the IMAP mail 
accounts you can import all the mboxes on the /var/spool/mail/ which we 
don't want.


The second issue is that there's no sent, trash and draft folder, so if 
we have imap we are not able to store those emails.


Basically I would like to know how to fix both but the first one is the 
most urgent.


I thought it was a postfix issue, but it seems not to be. Any ideas?

Thanks in advance for your help.

Here's the posftix config:

[root@mail ~]# postconf -n
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
broken_sasl_auth_clients = yes
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
debug_peer_level = 2
disable_dns_lookups = yes
disable_vrfy_command = yes
html_directory = no
inet_interfaces = all
mail_owner = postfix
mailbox_size_limit = 524288000
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
masquerade_domains = mydomain.com
message_size_limit = 5242880
mydestination = $myhostname, localhost.$mydomain, localhost
mydomain = mydomain.com
myhostname = mydomain.com
mynetworks = 127.0.0.0/8, 10.1.8.27/32, 10.1.8.23/32, 172.16.18.101/32
myorigin = mydomain.com
newaliases_path = /usr/bin/newaliases.postfix
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.3.3/README_FILES
sample_directory = /usr/share/doc/postfix-2.3.3/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
smtp_generic_maps = hash:/etc/postfix/generic
smtp_host_lookup = native,dns
smtp_tls_note_starttls_offer = yes
smtp_use_tls = yes
smtpd_banner = $myhostname Microsoft ESMTP MAIL Service ready (NOT 
WINDOWS JUST A DECOY)

smtpd_helo_required = yes
smtpd_recipient_restrictions = permit_mynetworks, 
permit_sasl_authenticated, reject_unauth_destination

smtpd_sasl_auth_enable = yes
smtpd_sasl_path = inet:127.0.0.1:12345
smtpd_sasl_security_options = noanonymous
smtpd_sasl_type = dovecot
smtpd_sender_login_maps = pcre:/etc/postfix/sender_login.pcre
smtpd_sender_restrictions = 
reject_authenticated_sender_login_mismatch,check_client_access 
hash:/etc/postfix/client_access

smtpd_tls_CAfile = /etc/postfix/cert/cacert.pem
smtpd_tls_auth_only = yes
smtpd_tls_cert_file = /etc/postfix/cert/smtpd.crt
smtpd_tls_key_file = /etc/postfix/cert/smtpd.key
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_security_level = may
smtpd_tls_session_cache_timeout = 3600s
smtpd_use_tls = yes
tls_random_source = dev:/dev/urandom
transport_maps = hash:/etc/postfix/transport
unknown_local_recipient_reject_code = 550

And here's the dovecot:

Version:

[root@mail ~]# dovecot --version
2.0.9

Config:

[root@mail ~]# dovecot -n
# 2.0.9: /etc/dovecot/dovecot.conf
# OS: Linux 2.6.32-220.13.1.el6.i686 i686 CentOS release 6.2 (Final) ext4
auth_mechanisms = cram-md5
listen = *
log_path = /var/log/dovecot/dovecot.log
login_greeting = IMAP ready.
mail_location = mbox:/var/spool/mail/:INBOX=/var/spool/mail/%u
mail_privileged_group = mail
mbox_write_locks = fcntl
passdb {
  driver = pam
}
passdb {
  args = scheme=cram-md5 /etc/dovecot/cram-md5.pwd
  driver = passwd-file
}
protocols = pop3
service auth {
  inet_listener {
port = 12345
  }
  user = $default_internal_user
}
service pop3-login {
  inet_listener pop3 {
port = 110
ssl = yes
  }
  inet_listener pop3s {
port = 995
ssl = yes
  }
}
ssl_cert = /etc/ssl/certs/dovecot.pem
ssl_key = /etc/ssl/private/dovecot.pem
userdb {
  driver = passwd
}


[Dovecot] multi-instance doveadm user -m woes

2012-05-11 Thread David Warden
I'm having difficulty with the doveadm who command on a multi-instance setup of 
dovecot. When I run the who command on the non-standard instance with the -m 
flag (to see their mail location), this happens:

[root@wardentest3 dovecot]# doveadm -i mailtest user -m warden
doveadm(root): Error: user warden: Initialization failed: Namespace 'INBOX.': 
Ambiguous mail location setting, don't know what to do with it: 
/var/spool/mail/root (try prefixing it with mbox: or maildir:)

I tried adding my mail_location setting as location to both of my legacy and 
default namespaces, but got the same error.

I also tried adding the -a flag like so:

doveadm user -a /var/run/dovecot/mailtest/auth-userdb -m warden
doveadm(root): Error: userdb lookup: connect(/var/run/dovecot/auth-userdb) 
failed: Connection refused

(the default instance is currently stopped)

and combining -a and -i out of curiosity:

[root@wardentest3 conf.d]# doveadm -i mailtest user -a 
/var/run/dovecot/mailtest/auth-userdb -m warden
doveadm(root): Error: user warden: Initialization failed: Namespace 'INBOX.': 
Ambiguous mail location setting, don't know what to do with it: 
/var/spool/mail/root (try prefixing it with mbox: or maildir:)

I have 2 instances, default and mailtest:

[root@wardentest3 conf.d]# doveadm instance list
path
   name last used   
running
/var/run/dovecot/mailtest   
   mailtest 2012-05-11 10:57:16 
yes
/var/run/dovecot
   default  2012-05-11 10:54:09 
no

my doveconf -n for the mailtest instance:

# 2.1.6: mailtest/dovecot.conf
doveconf: Warning: service auth { client_limit=4096 } is lower than required 
under max. load (12288)
doveconf: Warning: service anvil { client_limit=4096 } is lower than required 
under max. load (12291)
# OS: Linux 2.6.32-220.13.1.el6.x86_64 x86_64 Red Hat Enterprise Linux Server 
release 6.2 (Santiago) nfs
auth_cache_negative_ttl = 0
auth_cache_size = 16 M
auth_gssapi_hostname = $ALL
auth_krb5_keytab = /etc/dovecot/mailtest/mail.combined.keytab
auth_master_user_separator = *
auth_mechanisms = plain login gssapi
auth_username_format = %Ln
base_dir = /var/run/dovecot/mailtest/
default_client_limit = 4096
default_process_limit = 4096
deliver_log_format = msgid=%m subject=%s from=%f size=%p result=%$
first_valid_uid = 0
hostname = mailtest.geneseo.edu
instance_name = mailtest
lda_mailbox_autocreate = yes
lda_mailbox_autosubscribe = yes
login_log_format_elements = user=%u method=%m rip=%r lip=%l lport=%a mpid=%e 
encryption=%c
mail_fsync = always
mail_location = 
maildir:/Mail/mailhome/%Ln/mailtest/Maildir:CONTROL=/Mail/mailhome/%Ln/mailtest/.dovecot-control:INDEX=/Mail/mailhome/%Ln/mailtest/.dovecot-index
mail_log_prefix = service=%s user=%u rip=%r 
mail_nfs_index = yes
mail_nfs_storage = yes
mail_plugins = zlib quota mail_log notify fts fts_squat stats
maildir_very_dirty_syncs = yes
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 ihave
mbox_write_locks = fcntl
mmap_disable = yes
namespace default {
  inbox = yes
  location = 
  mailbox Drafts {
auto = subscribe
special_use = \Drafts
  }
  mailbox Junk {
auto = no
special_use = \Junk
  }
  mailbox Sent {
auto = subscribe
special_use = \Sent
  }
  mailbox Trash {
auto = subscribe
special_use = \Trash
  }
  prefix = 
  separator = .
  subscriptions = yes
  type = private
}
namespace legacy {
  alias_for = 
  hidden = yes
  inbox = no
  list = no
  location = 
  mailbox INBOX.Drafts {
auto = no
special_use = \Drafts
  }
  mailbox INBOX.Junk {
auto = no
special_use = \Junk
  }
  mailbox INBOX.Sent {
auto = no
special_use = \Sent
  }
  mailbox INBOX.Trash {
auto = no
special_use = \Trash
  }
  prefix = INBOX.
  separator = .
  type = private
}
passdb {
  args = /etc/dovecot/passwd.masterusers
  driver = passwd-file
  master = yes
}
passdb {
  args = cache_key=%u dovecot
  driver = pam
}
plugin {
  fts = squat
  mail_log_events = delete undelete expunge copy mailbox_delete mailbox_rename 
flag_change append
  mail_log_fields = uid box msgid size from subject flags
  mail_log_group_events = yes
  quota = maildir:User quota
  quota_exceeded_message = Quota exceeded (mailbox for user is full). Please 
see http://go.geneseo.edu/emailoverquota for help deleting messages while over 
quota.
  quota_rule = *:storage=200M
  quota_rule2 = Trash:storage=+50M
  sieve = /Mail/mailhome/%Ln/mailtest/.filter.sieve
  sieve_dir = /Mail/mailhome/%Ln/mailtest/.sievedir
  

Re: [Dovecot] multi-instance doveadm user -m woes +WORKAROUND

2012-05-11 Thread David Warden
Some more investigation yielded this solution:

[root@wardentest3 conf.d]# doveadm -c /etc/dovecot/mailtest/dovecot.conf user 
-m warden
field   value
uid 73464
gid 1000
home/home/warden
mail
maildir:/Mail/mailhome/warden/mailtest/Maildir:CONTROL=/Mail/mailhome/warden/mailtest/.dovecot-control:INDEX=/Mail/mailhome/warden/mailtest/.dovecot-index

[root@wardentest3 conf.d]# doveadm -c /etc/dovecot/dovecot.conf user -m warden
field   value
uid 73464
gid 1000
home/home/warden
mail
maildir:/Mail/mailhome/warden/Maildir:CONTROL=/Mail/mailhome/warden/.dovecot:INDEX=/var/cache/dovecot/mailtestindexes/warden/.dovecot-index

So it seems to be a problem with the -i flag to doveadm.

I should note that neither -c or -i show up in my man pages or in the wiki. I'm 
always nervous about making changes to the wiki (especially if I'm unsure if 
something is a 2.1+ feature), but it would be nice to see these flags 
documented somewhere…

-David Warden

On May 11, 2012, at 11:06 AM, David Warden wrote:

 I'm having difficulty with the doveadm who command on a multi-instance setup 
 of dovecot. When I run the who command on the non-standard instance with the 
 -m flag (to see their mail location), this happens:
 
 [root@wardentest3 dovecot]# doveadm -i mailtest user -m warden
 doveadm(root): Error: user warden: Initialization failed: Namespace 'INBOX.': 
 Ambiguous mail location setting, don't know what to do with it: 
 /var/spool/mail/root (try prefixing it with mbox: or maildir:)
 
 I tried adding my mail_location setting as location to both of my legacy and 
 default namespaces, but got the same error.
 
 I also tried adding the -a flag like so:
 
 doveadm user -a /var/run/dovecot/mailtest/auth-userdb -m warden
 doveadm(root): Error: userdb lookup: connect(/var/run/dovecot/auth-userdb) 
 failed: Connection refused
 
 (the default instance is currently stopped)
 
 and combining -a and -i out of curiosity:
 
 [root@wardentest3 conf.d]# doveadm -i mailtest user -a 
 /var/run/dovecot/mailtest/auth-userdb -m warden
 doveadm(root): Error: user warden: Initialization failed: Namespace 'INBOX.': 
 Ambiguous mail location setting, don't know what to do with it: 
 /var/spool/mail/root (try prefixing it with mbox: or maildir:)
 
 I have 2 instances, default and mailtest:
 
 [root@wardentest3 conf.d]# doveadm instance list
 path  
  name last used   
 running
 /var/run/dovecot/mailtest 
  mailtest 2012-05-11 
 10:57:16 yes
 /var/run/dovecot  
  default  2012-05-11 
 10:54:09 no
 
 my doveconf -n for the mailtest instance:
 
 # 2.1.6: mailtest/dovecot.conf
 doveconf: Warning: service auth { client_limit=4096 } is lower than required 
 under max. load (12288)
 doveconf: Warning: service anvil { client_limit=4096 } is lower than required 
 under max. load (12291)
 # OS: Linux 2.6.32-220.13.1.el6.x86_64 x86_64 Red Hat Enterprise Linux Server 
 release 6.2 (Santiago) nfs
 auth_cache_negative_ttl = 0
 auth_cache_size = 16 M
 auth_gssapi_hostname = $ALL
 auth_krb5_keytab = /etc/dovecot/mailtest/mail.combined.keytab
 auth_master_user_separator = *
 auth_mechanisms = plain login gssapi
 auth_username_format = %Ln
 base_dir = /var/run/dovecot/mailtest/
 default_client_limit = 4096
 default_process_limit = 4096
 deliver_log_format = msgid=%m subject=%s from=%f size=%p result=%$
 first_valid_uid = 0
 hostname = mailtest.geneseo.edu
 instance_name = mailtest
 lda_mailbox_autocreate = yes
 lda_mailbox_autosubscribe = yes
 login_log_format_elements = user=%u method=%m rip=%r lip=%l lport=%a mpid=%e 
 encryption=%c
 mail_fsync = always
 mail_location = 
 maildir:/Mail/mailhome/%Ln/mailtest/Maildir:CONTROL=/Mail/mailhome/%Ln/mailtest/.dovecot-control:INDEX=/Mail/mailhome/%Ln/mailtest/.dovecot-index
 mail_log_prefix = service=%s user=%u rip=%r 
 mail_nfs_index = yes
 mail_nfs_storage = yes
 mail_plugins = zlib quota mail_log notify fts fts_squat stats
 maildir_very_dirty_syncs = yes
 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 ihave
 mbox_write_locks = fcntl
 mmap_disable = yes
 namespace default {
  inbox = yes
  location = 
  mailbox Drafts {
auto = subscribe
special_use = \Drafts
  }
  mailbox Junk {
auto = no
special_use = \Junk
  }
  mailbox Sent {
auto = subscribe
special_use = \Sent
  }
  mailbox Trash {
auto = subscribe
special_use = \Trash
  }
  prefix = 
  separator = .
  subscriptions = yes
  type = private
 }
 namespace 

[Dovecot] namespace from snapshots

2012-05-11 Thread Karl Oulmi

hi all,

I'm trying to give access to snapshots taken from by dell iscsi MD3200i 
to my maildirs users.


snapshot are mounted in read only mode from my FreeBSD box.

In my /usr/local/etc/dovecot/conf.d/10-mail.conf, I have :

namespace inbox {
   inbox = yes
}

namespace da1 {
prefix = INBOX.backup.da1.
hidden = no
list = yes
inbox = no
location = maildir:/da1/%u/Maildir
type = private
}


I have two problems :
- In my log, dovecot complain about the fact that my snapshot filsystem 
is read only
Error: open(/da1/te...@toto.com/Maildir/.Trash/dovecot-uidlist) failed: 
Read-only file system


The second problem is that through my thunderbird I can't see the Inbox 
saved in the snapshot (whereas I see Sent and Trash folders)


If anyone could help me, It would be nice.

Regard,
Karl.









smime.p7s
Description: S/MIME Cryptographic Signature


Re: [Dovecot] index IO patterns

2012-05-11 Thread Timo Sirainen
On 11.5.2012, at 13.56, Javier de Miguel Rodríguez wrote:

 Even without LDA/LMTP dovecot-imap needs to write right? It would
 need to update the index every time an imap connect happens and
 new mails are found in the mail store.
 
 Well of course. Indexes are also updated when flags are modified, moved a 
 messages, delete a message, etc.. But in my setup there are 65% reads and the 
 rest writes


There are several hard coded values related to read/write percentages. If 
you're interested you could try if changing them increases the read%:

mail-index-private.h:

/* Write to main index file when bytes-to-be-read-from-log is between these
   values. */
#define MAIL_INDEX_MIN_WRITE_BYTES (1024*8)
#define MAIL_INDEX_MAX_WRITE_BYTES (1024*128)

mail-cache-private.h:

/* Never compress the file if it's smaller than this */
#define MAIL_CACHE_COMPRESS_MIN_SIZE (1024*50)

/* Compress the file when deleted space reaches n% of total size */
#define MAIL_CACHE_COMPRESS_PERCENTAGE 20

/* Compress the file when n% of rows contain continued rows.
   200% means that there's 2 continued rows per record. */
#define MAIL_CACHE_COMPRESS_CONTINUED_PERCENTAGE 200

Increasing this might also improve read performance, compat.h:

/* Try to keep IO operations at least this size */
#ifndef IO_BLOCK_SIZE
#  define IO_BLOCK_SIZE 8192
#endif

All of these are just runtime checks (not saved anywhere), so there's no danger 
in changing them.

Re: [Dovecot] Postfix Query

2012-05-11 Thread Tim
user_query = SELECT maildir, mailuser as uid, mailgroup as
gid,concat('*:bytes=',quota) as quota_rule FROM virtual_mailbox WHERE
username = '%u'

and maildir should return example.com/subdomain/tim for this particular
user

What does your user_query look like in dovecot-sql.conf.ext?


On 2012-05-10 17:13, Tim wrote:
 Hello,

 Another question!!

 Was just trying to sort out mail delivery to subdomains. I set up my
 system so that I have a mail address of tim at subdomain.example.com. 
 I've
 sorted out Postfix to correctly identify this and pass on to Dovecot 
 for
 delivery but Dovecot doesn't seem to deliver where I want it to. 
 Ideally
 I would like to have a structure so that mail is delivered to

 /var/mail/example.com/subdomain/user

 My users are stored in MySQL and they are being pulled out correctly,
 but dovecot is delivering to

 /var/mail/subdomain.example.com/tim

 Looking at my logs it seems that the mail location is being picked up
 not being acted on...

 May 10 21:51:20 auth(default): Info: master out: USER1
 
 tim at subdomain.example.com maildir=example.com/subdomain/tim   
 uid=mailuser
 gid=mailgroupquota_rule=*:bytes=2147483647

 ...a bit further down...

 May 10 21:51:20 deliver(tim at subdomain.example.com): Info: auth input:
 maildir=example.com/subdomain/tim

 ...then further down it seems to change all of a sudden...

 May 10 21:51:20 deliver(tim at subdomain.example.com): Info: maildir:
 data=/var/mail/subdomain.example.com/tim/Maildir
 May 10 21:51:20 deliver(tim at subdomain.example.com): Info: maildir++:
 root=/var/mail/subdomain.example.com/tim/Maildir, index=, control=,
 inbox=/var/mail/subdomain.example.com/tim/Maildir

 Bit confused! Any help would be appreciated!

 Cheers,

 Tim


Re: [Dovecot] index IO patterns

2012-05-11 Thread Stan Hoeppner
On 5/11/2012 1:41 AM, Cor Bosman wrote:
 Hey all, we're in the process of checking out alternatives to our index 
 storage.  We're currently storing indexes on a NetApp Metrocluster which 
 works fine, but is very expensive. We're planning a few different setups and 
 doing some actual performance tests on them.  

Hi Cor,

 Does anyone know some of the IO patterns of the indexes? For instance:
 
 - mostly random reads or linear reads/writes? 
 - average size of reads and writes?
 - how many read/writes on average for a specific mailbox size?
 
 Anyone do any measurements of this kind?

Mail is always a random IO workload, unless your mailbox count is 1,
whether accessing indexes or mail files.  Regarding the other two
questions, you'll likely need to take your own measurements.

 Alternatively, does anyone have any experience with other redundant storage 
 options? Im thinking things like MooseFS, DRBD, etc? 

You seem to be interested in multi-site clustering/failover solutions,
not simply redundant storage.  These two are clustering software
solutions but DRBD is not suitable for multi-site use, and MooseFS
doesn't seem to be either.  MooseFS is based heavily on FUSE, so
performance will be far less than optimal.  MooseFS is a distributed
filesystem, and as with all other distributed/cluster filesystems its
metadata performance will suffer, eliminating maildir as a mail store
option.

Can you provide more specifics on your actual storage architecture needs?

-- 
Stan