Re: Auto-archiving

2016-10-05 Thread Aki Tuomi

> On October 6, 2016 at 8:05 AM "@lbutlr"  wrote:
> 
> 
> I’d like to know if there is a way to tell dovecot to
> 
> 1) move messages older than # days to the Archive folder
> 2) rebuild the indexes
> 3) remove any folders that are left with no mail
> 
> Preferably, I’d like this to be a action I an schedule via crontab or 
> something to fire off for any users that want it. So, I do not want it to do 
> this across all users and mailboxes.

Have you tried doveadm move? 

Aki


Auto-archiving

2016-10-05 Thread @lbutlr
I’d like to know if there is a way to tell dovecot to

1) move messages older than # days to the Archive folder
2) rebuild the indexes
3) remove any folders that are left with no mail

Preferably, I’d like this to be a action I an schedule via crontab or something 
to fire off for any users that want it. So, I do not want it to do this across 
all users and mailboxes.


Re: [imap-login] SSL related crashes using the latest 2.2.25

2016-10-05 Thread Aki Tuomi
It seems to error on ssl certificate not received. 

Can you post doveconf -n and logs?

doveconf -a is usually not wanted.

Aki

> On October 6, 2016 at 7:27 AM Adi Pircalabu  wrote:
> 
> 
> I'm running Dovecot as proxy in front of some IMAP/POP3 Dovecot & 
> Courier-IMAP servers and in the last couple of days I've been seeing a 
> lot of imap-login crashes (signal 11) on both 2.2.18 and 2.2.25, all SSL 
> related. The following backtraces are taken running 2.2.25, built from 
> source on a test system similar to the live proxy servers.
> OS: CentOS 6.8 64bit
> Packages: openssl-1.0.1e-48.el6_8.3.x86_64, dovecot-2.2.25-2.el6.x86_64 
> built from source RPM.
> 
> Can post "doveconf -a" if required.
> 
> Core was generated by `dovecot/imap-login -D'.
> Program terminated with signal 11, Segmentation fault.
> #0  ssl_proxy_has_broken_client_cert (proxy=0x0) at 
> ssl-proxy-openssl.c:677
> 677   {
> (gdb) bt full
> #0  ssl_proxy_has_broken_client_cert (proxy=0x0) at 
> ssl-proxy-openssl.c:677
> No locals.
> #1  0x7fdec4e6b489 in login_proxy_ssl_handshaked (context=0x14b4170) 
> at login-proxy.c:759
>  proxy = 0x14b4170
> #2  0x7fdec4e70e4b in ssl_handshake (proxy=0x169d7b0) at 
> ssl-proxy-openssl.c:468
>  ret = 
> #3  ssl_step (proxy=0x169d7b0) at ssl-proxy-openssl.c:519
> No locals.
> #4  0x7fdec4beee0b in io_loop_call_io (io=0x13fdab0) at ioloop.c:564
>  ioloop = 0x12a07b0
>  t_id = 2
>  __FUNCTION__ = "io_loop_call_io"
> #5  0x7fdec4bf0407 in io_loop_handler_run_internal (ioloop= optimized out>) at ioloop-epoll.c:220
>  ctx = 0x12fb8d0
>  events = 
>  event = 0x171fb20
>  list = 0x15f8c50
>  io = 
>  tv = {tv_sec = 46, tv_usec = 134490}
>  events_count = 
>  msecs = 
>  ret = 1
>  i = 
>  call = 
>  __FUNCTION__ = "io_loop_handler_run_internal"
> #6  0x7fdec4beeeb5 in io_loop_handler_run (ioloop=0x12a07b0) at 
> ioloop.c:612
> No locals.
> #7  0x7fdec4bef058 in io_loop_run (ioloop=0x12a07b0) at ioloop.c:588
>  __FUNCTION__ = "io_loop_run"
> #8  0x7fdec4b81b23 in master_service_run (service=0x12a0650, 
> callback=) at master-service.c:640
> No locals.
> #9  0x7fdec4e6e593 in login_binary_run (binary= out>, argc=2, argv=0x12a0390) at main.c:486
>  set_pool = 0x12a0b80
>  login_socket = 
>  c = 
> #10 0x7fdec47dad1d in __libc_start_main (main=0x402ac0 , 
> argc=2, ubp_av=0x7ffc53ee5688, init=, fini= optimized out>, rtld_fini=, 
> stack_end=0x7ffc53ee5678) at libc-start.c:226
>  result = 
>  unwind_buf = {cancel_jmp_buf = {{jmp_buf = {0, 
> 5496455093114277129, 4204960, 140721716614784, 0, 0, 
> -5494405746439844599, -5477823887334535927}, mask_was_saved = 0}}, priv 
> = {pad = {0x0, 0x0, 0x404f70, 0x7ffc53ee5688}, data = {
>prev = 0x0, cleanup = 0x0, canceltype = 4214640}}}
>  not_first_call = 
> #11 0x004029c9 in _start ()
> No symbol table info available.
> 
> Core was generated by `dovecot/imap-login -D'.
> Program terminated with signal 11, Segmentation fault.
> #0  0x7f1a58620dec in _IO_vfprintf_internal (s= out>, format=, ap=) at 
> vfprintf.c:1641
> 1641process_string_arg (((struct printf_spec *) NULL));
> (gdb) bt full
> #0  0x7f1a58620dec in _IO_vfprintf_internal (s= out>, format=, ap=) at 
> vfprintf.c:1641
>  len = 
>  string_malloced = 
>  step0_jumps = {0, -1285, -1198, 3818, 3910, 3206, 3307, 4086, 
> 1925, 2133, 2249, 3731, 4474, -4059, -1109, -1062, 868, 956, 968, 980, 
> -1505, -495, 665, 755, 827, -3962, 395, 4392, -4059, 3997}
>  space = 0
>  is_short = 0
>  use_outdigits = 0
>  step1_jumps = {0, 0, 0, 0, 0, 0, 0, 0, 0, 2133, 2249, 3731, 
> 4474, -4059, -1109, -1062, 868, 956, 968, 980, -1505, -495, 665, 755, 
> 827, -3962, 395, 4392, -4059, 0}
>  group = 0
>  prec = -1
>  step2_jumps = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2249, 3731, 4474, 
> -4059, -1109, -1062, 868, 956, 968, 980, -1505, -495, 665, 755, 827, 
> -3962, 395, 4392, -4059, 0}
>  string = 
>  left = 0
>  is_long_double = 0
>  width = 0
>  step3a_jumps = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2336, 0, 0, 0, 
> -1109, -1062, 868, 956, 968, 0, 0, 0, 0, 755, 0, 0, 0, 0, 0, 0}
>  alt = 0
>  showsign = 0
>  is_long = 0
>  is_char = 0
>  pad = 32 ' '
>  step3b_jumps = {0 , 4474, 0, 0, -1109, -1062, 
> 868, 956, 968, 980, -1505, -495, 665, 755, 827, -3962, 395, 0, 0, 0}
>  step4_jumps = {0 , -1109, -1062, 868, 956, 
> 968, 980, -1505, -495, 665, 755, 827, -3962, 395, 0, 0, 0}
>  is_negative = 
>  base = 
>  the_arg = {pa_wchar = 0 L'\000', pa_int = 0, pa_long_int = 0, 
> pa_long_long_int = 0, pa_u_int = 0, pa_u_long_int = 0, 
> pa_u_long_long_int = 0, pa_double = 

[imap-login] SSL related crashes using the latest 2.2.25

2016-10-05 Thread Adi Pircalabu
I'm running Dovecot as proxy in front of some IMAP/POP3 Dovecot & 
Courier-IMAP servers and in the last couple of days I've been seeing a 
lot of imap-login crashes (signal 11) on both 2.2.18 and 2.2.25, all SSL 
related. The following backtraces are taken running 2.2.25, built from 
source on a test system similar to the live proxy servers.

OS: CentOS 6.8 64bit
Packages: openssl-1.0.1e-48.el6_8.3.x86_64, dovecot-2.2.25-2.el6.x86_64 
built from source RPM.


Can post "doveconf -a" if required.

Core was generated by `dovecot/imap-login -D'.
Program terminated with signal 11, Segmentation fault.
#0  ssl_proxy_has_broken_client_cert (proxy=0x0) at 
ssl-proxy-openssl.c:677

677 {
(gdb) bt full
#0  ssl_proxy_has_broken_client_cert (proxy=0x0) at 
ssl-proxy-openssl.c:677

No locals.
#1  0x7fdec4e6b489 in login_proxy_ssl_handshaked (context=0x14b4170) 
at login-proxy.c:759

proxy = 0x14b4170
#2  0x7fdec4e70e4b in ssl_handshake (proxy=0x169d7b0) at 
ssl-proxy-openssl.c:468

ret = 
#3  ssl_step (proxy=0x169d7b0) at ssl-proxy-openssl.c:519
No locals.
#4  0x7fdec4beee0b in io_loop_call_io (io=0x13fdab0) at ioloop.c:564
ioloop = 0x12a07b0
t_id = 2
__FUNCTION__ = "io_loop_call_io"
#5  0x7fdec4bf0407 in io_loop_handler_run_internal (ioloop=optimized out>) at ioloop-epoll.c:220

ctx = 0x12fb8d0
events = 
event = 0x171fb20
list = 0x15f8c50
io = 
tv = {tv_sec = 46, tv_usec = 134490}
events_count = 
msecs = 
ret = 1
i = 
call = 
__FUNCTION__ = "io_loop_handler_run_internal"
#6  0x7fdec4beeeb5 in io_loop_handler_run (ioloop=0x12a07b0) at 
ioloop.c:612

No locals.
#7  0x7fdec4bef058 in io_loop_run (ioloop=0x12a07b0) at ioloop.c:588
__FUNCTION__ = "io_loop_run"
#8  0x7fdec4b81b23 in master_service_run (service=0x12a0650, 
callback=) at master-service.c:640

No locals.
#9  0x7fdec4e6e593 in login_binary_run (binary=out>, argc=2, argv=0x12a0390) at main.c:486

set_pool = 0x12a0b80
login_socket = 
c = 
#10 0x7fdec47dad1d in __libc_start_main (main=0x402ac0 , 
argc=2, ubp_av=0x7ffc53ee5688, init=, fini=optimized out>, rtld_fini=, 
stack_end=0x7ffc53ee5678) at libc-start.c:226

result = 
unwind_buf = {cancel_jmp_buf = {{jmp_buf = {0, 
5496455093114277129, 4204960, 140721716614784, 0, 0, 
-5494405746439844599, -5477823887334535927}, mask_was_saved = 0}}, priv 
= {pad = {0x0, 0x0, 0x404f70, 0x7ffc53ee5688}, data = {

  prev = 0x0, cleanup = 0x0, canceltype = 4214640}}}
not_first_call = 
#11 0x004029c9 in _start ()
No symbol table info available.

Core was generated by `dovecot/imap-login -D'.
Program terminated with signal 11, Segmentation fault.
#0  0x7f1a58620dec in _IO_vfprintf_internal (s=out>, format=, ap=) at 
vfprintf.c:1641

1641  process_string_arg (((struct printf_spec *) NULL));
(gdb) bt full
#0  0x7f1a58620dec in _IO_vfprintf_internal (s=out>, format=, ap=) at 
vfprintf.c:1641

len = 
string_malloced = 
step0_jumps = {0, -1285, -1198, 3818, 3910, 3206, 3307, 4086, 
1925, 2133, 2249, 3731, 4474, -4059, -1109, -1062, 868, 956, 968, 980, 
-1505, -495, 665, 755, 827, -3962, 395, 4392, -4059, 3997}

space = 0
is_short = 0
use_outdigits = 0
step1_jumps = {0, 0, 0, 0, 0, 0, 0, 0, 0, 2133, 2249, 3731, 
4474, -4059, -1109, -1062, 868, 956, 968, 980, -1505, -495, 665, 755, 
827, -3962, 395, 4392, -4059, 0}

group = 0
prec = -1
step2_jumps = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2249, 3731, 4474, 
-4059, -1109, -1062, 868, 956, 968, 980, -1505, -495, 665, 755, 827, 
-3962, 395, 4392, -4059, 0}

