lmtp seg fault

2015-11-12 Thread Robert Blayzor

dovecot -n
# 2.2.19: /usr/local/etc/dovecot/dovecot.conf
# Pigeonhole version 0.4.9 (357ac0a0e68b+)
# OS: FreeBSD 10.2-RELEASE-p7 amd64
doveconf: Warning: Dovecot was last started using /etc/dovecot/dovecot.conf, 
but this config is /usr/local/etc/dovecot/dovecot.conf
auth_cache_size = 10 M
auth_cache_ttl = 5 mins
auth_mechanisms = plain login
auth_socket_path = /var/run/dovecot/auth-userdb
auth_verbose = yes
auth_worker_max_count = 10
base_dir = /var/run/dovecot/
default_client_limit = 2000
default_process_limit = 200
disable_plaintext_auth = no
first_valid_uid = 25
imap_idle_notify_interval = 4 mins
log_timestamp = "%Y-%m-%d %H:%M:%S "
login_greeting = Ready to serve.
mail_fsync = always
mail_location = maildir:~/Maildir
mail_nfs_index = yes
mail_nfs_storage = yes
mail_plugins = zlib quota
mail_temp_dir = /var/tmp
mailbox_list_index = yes
maildir_very_dirty_syncs = yes
managesieve_sieve_capability = fileinto reject envelope encoded-character 
vacation subaddress comparator-i;ascii-numeric relational regex imap4flags copy 
include variables body environment mailbox date index ihave duplicate
mbox_write_locks = fcntl
mmap_disable = yes
namespace inbox {
  inbox = yes
  location =
  mailbox Archive {
auto = subscribe
special_use = \Archive
  }
  mailbox Drafts {
auto = subscribe
special_use = \Drafts
  }
  mailbox Junk {
auto = subscribe
special_use = \Junk
  }
  mailbox Sent {
auto = subscribe
special_use = \Sent
  }
  mailbox Trash {
auto = subscribe
special_use = \Trash
  }
  prefix =
  separator = /
}
passdb {
  args = /etc/dovecot/dovecot-sql.conf
  driver = sql
}
plugin {
  quota = maildir:User quota
  quota_exceeded_message = Quota exceeded (Mailbox is full)
  quota_rule = *:storage=1G
  quota_rule2 = Trash:ignore
  sieve = ~/.dovecot.sieve
  sieve_default = /etc/dovecot/sieve/global/JunkFolder.sieve
  sieve_dir = ~/.sieve
  sieve_extensions = -enotify
  sieve_global_dir = /etc/dovecot/sieve/global/
  zlib_save = xz
  zlib_save_level = 6
}
pop3_fast_size_lookups = yes
pop3_save_uidl = yes
protocols = imap pop3 lmtp sieve
rejection_reason = Your message to <%t> was rejected:%n%n   %r%n
rejection_subject = [BOUNCE] %s
service imap-login {
  inet_listener imap {
port = 143
  }
  process_min_avail = 4
  service_count = 100
}
service imap {
  executable = imap last-login
}
service last-login {
  executable = script-login /etc/dovecot/post-login.sh
  user = mailnull
}
service lmtp {
  process_min_avail = 4
  unix_listener lmtp {
mode = 0666
  }
  user = mailnull
}
service managesieve-login {
  inet_listener sieve {
port = 4190
  }
  service_count = 1
}
service managesieve {
  process_limit = 100
}
service pop3-login {
  inet_listener pop3 {
port = 110
  }
  process_min_avail = 4
  service_count = 100
}
service pop3 {
  executable = pop3 last-login
}
ssl = no
ssl_cipher_list = ALL:!SSLv2:!LOW:!ADH:!NULL:!DES:@STRENGTH
ssl_protocols = !SSLv2 !SSLv3
submission_host = localhost:25
userdb {
  driver = prefetch
}
userdb {
  args = /etc/dovecot/dovecot-sql.conf
  driver = sql
}
protocol lmtp {
  mail_plugins = zlib quota sieve
}
protocol lda {
  mail_plugins = zlib quota
}
protocol imap {
  mail_max_userip_connections = 8
  mail_plugins = zlib quota imap_quota
}
protocol pop3 {
  mail_max_userip_connections = 2
  mail_plugins = zlib quota
}
protocol sieve {
  mail_max_userip_connections = 3
  managesieve_implementation_string = Dovecot
  managesieve_max_line_length = 65536
}




