Dovecot error getting mails double delivered

kevinjansen

Verified User
Joined
Sep 9, 2006
Messages
11
Dear DirectAdmin users,

I am having a issue on one of our servers that the mail gets delivered twice. The first mail gets delivered directly, and the second around 50-60minutes later.

log: /var/log/exim/mainlog
2018-01-19 09:15:36 1ecRpo-0004C9-0e == [email protected] R=virtual_user T=dovecot_lmtp_udp defer (-1): LMTP connection closed after end of data
2018-01-19 10:07:49 1ecRpo-0004C9-0e => User <[email protected]> F=<[email protected]> R=virtual_user T=dovecot_lmtp_udp S=4734 C="250 2.0.0 <[email protected]> 2PtJGWW1YVq+TAAAKJQYcg Saved"

I am receiving the email the first time at 09:15 and a second time at 10:07

log: /var/log/dovecot-lmtp-errors.log

Jan 19 09:15:36 lmtp(15295): Panic: file lib-event.c: line 148 (event_unref): assertion failed: (event != current_global_event)
Jan 19 09:15:36 lmtp(15295): Error: Raw backtrace: /usr/lib/dovecot/libdovecot.so.0(+0xc9ce5) [0x7f730af3cce5] -> /usr/lib/dovecot/libdovecot.so.0(+0xc9d58) [0x7f730af3cd58] -> /usr/lib/dovecot/libdovecot.so.0(i_fatal+0) [0x7f730aeaeeb7] -> /usr/lib/dovecot/libdovecot.so.0(+0xe5a36) [0x7f730af58a36] -> /usr/lib/dovecot/libdovecot-storage.so.0(mail_storage_service_user_unref+0xb4) [0x7f730b23ca04] -> dovecot/lmtp [local DATA](+0x636a) [0x55e166dce36a] -> dovecot/lmtp [local DATA](lmtp_local_deinit+0x5c) [0x55e166dce83c] -> dovecot/lmtp [local DATA](client_state_reset+0x22) [0x55e166dcda62] -> /usr/lib/dovecot/libdovecot.so.0(smtp_server_connection_reset_state+0x3c) [0x7f730aec692c] -> /usr/lib/dovecot/libdovecot.so.0(smtp_server_command_completed+0x4e) [0x7f730aec425e] -> /usr/lib/dovecot/libdovecot.so.0(+0x547b8) [0x7f730aec77b8] -> /usr/lib/dovecot/libdovecot.so.0(+0xf24b0) [0x7f730af654b0] -> /usr/lib/dovecot/libdovecot.so.0(io_loop_call_io+0x69) [0x7f730af548f9] -> /usr/lib/dovecot/libdovecot.so.0(io_loop_handler_run_internal+0x10a) [0x7f730af561ba] -> /usr/lib/dovecot/libdovecot.so.0(io_loop_handler_run+0x52) [0x7f730af54a02] -> /usr/lib/dovecot/libdovecot.so.0(io_loop_run+0x38) [0x7f730af54c18] -> /usr/lib/dovecot/libdovecot.so.0(master_service_run+0x13) [0x7f730aed1be3] -> dovecot/lmtp [local DATA](main+0x226) [0x55e166dcd196] -> /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5) [0x7f730aae9b45] -> dovecot/lmtp [local DATA](+0x52c2) [0x55e166dcd2c2]

I have updated all software on the server (apt-get update / apt-get upgrade) updated all software in DirectAdmin. Removed Dovecot completely and reinstalled it. But without succes.
What can i still try?

Kind regards,

Kevin Jansen
 
Since when happened this? Maybe it is related to Clamav & clamd? Are there any mail in mail queue?
 
I am facing to the same problem. Even the log shows "LMTP connection closed after end of data", the email was actually delivered. That makes double emails after system retried second time successfully. I am downgrading to Dovecot 2.2.33 to see if the problem is repeating or not. Already have some bugs with version 2.3
 
Same problem here on ubuntu xenial with the latest dovecot release. If it's helpful i can provide some logs.
 
Same for me.

2 x Centos 6, dovecot 2.3.0