string = 
left = 0
is_long_double = 0
width = 0
step3a_jumps = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2336, 0, 0, 0, 
-1109, -1062, 868, 956, 968, 0, 0, 0, 0, 755, 0, 0, 0, 0, 0, 0}

alt = 0
showsign = 0
is_long = 0
is_char = 0
pad = 32 ' '
step3b_jumps = {0 , 4474, 0, 0, -1109, -1062, 
868, 956, 968, 980, -1505, -495, 665, 755, 827, -3962, 395, 0, 0, 0}
step4_jumps = {0 , -1109, -1062, 868, 956, 
968, 980, -1505, -495, 665, 755, 827, -3962, 395, 0, 0, 0}

is_negative = 
base = 
the_arg = {pa_wchar = 0 L'\000', pa_int = 0, pa_long_int = 0, 
pa_long_long_int = 0, pa_u_int = 0, pa_u_long_int = 0, 
pa_u_long_long_int = 0, pa_double = 0, pa_long_double = 0, pa_string = 
0x0, pa_wstring = 0x0,

  pa_pointer = 0x0, pa_user = 0x0}
spec = 115 's'
_buffer = {__routine = 0, __arg = 0xf583a1d84, __canceltype = 
24, __prev = 0x0}

_avail = 
thousands_sep = 0x0
grouping = 0x bounds>

