Guest User

Dovecot LMTP

a guest
Dec 6th, 2019
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 17.26 KB | None | 0 0
  1. How it looks a few minutes after we started our Dovecot
  2.  
  3. [root@lmtp-proxy:~] # ps wwwaux | grep RCPT
  4. dovenull 4057 0.0 0.0 12724 8160 - I 23:19 0:00.07 lmtp: [10.4.2.216 RCPT TO] (lmtp)
  5. dovenull 4059 0.0 0.0 12724 8728 - I 23:19 0:00.15 lmtp: [10.4.2.214 RCPT TO] (lmtp)
  6. dovenull 4061 0.0 0.0 14772 10544 - S 23:19 0:00.46 lmtp: [10.4.2.214 RCPT TO] (lmtp)
  7. dovenull 4063 0.0 0.0 12724 7804 - I 23:19 0:00.01 lmtp: [10.4.2.212 RCPT TO] (lmtp)
  8. dovenull 4085 0.0 0.0 14772 9584 - I 23:19 0:00.12 lmtp: [10.4.2.216 RCPT TO] (lmtp)
  9. dovenull 4087 0.0 0.0 12724 8584 - I 23:19 0:00.05 lmtp: [10.4.2.218 RCPT TO] (lmtp)
  10. dovenull 4096 0.0 0.0 14772 9484 - S 23:19 0:00.36 lmtp: [10.4.2.219 RCPT TO] (lmtp)
  11. dovenull 8478 0.0 0.0 12724 8124 - I 23:24 0:00.01 lmtp: [10.4.2.215 RCPT TO] (lmtp)
  12. dovenull 8481 0.0 0.0 14772 9524 - I 23:24 0:00.12 lmtp: [10.4.2.212 RCPT TO] (lmtp)
  13. dovenull 8483 0.0 0.0 14772 9716 - I 23:24 0:00.17 lmtp: [10.4.2.217 RCPT TO] (lmtp)
  14. dovenull 8490 0.0 0.0 14772 10036 - I 23:24 0:00.16 lmtp: [10.4.2.218 RCPT TO] (lmtp)
  15. dovenull 8495 0.0 0.0 14772 9668 - I 23:24 0:00.10 lmtp: [10.4.2.216 RCPT TO] (lmtp)
  16. dovenull 9645 0.0 0.0 12724 8112 - I 23:25 0:00.01 lmtp: [10.4.2.217 RCPT TO] (lmtp)
  17. dovenull 9648 0.0 0.0 14772 9764 - S 23:25 0:00.13 lmtp: [10.4.2.212 RCPT TO] (lmtp)
  18. dovenull 9917 0.0 0.0 12724 9012 - S 23:26 0:00.12 lmtp: [10.4.2.218 RCPT TO] (lmtp)
  19. dovenull 10231 0.0 0.0 12724 8436 - S 23:26 0:00.07 lmtp: [10.4.2.216 RCPT TO] (lmtp)
  20. dovenull 11055 0.0 0.0 12724 8424 - I 23:28 0:00.03 lmtp: [10.4.2.213 RCPT TO] (lmtp)
  21.  
  22. Let's have a deeper look on PID: 11055
  23. As you can see, it holds a connection from mailin (exim 4.92) -> lmtp-proxy (Dovecot 2.3) -> popimap (Dovecot 2.3)
  24. [root@lmtp-proxy:~] # lsof -p 11055
  25. COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
  26. lmtp 11055 dovenull cwd VDIR 119,557580335 40 708 /var/run/dovecot
  27. lmtp 11055 dovenull rtd VDIR 29,2294284432 30 4 /
  28. lmtp 11055 dovenull txt VREG 209,3424780500 60568 202066 /usr/local/libexec/dovecot/lmtp
  29. lmtp 11055 dovenull txt VREG 29,2294284432 145304 6060 /libexec/ld-elf.so.1
  30. lmtp 11055 dovenull txt VREG 209,3424780500 35072 202015 /usr/local/lib/dovecot/libdovecot-lda.so.0.0.0
  31. lmtp 11055 dovenull txt VREG 209,3424780500 1394944 202027 /usr/local/lib/dovecot/libdovecot-storage.so.0.0.0
  32. lmtp 11055 dovenull txt VREG 209,3424780500 1699072 202031 /usr/local/lib/dovecot/libdovecot.so.0.0.0
  33. lmtp 11055 dovenull txt VREG 29,2294284432 1775880 5964 /lib/libc.so.7
  34. lmtp 11055 dovenull txt VREG 209,3424780500 54336 202039 /usr/local/lib/dovecot/libssl_iostream_openssl.so
  35. lmtp 11055 dovenull txt VREG 209,3424780500 510664 114794 /usr/local/lib/libssl.so.9
  36. lmtp 11055 dovenull txt VREG 209,3424780500 2652768 114791 /usr/local/lib/libcrypto.so.9
  37. lmtp 11055 dovenull txt VREG 29,2294284432 123432 6038 /lib/libthr.so.3
  38. lmtp 11055 dovenull 0w VCHR 0,14 0t0 14 /dev/null
  39. lmtp 11055 dovenull 1w VCHR 0,14 0t0 14 /dev/null
  40. lmtp 11055 dovenull 2u PIPE 0xfffff801d76a7758 0 ->0xfffff801d76a75f0
  41. lmtp 11055 dovenull 3u PIPE 0xfffff80228b19a50 0 ->0xfffff80228b198e8
  42. lmtp 11055 dovenull 4w VCHR 0,14 0t0 14 /dev/null
  43. lmtp 11055 dovenull 5u PIPE 0xfffff803443ba460 0 ->0xfffff803443ba2f8
  44. lmtp 11055 dovenull 6u PIPE 0xfffff80b9e8b1758 0 ->0xfffff80b9e8b15f0
  45. lmtp 11055 dovenull 7u unix 0xfffff803d8f2fa38 0t0 /var/run/dovecot/lmtp
  46. lmtp 11055 dovenull 8u IPv4 0xfffff803d81f6000 0t0 TCP lmtp:24
  47. lmtp 11055 dovenull 9u unix 0xfffff80b6528b368 0t0 ->0xfffff8117b27c000
  48. lmtp 11055 dovenull 10u unix 0xfffff8014b6da6d0 0t0 ->0xfffff80d8985e368
  49. lmtp 11055 dovenull 11u KQUEUE 0xfffff8105e841000 count=0, state=0x2
  50. lmtp 11055 dovenull 12u PIPE 0xfffff80228b19be0 16384 ->0xfffff80228b19d48
  51. lmtp 11055 dovenull 13u PIPE 0xfffff80228b19d48 0 ->0xfffff80228b19be0
  52. lmtp 11055 dovenull 14u IPv4 0xfffff810a0047830 0t0 TCP lmtp-proxy:24->mailin:14298
  53. lmtp 11055 dovenull 15u IPv4 0xfffff80b6514f418 0t0 TCP lmtp-proxy:10310->popimap:24
  54. lmtp 11055 dovenull 16u unix 0xfffff80d877da6d0 0t0 ->0xfffff80b657c6368
  55.  
  56. Process isn't doing a lot....
  57. [root@lmtp-proxy:~] # truss -p 11055
  58. nothing
  59.  
  60. [root@lmtp-proxy:~] # gdb -p 11055
  61. 0x0000000021e8e0ea in _kevent () from /lib/libc.so.7
  62. (gdb) bt
  63. #0 0x0000000021e8e0ea in _kevent () from /lib/libc.so.7
  64. #1 0x00000000230950e3 in __thr_kevent (kq=11, changelist=0x0, nchanges=0, eventlist=0x22468000, nevents=7,
  65. timeout=0x7fffffffe7f0) at /usr/src/lib/libthr/thread/thr_syscalls.c:398
  66. #2 0x0000000021ab4e5d in io_loop_handler_run_internal () from /usr/local/lib/dovecot/libdovecot.so.0
  67. #3 0x0000000021ab2df8 in io_loop_handler_run () from /usr/local/lib/dovecot/libdovecot.so.0
  68. #4 0x0000000021ab2b58 in io_loop_run () from /usr/local/lib/dovecot/libdovecot.so.0
  69. #5 0x0000000021a20e78 in master_service_run () from /usr/local/lib/dovecot/libdovecot.so.0
  70. #6 0x000000000102781a in main ()
  71.  
  72. after some minutes....
  73. Connection between popimap and lmtp-proxy is closed
  74. [root@lmtp-proxy:~] # lsof -p 11055
  75. lsof: WARNING: compiled for FreeBSD release 11.2-RELEASE-p10; this is 11.3-RELEASE-p3.
  76. COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
  77. lmtp 11055 dovenull cwd VDIR 119,557580335 40 708 /var/run/dovecot
  78. lmtp 11055 dovenull rtd VDIR 29,2294284432 30 4 /
  79. lmtp 11055 dovenull txt VREG 209,3424780500 60568 202066 /usr/local/libexec/dovecot/lmtp
  80. lmtp 11055 dovenull txt VREG 29,2294284432 145304 6060 /libexec/ld-elf.so.1
  81. lmtp 11055 dovenull txt VREG 209,3424780500 35072 202015 /usr/local/lib/dovecot/libdovecot-lda.so.0.0.0
  82. lmtp 11055 dovenull txt VREG 209,3424780500 1394944 202027 /usr/local/lib/dovecot/libdovecot-storage.so.0.0.0
  83. lmtp 11055 dovenull txt VREG 209,3424780500 1699072 202031 /usr/local/lib/dovecot/libdovecot.so.0.0.0
  84. lmtp 11055 dovenull txt VREG 29,2294284432 1775880 5964 /lib/libc.so.7
  85. lmtp 11055 dovenull txt VREG 209,3424780500 54336 202039 /usr/local/lib/dovecot/libssl_iostream_openssl.so
  86. lmtp 11055 dovenull txt VREG 209,3424780500 510664 114794 /usr/local/lib/libssl.so.9
  87. lmtp 11055 dovenull txt VREG 209,3424780500 2652768 114791 /usr/local/lib/libcrypto.so.9
  88. lmtp 11055 dovenull txt VREG 29,2294284432 123432 6038 /lib/libthr.so.3
  89. lmtp 11055 dovenull 0w VCHR 0,14 0t0 14 /dev/null
  90. lmtp 11055 dovenull 1w VCHR 0,14 0t0 14 /dev/null
  91. lmtp 11055 dovenull 2u PIPE 0xfffff801d76a7758 0 ->0xfffff801d76a75f0
  92. lmtp 11055 dovenull 3u PIPE 0xfffff80228b19a50 0 ->0xfffff80228b198e8
  93. lmtp 11055 dovenull 4w VCHR 0,14 0t0 14 /dev/null
  94. lmtp 11055 dovenull 5u PIPE 0xfffff803443ba460 0 ->0xfffff803443ba2f8
  95. lmtp 11055 dovenull 6u PIPE 0xfffff80b9e8b1758 0 ->0xfffff80b9e8b15f0
  96. lmtp 11055 dovenull 7u unix 0xfffff803d8f2fa38 0t0 /var/run/dovecot/lmtp
  97. lmtp 11055 dovenull 8u IPv4 0xfffff803d81f6000 0t0 TCP lmtp:24
  98. lmtp 11055 dovenull 9u unix 0xfffff80b6528b368 0t0 ->0xfffff8117b27c000
  99. lmtp 11055 dovenull 10u unix 0xfffff8014b6da6d0 0t0 ->0xfffff80d8985e368
  100. lmtp 11055 dovenull 11u KQUEUE 0xfffff8105e841000 count=0, state=0x2
  101. lmtp 11055 dovenull 12u PIPE 0xfffff80228b19be0 16384 ->0xfffff80228b19d48
  102. lmtp 11055 dovenull 13u PIPE 0xfffff80228b19d48 0 ->0xfffff80228b19be0
  103. lmtp 11055 dovenull 14u IPv4 0xfffff810a0047830 0t0 TCP lmtp-proxy:24->mailin:14298
  104. lmtp 11055 dovenull 16u unix 0xfffff80d877da6d0 0t0 ->0xfffff80b657c6368
  105.  
  106.  
  107.  
  108. [root@mailin:~] 1m39s # netstat -an | grep 14298
  109. tcp4 0 0 10.4.2.213.14298 10.0.2.100.24 FIN_WAIT_2
  110.  
  111. [root@lmtp-proxy:~] # netstat -an | grep 14298
  112. tcp4 2514 0 10.0.2.100.24 10.4.2.213.14298 CLOSE_WAIT
  113.  
  114.  
  115. LMTP Debug log:
  116.  
  117. Dec 5 23:28:22.000 lmtp-proxy dovecot: lmtp(11055): Connect from 10.4.2.213
  118. Dec 5 23:28:22.000 lmtp-proxy dovecot: lmtp(11055): Debug: lmtp-server: conn 10.4.2.213:14298 [4]: Sent: 220 lmtp-proxy Dovecot ready.
  119. Dec 5 23:28:22.000 lmtp-proxy dovecot: lmtp(11055): Debug: lmtp-server: conn 10.4.2.213:14298 [4]: Timeout start
  120. Dec 5 23:28:22.000 lmtp-proxy dovecot: lmtp(11055): Debug: lmtp-server: conn 10.4.2.213:14298 [4]: Received new command: LHLO mxin
  121. Dec 5 23:28:22.000 lmtp-proxy dovecot: lmtp(11055): Debug: lmtp-server: conn 10.4.2.213:14298 [4]: command LHLO: New command
  122. Dec 5 23:28:22.000 lmtp-proxy dovecot: lmtp(11055): Debug: lmtp-server: conn 10.4.2.213:14298 [4]: command LHLO: 250 reply: Submitted
  123. Dec 5 23:28:22.000 lmtp-proxy dovecot: lmtp(11055): Debug: lmtp-server: conn 10.4.2.213:14298 [4]: command LHLO: Replied
  124. Dec 5 23:28:22.000 lmtp-proxy dovecot: lmtp(11055): Debug: lmtp-server: conn 10.4.2.213:14298 [4]: command LHLO: Ready to reply
  125. Dec 5 23:28:22.000 lmtp-proxy dovecot: lmtp(11055): Debug: lmtp-server: conn 10.4.2.213:14298 [4]: Trigger output
  126. Dec 5 23:28:22.000 lmtp-proxy dovecot: lmtp(11055): Debug: lmtp-server: conn 10.4.2.213:14298 [4]: command LHLO: Next to reply
  127. Dec 5 23:28:22.000 lmtp-proxy dovecot: lmtp(11055): Debug: lmtp-server: conn 10.4.2.213:14298 [4]: Timeout stop
  128. Dec 5 23:28:22.000 lmtp-proxy dovecot: lmtp(11055): Debug: lmtp-server: conn 10.4.2.213:14298 [4]: Sending replies
  129. Dec 5 23:28:22.000 lmtp-proxy dovecot: lmtp(11055): Debug: lmtp-server: conn 10.4.2.213:14298 [4]: command LHLO: Completed
  130. Dec 5 23:28:22.000 lmtp-proxy dovecot: lmtp(11055): Debug: lmtp-server: conn 10.4.2.213:14298 [4]: Connection state reset
  131. Dec 5 23:28:22.000 lmtp-proxy dovecot: lmtp(11055): Debug: lmtp-server: conn 10.4.2.213:14298 [4]: command LHLO: 250 reply: Sent: 250-lmtp-proxy 8BITMIME CHUNKING ENHANCEDSTATUSCODES PIPELINING STARTTLS
  132. Dec 5 23:28:22.000 lmtp-proxy dovecot: lmtp(11055): Debug: lmtp-server: conn 10.4.2.213:14298 [4]: command LHLO: Finished
  133. Dec 5 23:28:22.000 lmtp-proxy dovecot: lmtp(11055): Debug: lmtp-server: conn 10.4.2.213:14298 [4]: command LHLO: Destroy
  134. Dec 5 23:28:22.000 lmtp-proxy dovecot: lmtp(11055): Debug: lmtp-client: conn 10.1.1.38:24 [1]: command RCPT: Got reply (1/1): 552 5.2.2 <test@blaabla.ch> Quota exceeded (mailbox for user is full) (1 commands pending, 0 commands queued)
  135. Dec 5 23:28:22.000 lmtp-proxy dovecot: lmtp(11055): Debug: lmtp-client: conn 10.1.1.38:24 [1]: No commands pending; stop timeout
  136. Dec 5 23:28:22.000 lmtp-proxy dovecot: lmtp(11055): Debug: lmtp-client: conn 10.1.1.38:24 [1]: transaction: Got RCPT reply: 552 5.2.2 <test@blaabla.ch> Quota exceeded (mailbox for user is full)
  137. Dec 5 23:28:22.000 lmtp-proxy dovecot: lmtp(11055): Debug: lmtp-client: conn 10.1.1.38:24 [1]: command [plug]: Submitted
  138. Dec 5 23:28:22.000 lmtp-proxy dovecot: lmtp(11055): Debug: lmtp-client: conn 10.1.1.38:24 [1]: transaction: rcpt <test@blaabla.ch>: Denied
  139. Dec 5 23:28:22.000 lmtp-proxy dovecot: lmtp(11055): Debug: lmtp-server: conn 10.4.2.213:14298 [4]: command RCPT: 552 reply: Submitted
  140. Dec 5 23:28:22.000 lmtp-proxy dovecot: lmtp(11055): Debug: lmtp-server: conn 10.4.2.213:14298 [4]: command RCPT: Replied
  141. Dec 5 23:28:22.000 lmtp-proxy dovecot: lmtp(11055): Debug: lmtp-server: conn 10.4.2.213:14298 [4]: command RCPT: Ready to reply
  142. Dec 5 23:28:22.000 lmtp-proxy dovecot: lmtp(11055): Debug: lmtp-server: conn 10.4.2.213:14298 [4]: Trigger output
  143. Dec 5 23:28:22.000 lmtp-proxy dovecot: lmtp(11055): Debug: lmtp-client: conn 10.1.1.38:24 [1]: transaction: Transaction is not yet complete
  144. Dec 5 23:28:22.000 lmtp-proxy dovecot: lmtp(11055): Debug: lmtp-client: conn 10.1.1.38:24 [1]: command RCPT: Destroy (0 commands pending, 1 commands queued)
  145. Dec 5 23:28:22.000 lmtp-proxy dovecot: lmtp(11055): Debug: lmtp-server: conn 10.4.2.213:14298 [4]: Sending replies
  146. Dec 5 23:28:22.000 lmtp-proxy dovecot: lmtp(11055): Debug: lmtp-server: conn 10.4.2.213:14298 [4]: command RCPT: Completed
  147. Dec 5 23:28:22.000 lmtp-proxy dovecot: lmtp(11055): Debug: lmtp-server: conn 10.4.2.213:14298 [4]: rcpt test@blaabla.ch: Denied
  148. Dec 5 23:28:22.000 lmtp-proxy dovecot: lmtp(11055): Debug: lmtp-server: conn 10.4.2.213:14298 [4]: command RCPT: 552 reply: Sent: 552 5.2.2 <test@blaabla.ch> Quota exceeded (mailbox for user is full)
  149. Dec 5 23:28:22.000 lmtp-proxy dovecot: lmtp(11055): Debug: lmtp-server: conn 10.4.2.213:14298 [4]: Trigger output
  150. Dec 5 23:28:22.000 lmtp-proxy dovecot: lmtp(11055): Debug: lmtp-server: conn 10.4.2.213:14298 [4]: Sending replies
  151. Dec 5 23:31:57.000 lmtp-proxy dovecot: lmtp(12258): Debug: lmtp-server: conn 10.4.2.214:59932 [35]: Received new command: BDAT 11055 LAST
  152. Dec 5 23:33:22.000 lmtp-proxy dovecot: lmtp(11055): Debug: lmtp-client: conn 10.1.1.38:24 [1]: Connection failed: 421 4.4.2 popimap Disconnected for inactivity
  153. Dec 5 23:33:22.000 lmtp-proxy dovecot: lmtp(11055): Debug: lmtp-client: conn 10.1.1.38:24 [1]: Disconnected
  154. Dec 5 23:33:22.000 lmtp-proxy dovecot: lmtp(11055): Debug: lmtp-client: conn 10.1.1.38:24 [1]: Disconnected: Connection closed (fd=15)
  155. Dec 5 23:33:22.000 lmtp-proxy dovecot: lmtp(11055): Debug: lmtp-client: conn 10.1.1.38:24 [1]: transaction: Connection lost: 421 4.4.2 popimap Disconnected for inactivity
  156. Dec 5 23:33:22.000 lmtp-proxy dovecot: lmtp(11055): Debug: lmtp-client: conn 10.1.1.38:24 [1]: transaction: Returning failure: 421 4.4.2 popimap Disconnected for inactivity
  157. Dec 5 23:33:22.000 lmtp-proxy dovecot: lmtp(11055): Debug: lmtp-client: conn 10.1.1.38:24 [1]: command [plug]: Aborted
  158. Dec 5 23:33:22.000 lmtp-proxy dovecot: lmtp(11055): Debug: lmtp-client: conn 10.1.1.38:24 [1]: command [plug]: Removed from send queue
  159. Dec 5 23:33:22.000 lmtp-proxy dovecot: lmtp(11055): Debug: lmtp-client: conn 10.1.1.38:24 [1]: command [plug]: Destroy (0 commands pending, 0 commands queued)
  160. Dec 5 23:55:59.000 lmtp-proxy dovecot: lmtp(11055): Debug: lmtp-client: conn 10.1.1.38:24 [1]: transaction: Destroy
  161.  
  162.  
  163.  
  164. [root@popimap:~] 1 # doveadm quota get -u test@blaabla.ch
  165. Quota name Type Value Limit %
  166. User quota STORAGE 204884 204800 100
  167. User quota MESSAGE 1792 - 0
  168.  
  169.  
  170.  
  171.  
  172. [root@lmtp-proxy:~] # doveconf -n
  173. # 2.3.9 (e7f79df99): /usr/local/etc/dovecot/dovecot.conf
  174. # OS: FreeBSD 11.3-RELEASE-p3 amd64
  175. # Hostname: lmtp-proxy
  176. auth_username_chars = abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890.+-_@
  177. auth_verbose = yes
  178. default_client_limit = 5000
  179. default_vsz_limit = 512 M
  180. director_mail_servers = ....
  181. director_servers = ....
  182. director_user_expire = 1 weeks
  183. disable_plaintext_auth = no
  184. lmtp_proxy = yes
  185. lmtp_user_concurrency_limit = 20
  186. log_debug = category:lmtp
  187. login_log_format_elements = user=<%u> method=%m rip=%r lip=%l mpid=%e session=<%{session}> %c %k
  188. passdb {
  189. args = proxy=y nopassword=y
  190. driver = static
  191. }
  192. service anvil {
  193. client_limit = 6000
  194. }
  195. service director {
  196. fifo_listener login/proxy-notify {
  197. mode = 0666
  198. }
  199. inet_listener {
  200. address = ...
  201. port = 9090
  202. }
  203. unix_listener director-userdb {
  204. mode = 0666
  205. }
  206. unix_listener login/director {
  207. mode = 0666
  208. }
  209. }
  210. service imap-login {
  211. executable = imap-login director
  212. inet_listener imap {
  213. address = ....
  214. }
  215. inet_listener imaps {
  216. address = ....
  217. }
  218. process_min_avail = 24
  219. service_count = 0
  220. }
  221. service lmtp {
  222. inet_listener lmtp {
  223. address = ....
  224. port = 24
  225. }
  226. process_limit = 1024
  227. process_min_avail = 24
  228. user = dovenull
  229. }
  230. service pop3-login {
  231. executable = pop3-login director
  232. inet_listener pop3 {
  233. address = ....
  234. }
  235. inet_listener pop3s {
  236. address = ...
  237. }
  238. process_min_avail = 24
  239. service_count = 0
  240. }
  241. ssl_cert = ...
  242. ssl_cipher_list = ECDHE+AESGCM:DHE+AESGCM:ECDHE+AES256:DHE+AES256:ECDHE+AES:DHE+AES:ECDHE+3DES:DHE+3DES:RSA+AESGCM:RSA+AES:RSA+3DES:!LOW:!MEDIUM:!aNULL:!eNULL:!DES:!DSS:!EXP:!MD5:!PSK:!RC4:!SRP
  243. ssl_dh = # hidden, use -P to show it
  244. ssl_key = # hidden, use -P to show it
  245. ssl_prefer_server_ciphers = yes
  246. verbose_proctitle = yes
  247. protocol lmtp {
  248. auth_socket_path = director-userdb
  249. }
Add Comment
Please, Sign In to add comment