GNU gdb 6.1.1 [FreeBSD]
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "amd64-marcel-freebsd"...(no debugging symbols 
found)...
Core was generated by `lmtp'.
Program terminated with signal 11, Segmentation fault.
Reading symbols from /usr/local/lib/dovecot/libdovecot-lda.so.0...(no debugging 
symbols found)...done.
Loaded symbols for /usr/local/lib/dovecot/libdovecot-lda.so.0
Reading symbols from /usr/local/lib/dovecot/libdovecot-storage.so.0...(no 
debugging symbols found)...done.
Loaded symbols for /usr/local/lib/dovecot/libdovecot-storage.so.0
Reading symbols from /usr/local/lib/dovecot/libdovecot.so.0...(no debugging 
symbols found)...done.
Loaded symbols for /usr/local/lib/dovecot/libdovecot.so.0
Reading symbols from /lib/libc.so.7...(no debugging symbols found)...done.
Loaded symbols for /lib/libc.so.7
Reading symbols from /usr/local/lib/dovecot/lib10_quota_plugin.so...(no 
debugging symbols found)...done.
Loaded symbols for /usr/local/lib/dovecot/lib10_quota_plugin.so
Reading symbols from /usr/local/lib/dovecot/lib20_zlib_plugin.so...(no 
debugging symbols found)...done.
Loaded symbols for /usr/local/lib/dovecot/lib20_zlib_plugin.so
Reading symbols from /lib/libz.so.6...(no debugg

Re: How to Restore emails

2015-11-12 Thread Mark Foley
Thanks for the reply Heiko

> About the 'cur' I'd not be too sure.

Well, I'm just restoring to .Deleted Items, so it shouldn't be a problem. The 
tar restore
should preserve names, permission, etc. I'll backup the current Maildir, the 
try the restore
and see what happens. I'll report back.

--Mark

-Original Message-
> Date: Thu, 12 Nov 2015 23:36:52 +0100
> From: Heiko Schlittermann 
> To: dovecot@dovecot.org
> Subject: Re: How to Restore emails
>
> Hi,
>
> Mark Foley  (Do 12 Nov 2015 23:31:39 CET):
> > According to a message to this list from Oli Schacher, 
> > http://www.dovecot.org/list/dovecot/2011-June/059493.html, all I need to do 
> > is copy the deleted
> > emails to their original folder and dovecot will take care of it:
> > 
> ???
> > > exactly, just copy the mail from your backup back into the users
> > > maildir (usually into 'cur'). Make sure the permissions of the restored
> > > file are correct. No need to synchronize anything, dovecot automatically
> > > detects the added message. 
>
> About the 'cur' I'd not be too sure. If you *mv* the files there from a
> directory on the same filesystem, you should be fine, but if copy the
> files, I'd be careful. Probably you want to mimic the maildir behaviour:
>
> copy the files to tmp/
> mv the files to cur/ (not sure, if new/ would be fine to,
>   because new/ is the natural place after
>   tmp/. I'm not sure, what this does to the
>   message state the client sees.)
>  
> Best regards from Dresden/Germany
> Viele Grüße aus Dresden
> Heiko Schlittermann
> -- 
>  SCHLITTERMANN.de  internet & unix support -
>  Heiko Schlittermann, Dipl.-Ing. (TU) - {fon,fax}: +49.351.802998{1,3} -
>  gnupg encrypted messages are welcome --- key ID: F69376CE -
>  ! key id 7CBF764A and 972EAC9F are revoked since 2015-01  -


Re: How to Restore emails

2015-11-12 Thread Heiko Schlittermann
Hi,

Mark Foley  (Do 12 Nov 2015 23:31:39 CET):
> According to a message to this list from Oli Schacher, 
> http://www.dovecot.org/list/dovecot/2011-June/059493.html, all I need to do 
> is copy the deleted
> emails to their original folder and dovecot will take care of it:
> 
…
> > exactly, just copy the mail from your backup back into the users
> > maildir (usually into 'cur'). Make sure the permissions of the restored
> > file are correct. No need to synchronize anything, dovecot automatically
> > detects the added message. 

About the 'cur' I'd not be too sure. If you *mv* the files there from a
directory on the same filesystem, you should be fine, but if copy the
files, I'd be careful. Probably you want to mimic the maildir behaviour:

copy the files to tmp/
mv the files to cur/ (not sure, if new/ would be fine to,
  because new/ is the natural place after
  tmp/. I'm not sure, what this does to the
  message state the client sees.)
 
Best regards from Dresden/Germany
Viele Grüße aus Dresden
Heiko Schlittermann
-- 
 SCHLITTERMANN.de  internet & unix support -
 Heiko Schlittermann, Dipl.-Ing. (TU) - {fon,fax}: +49.351.802998{1,3} -
 gnupg encrypted messages are welcome --- key ID: F69376CE -
 ! key id 7CBF764A and 972EAC9F are revoked since 2015-01  -


signature.asc
Description: Digital signature


Re: How to Restore emails

2015-11-12 Thread Mark Foley
According to a message to this list from Oli Schacher, 
http://www.dovecot.org/list/dovecot/2011-June/059493.html, all I need to do is 
copy the deleted
emails to their original folder and dovecot will take care of it:

On Tue Jun 7 08:43:54 EEST 2011 Oli Schacher wrote:
>> OK, but if I want to restore a particular mail from backups, what're
>> the steps involved? What I mean is do I just copy and paste that mail
>> file from backups to the user account maildir folder and what program
>> should I run to synchronize it.
> 
>
> exactly, just copy the mail from your backup back into the users
> maildir (usually into 'cur'). Make sure the permissions of the restored
> file are correct. No need to synchronize anything, dovecot automatically
> detects the added message. 

Unless someone out there advises me against doing this, I'm going to try it.

I've also seen `dovadm import` as a possible suggestion, though if a simple 
copy works I don't
see why anyone would use `dovadm import`.

--Mark

-Original Message-
From: Mark Foley 
Date: Thu, 12 Nov 2015 17:13:50 -0500
To: dovecot@dovecot.org
Subject: How to Restore emails

I have a user who accidentially deleted a large number of emails prior to a 
certain date.  He
wants them back.  I do have a tarfile backup of these messages.  Is there a 
good way to restore
them? Can I simply restore them to the appropriate Maildir directory and 
dovecot will just
"figure it out"?

Thanks, --Mark


Re: fail: doveadm backup -s "" with a huuge number of mailboxes

2015-11-12 Thread Heiko Schlittermann
Timo Sirainen  (Do 12 Nov 2015 23:12:21 CET):
…
> > The user has about 4501 IMAP folders. This makes a huge
> > state output of about 128 kB. This in turn leads to an overly long
> > command line in the next iteration. (excuse: command line too long)
> > 
> > Is there any chance to solve this? I think, the only possibility would
> > be to have doveadm-backup -s read the state from a *file*, wouldn't it?
> 
> Right now no way to read it from a file. But is this Linux? I thought Linux 
> had unlimited (or at least very large) command line length nowadays.


Yes, the product of size and number of the arguments is limited:

*** 189961 args (10 chars each) with total length 1899610
***  99503 args (20 chars each) with total length 1990060
***   2087 args (  1000 chars each) with total length 2087000
*** 16 args (128000 chars each) with total length 2048000

The upper limit for the sum of parameters seems to be ~2 MB

But,

 x127=$(perl -e 'print "x" x (127 * 2**10)')# 127 KB 
 x128=$(perl -e 'print "x" x (128 * 2**10)')# 128 KB

 /bin/echo $x127# works
 /bin/echo $x127 $x127  # works

 /bin/echo $x128# breaks
 /bin/echo $x128 $x128  # breaks

It seems that a *single* command line parameter is limited to somewhat
near 128 kB. The complete amount of command line data is near 2 MB.

Conclusion: doveadm sync should be able to read a state *file*. IMHO

Best regards from Dresden/Germany
Viele Grüße aus Dresden
Heiko Schlittermann
-- 
 SCHLITTERMANN.de  internet & unix support -
 Heiko Schlittermann, Dipl.-Ing. (TU) - {fon,fax}: +49.351.802998{1,3} -
 gnupg encrypted messages are welcome --- key ID: F69376CE -
 ! key id 7CBF764A and 972EAC9F are revoked since 2015-01  -


signature.asc
Description: Digital signature


How to Restore emails

2015-11-12 Thread Mark Foley
I have a user who accidentially deleted a large number of emails prior to a 
certain date.  He
wants them back.  I do have a tarfile backup of these messages.  Is there a 
good way to restore
them? Can I simply restore them to the appropriate Maildir directory and 
dovecot will just
"figure it out"?

Thanks, --Mark


Re: fail: doveadm backup -s "" with a huuge number of mailboxes

2015-11-12 Thread Timo Sirainen
On 12 Nov 2015, at 12:56, Heiko Schlittermann  wrote:
> 
> Hello,
> 
> I'm using 2.2.13.
> 
> For syncing I'm using repetitions of about the
> following (simplified for readability):
> 
>state_file=.s
>doveadm \
>-o imapc_master_user= \
>-o imapc_password=  \
>-o imapc_host=\
>-o mail_fsync=never \
>backup -s "$(<.s)" -u "" -R imapc: >.s_new
>mv .s_new .s
> 
> The user has about 4501 IMAP folders. This makes a huge
> state output of about 128 kB. This in turn leads to an overly long
> command line in the next iteration. (excuse: command line too long)
> 
> Is there any chance to solve this? I think, the only possibility would
> be to have doveadm-backup -s read the state from a *file*, wouldn't it?

Right now no way to read it from a file. But is this Linux? I thought Linux had 
unlimited (or at least very large) command line length nowadays.


FTS, multiple virtualmailbox entries for single mailbox

2015-11-12 Thread Frank de Bot (lists)
Hi,

i have a dovecot setup with virtual users. Each user has 2 entries for
his mailbox. One is with the username formatted as
%username%@%default_realm%  , the other %username%@%domain%

I've done some tests with it, but I don't complete understand how it works
 - I've emptied all document in solr so it empty. Doveadm is instructed
to do the same with 'doveadm -D -v fts rescan -A'
 - I reindex %username%@%default_realm% with 'doveadm -D index -u
%username%@%default_realm% '*'
 - With fluke I can see 4 indexes documents.
 - I reindex %username%@%domain%
 - No documents are added to Solr, dovecot finds it's up-to-date
 - After 'doveadm -D -v fts rescan -A' the documents are added

The part I don't understand is that a certain key  used for indexing,
but dovecot checks based on something else. If find this inconsistent.

How can I manage to get virtualmailboxes where multiple logins are
allowed on 1 mailbox and FTS is working? I think it won't work well this
way if a user logs in with only a certain username with the default
realm. Message received by dovecot will be indexed in Solr with
%username%@%domain% , but there will be no indexed documents for
%username%@%default_realm%

A earlier threads suggested to be able to override the username for FTS,
but it was tought to be not a good idea.


Regards,

Frank de Bot


fail: doveadm backup -s "" with a huuge number of mailboxes

2015-11-12 Thread Heiko Schlittermann
Hello,

I'm using 2.2.13.

For syncing I'm using repetitions of about the
following (simplified for readability):

state_file=.s
doveadm \
-o imapc_master_user= \
-o imapc_password=  \
-o imapc_host=\
-o mail_fsync=never \
backup -s "$(<.s)" -u "" -R imapc: >.s_new
mv .s_new .s

The user has about 4501 IMAP folders. This makes a huge
state output of about 128 kB. This in turn leads to an overly long
command line in the next iteration. (excuse: command line too long)

Is there any chance to solve this? I think, the only possibility would
be to have doveadm-backup -s read the state from a *file*, wouldn't it?

(Apart from the fact that I do not see a manpage for this, except
entries in the Wiki (but this may be due to poor packaging) of the
Debian dovecot package.)

Best regards from Dresden/Germany
Viele Grüße aus Dresden
Heiko Schlittermann
-- 
 SCHLITTERMANN.de  internet & unix support -
 Heiko Schlittermann, Dipl.-Ing. (TU) - {fon,fax}: +49.351.802998{1,3} -
 gnupg encrypted messages are welcome --- key ID: F69376CE -
 ! key id 7CBF764A and 972EAC9F are revoked since 2015-01  -


signature.asc
Description: Digital signature


Re: Problems after upgrade from 2.0 to 2.2

2015-11-12 Thread Christian Kivalo



On 2015-11-12 09:33, Frank Rust wrote:

Thanks a lot!

This was added by a new debian package file! They added the
15-mailboxes.conf file with this input-namespace.
It’s a bad thing. For changed configuration the installer asks which
version, old or new to take, but new files are installed without
confirmation. But that’s a debian problem, not dovecot.


The 15-mailboxes.conf is also present when you compile dovecot yourself.


Best regards,
Frank

regards
christian


Re: Problems after upgrade from 2.0 to 2.2

2015-11-12 Thread Frank Rust
Thanks a lot! 

This was added by a new debian package file! They added the 15-mailboxes.conf 
file with this input-namespace. 
It’s a bad thing. For changed configuration the installer asks which version, 
old or new to take, but new files are installed without confirmation. But 
that’s a debian problem, not dovecot. 

Best regards,
Frank


> Am 12.11.2015 um 08:58 schrieb Christian Kivalo :
> 
> Hi,
> 
> On 2015-11-12 08:03, Frank Rust wrote:
>> Hi all,
>> after upgrade from some 2.0 version to 2.2.19 (debian) i face map
>> login problems:
>> # doveconf -n
>> # 2.2.19 (ca91d540fd87): /etc/dovecot/dovecot.conf
>> # Pigeonhole version 0.4.9
>> # OS: Linux 2.6.32-5-amd64 x86_64 Debian 8.2 ext4
>> auth_debug = yes
>> auth_debug_passwords = yes
>> auth_verbose = yes
>> auth_verbose_passwords = plain
>> debug_log_path = /var/log/dovecot-debug.log
>> hostname = test.my.domain.de
>> info_log_path = /var/log/dovecot.log
>> mail_access_groups = smmta
>> mail_debug = yes
>> mail_location =
>> mbox:/extra/mail/mbox.dir/%u/mailboxes:DIRNAME=mBoX-MeSsAgEs:INDEX=/extra/mail/mbox.dir/%u/index:CONTROL=/extra/mail/mbox.dir/%u/control:INBOX=/extra/mail/%u
>> mail_plugins = quota
>> mail_privileged_group = smmta
>> 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 index ihave duplicate
>> namespace inbox {
>>  location =
>>  mailbox Drafts {
>>special_use = \Drafts
>>  }
>>  mailbox Junk {
>>special_use = \Junk
>>  }
>>  mailbox Sent {
>>special_use = \Sent
>>  }
>>  mailbox "Sent Messages" {
>>special_use = \Sent
>>  }
>>  mailbox Trash {
>>special_use = \Trash
>>  }
>>  prefix =
>> }
> 
> Missing inbox = yes in your default namespace.
> 
> See wiki http://wiki2.dovecot.org/Namespaces
> 
>> passdb {
>>  driver = pam
>> }
>> plugin {
>>  mail_log_events = delete undelete expunge copy mailbox_delete
>> mailbox_rename flag_change append
>>  quota = fs:User quota
>>  quota_rule = *:storage=1G
>>  quota_rule2 = Trash:storage=+100M
>>  quota_warning = storage=95%% quota-warning 95 %u
>>  quota_warning2 = storage=80%% quota-warning 80 %u
>>  sieve = file:~/sieve;active=~/.dovecot.sieve
>> }
>> postmaster_address = postmas...@my.domain.de
>> protocols = " imap sieve pop3"
>> quota_full_tempfail = yes
>> ssl = required
>> ssl_cert = > ssl_cipher_list =
>> EECDH+ECDSA+AESGCM:EECDH+aRSA+AESGCM:EECDH+ECDSA+SHA256:EECDH+aRSA+RC4:EDH+aRSA
>> EECDH RC4:!aNULL:!eNULL:!LOW:!3DES:!MD5:!EXP:!PSK:!SRP:!DSS
>> ssl_key = > ssl_prefer_server_ciphers = yes
>> ssl_protocols = !SSLv2 !SSLv3
>> userdb {
>>  driver = passwd
>> }
>> verbose_ssl = yes
>> protocol lda {
>>  mail_plugins =
>> }
> 
> [ snip ]
> 
>> Nov 12 07:47:27 imap(frank): Debug: Namespace inbox: type=private,
>> prefix=, sep=, inbox=no, hidden=no, list=yes, subscriptions=yes
>   
> inbox not set.
> 
>> location=mbox:/extra/mail/mbox.dir/frank/mailboxes:DIRNAME=mBoX-MeSsAgEs:INDEX=/extra/mail/mbox.dir/frank/index:CONTROL=/extra/mail/mbox.dir/frank/control:INBOX=/extra/mail/frank
>> Nov 12 07:47:27 imap(frank): Debug: fs:
>> root=/extra/mail/mbox.dir/frank/mailboxes,
>> index=/extra/mail/mbox.dir/frank/index, indexpvt=,
>> control=/extra/mail/mbox.dir/frank/control, inbox=/extra/mail/frank,
>> alt=
>> Nov 12 07:47:27 imap(frank): Debug: fs quota add mailbox dir =
>> /extra/mail/mbox.dir/frank/mailboxes
>> Nov 12 07:47:27 imap(frank): Debug: fs quota block device =
>> /dev/mapper/ownCloudVG-ownCloudData
>> Nov 12 07:47:27 imap(frank): Debug: fs quota mount point = /extra
>> Nov 12 07:47:27 imap(frank): Debug: fs quota mount type = ext4
>> Nov 12 07:47:27 imap-login: Debug: SSL alert: close notify [134.169.39.105]
>> What could cause the problem?
>> The problem is not quota related (I enhanced the allowed quota and got
>> the same results)
>> best regards,
>> Frank
> 
> regards
> christian