done = 97
f = 0x7f1a58c90b0d "s"
lead_str_end = 0x7f1a58c90b05 "%s:%u: %s"
end_of_spec = 
work_buffer = 

Re: [feature suggestion] pigeonhole - sendmail path for outgoing email

2016-10-05 Thread krz...@gmail.com
Possibility of adding custom header to outgoing sieve message would
also be nice feature.


[feature suggestion] pigeonhole - sendmail path for outgoing email

2016-10-05 Thread krz...@gmail.com
pigeonhole seems to use /usr/sbin/sendmail for its outgoing emails -
even tought that is does not seem to be documented anywhere. How about
setting to specify diffrent sendmail program path and parameters?


fix SIS attachment errors

2016-10-05 Thread Webert de Souza Lima
Hi, I've sent some e-mails about this before but since there was no answers
I'll write it differently, with different information.

I'm using SIS (Single Instance Attachment Storage).
For any reason that is not relevant now, many attachments are missing and
the messages can't be fetched:

Error:
read(attachments-connector(zlib(/dovecot/mdbox/bar.example/foo/storage/m.1)))
failed:
read(/dovecot/attach/bar.example/23/ae/23aed008c1f32f048afd38d9aae68c5aeae2d17a9170e28c60c75a02ec199ef4e7079cd92988ad857bd6e12cd24cdd7619bd29f26edeec842a6911bb14a86944-fb0b6a214dfa63573c1f9331bd36[base64:19
b/l]) failed:
open(/dovecot/attach/bar.example/23/ae/23aed008c1f32f048afd38d9aae68c5aeae2d17a9170e28c60c75a02ec199ef4e7079cd92988ad857bd6e12cd24cdd7619bd29f26edeec842a6911bb14a86944-fb0b6a214dfa63573c1f9331bd36)
failed: No such file or directory