Feb 05 21:00:46 lmtp(13741): Panic: file lib-event.c: line 148 (event_unref): assertion failed: (event != current_global_event)
Feb 05 21:00:46 lmtp(13741): Error: Raw backtrace: /usr/lib/dovecot/libdovecot.so.0(+0xc6d7a) [0x7fa71b6b9d7a] -> /usr/lib/dovecot/libdovecot.so.0(default_fatal_handler+0x32) [0x7fa71b6ba812] -> /usr/lib/dovecot/libdovecot.so.0(+0x3be31) [0x7fa71b62ee31] -> /usr/lib/dovecot/libdovecot.so.0(+0xe372b) [0x7fa71b6d672b] -> /usr/lib/dovecot/libdovecot-storage.so.0(mail_storage_service_user_unref+0xb8) [0x7fa71b9b09d8] -> dovecot/lmtp [local DATA](+0x6414) [0x7fa71c0d9414] -> dovecot/lmtp [local DATA](lmtp_local_deinit+0x45) [0x7fa71c0d98d5] -> dovecot/lmtp [local DATA](client_state_reset+0x1a) [0x7fa71c0d845a] -> /usr/lib/dovecot/libdovecot.so.0(smtp_server_connection_reset_state+0x3c) [0x7fa71b645a1c] -> /usr/lib/dovecot/libdovecot.so.0(smtp_server_command_completed+0x4d) [0x7fa71b64371d] -> /usr/lib/dovecot/libdovecot.so.0(+0x53398) [0x7fa71b646398] -> /usr/lib/dovecot/libdovecot.so.0(+0xefb30) [0x7fa71b6e2b30] -> /usr/lib/dovecot/libdovecot.so.0(io_loop_call_io+0x55) [0x7fa71b6d09d5] -> /usr/lib/dovecot/libdovecot.so.0(io_loop_handler_run_internal+0xbf) [0x7fa71b6d289f] -> /usr/lib/dovecot/libdovecot.so.0(io_loop_handler_run+0x55) [0x7fa71b6d0ac5] -> /usr/lib/dovecot/libdovecot.so.0(io_loop_run+0x38) [0x7fa71b6d0ce8] -> /usr/lib/dovecot/libdovecot.so.0(master_service_run+0x13) [0x7fa71b650983] -> dovecot/lmtp [local DATA](main+0x28e) [0x7fa71c0d820e] -> /lib64/libc.so.6(__libc_start_main+0xfd) [0x7fa71b27dd1d] -> dovecot/lmtp [local DATA](+0x4e49) [0x7fa71c0d7e49]

exim mainlog:
2018-02-05 21:00:46 1eimwX-0005jo-Tn == [email protected] <[email protected]> R=virtual_user T=dovecot_lmtp_udp defer (-1): LMTP connection closed after end of data
 
Anyone has a solution? This also happend for me on a Debian 7 server (what needs to be upgraded soon to 9
 
There were some configuration changes during upgrade, will be there no problem with that after downgrade?
 
I'm having the same problem with CentOS 6.5.

I'm also curious if it's possible to simply replace the dovecot version custombuild expects with 2.2.33 without causing problems.
 
I'm having the same problem with CentOS 6.5.

Yes! Exact same issues with my users here on CentOS 6.9, started after the Dovecot 2.3 upgrade from CB. I'm glad I'm not the only one, but this seems like something Martynas may want to look into. Please ask for information when needed (logs, configs).
 
Question: is this happening to real e-mail accounts, or are there always forwarders involved?
 
downgrade to dovecot 2.2.33 using custom versions file under custombuild folder.

related:
https://help.directadmin.com/item.php?id=565
 
I used the method at the link referenced by zEitEr. It worked without hitch.

The "scriptish" way to do it, shown in zEitEr's link, is:

Code:
cd /usr/local/directadmin/custombuild
echo "dovecot:2.2.33:" > custom_versions.txt
./build dovecot

I don't know the MD5 hash for that dovecot version (or, uh, any dovecot version, honestly), but I'm sure it's easily discover-able for those out there who prefer safety over convenience.
 
If someone needs MD5 hash:

Code:
md5sum dovecot-2.2.33.tar.gz                                                                                                                                                                                       
d61d1e923a22f9062cc9f47696882666  dovecot-2.2.33.tar.gz
 
The "scriptish" way to do it, shown in zEitEr's link, is:

Thanks for posting the solution here guys. It's a shame to have to roll back, but if it's not working, then it's the best option I guess. Did they jump the gun to include 2.3 in CB?
 
Got 3 servers with Centos 6.9 but only 1 server has log entry's like that, strange.
Going to use the fix too.

Both other servers did have delivery issues though. All is fixed now by downgrading.
 
Last edited:
Also have a bunch of servers with Centos 6.9 kernel 2.6.32-696.20.1.el6 and only two of them are giving this issue, very strange.

I confirm that downgrading dovecot to 2.2.33 fixed the issue on both of them.
 
Last edited:
The issues has been with 2.3.0 not 2.2.33, so a upgrade to 2.2.34 will not be able to fix issues that was only in 2.3.0
 
Back
Top