in this specific case, the /dovecot/attach/bar.example/23/ae/ director
doesn't exist.
In other cases, just one file is missing so I would assume the hardlink
could be recreated and it would work.

If I create the missing file (with touch or whatever), I get the following
errors:
Error:
read(/dovecot/attach/bar.example/23/ae/23aed008c1f32f048afd38d9aae68c5aeae2d17a9170e28c60c75a02ec199ef4e7079cd92988ad857bd6e12cd24cdd7619bd29f26edeec842a6911bb14a86944-fb0b6a214dfa63573c1f9331bd36[base64:19
b/l]) failed: Stream is smaller than expected (0 < 483065)
Error:
read(attachments-connector(zlib(/dovecot/mdbox/bar.example/foo/storage/m.1)))
failed:
read(/dovecot/attach/bar.example/23/ae/23aed008c1f32f048afd38d9aae68c5aeae2d17a9170e28c60c75a02ec199ef4e7079cd92988ad857bd6e12cd24cdd7619bd29f26edeec842a6911bb14a86944-fb0b6a214dfa63573c1f9331bd36[base64:19
b/l]) failed: Stream is smaller than expected (0 < 483065)
Error: fetch(body) failed for box=INBOX uid=15: BUG: Unknown internal error

If I try to fill the file with the amount of bytes it complains about with
the following command:

$ dd if=/dev/zero
of=/dovecot/attach/bar.example/23/ae/23aed008c1f32f048afd38d9aae68c5aeae2d17a9170e28c60c75a02ec199ef4e7079cd92988ad857bd6e12cd24cdd7619bd29f26edeec842a6911bb14a86944-fb0b6a214dfa63573c1f9331bd36
bs=1 count=483065

then I get the following error:

Error:
read(/dovecot/attach/bar.example/23/ae/23aed008c1f32f048afd38d9aae68c5aeae2d17a9170e28c60c75a02ec199ef4e7079cd92988ad857bd6e12cd24cdd7619bd29f26edeec842a6911bb14a86944-fb0b6a214dfa63573c1f9331bd36[base64:19
b/l]) failed: Stream is larger than expected (483928 > 483065, eof=0)
Error:
read(attachments-connector(zlib(/srv/dovecot/mdbox/bar.example/foo/storage/m.1)))
failed:
read(//dovecot/attach/bar.example/23/ae/23aed008c1f32f048afd38d9aae68c5aeae2d17a9170e28c60c75a02ec199ef4e7079cd92988ad857bd6e12cd24cdd7619bd29f26edeec842a6911bb14a86944-fb0b6a214dfa63573c1f9331bd36[base64:19
b/l]) failed: Stream is larger than expected (483928 > 483065, eof=0)
Error: fetch(body) failed for box=INBOX uid=15: BUG: Unknown internal error

Based on this I have a few questions:
1. Is there a way, or a tool to scan all mailboxes to get all the messages
that have compromised attachments?

2. is there a way to "fix" the missing files (even if creating fake files
or removing the attachments information from the messages)

3. What I need is to migrate these boxes using doveadm backup/sync, which
fails when these errors occur. Is is possible to ignore them or is there
another tool that would do it?

Thank you.

Webert Lima
Belo Horizonte, Brasil


Re: Changing Dovecot's format from Maildir to mdbox

2016-10-05 Thread Aki Tuomi


On 04.10.2016 01:39, Kristopher Joyce wrote:
> Hello,
>
> I am trying to change Dovecot's email format from Maildir to mdbox. I
> have changed Maildir to mdbox in Mail_location from:
> maildir:/var/vmail/%d/%n to: mdbox:/var/vmail/%d/%n. Nothing seems to
> happen after I restart Dovecot. The users are virtual users and not
> local users. Is there something I am missing?
>
> Thanks
>
> Kris
>
>
>
> ---
> This email has been checked for viruses by Avast antivirus software.
> https://www.avast.com/antivirus

You also need to migrate the data from maildir. If you have backups, try
doveadm sync -A maildir:

Aki Tuomi