dovecot out of memory / large Mailbox

Discussion in 'Installation/Configuration' started by muelli75, Aug 23, 2025.

Tags:
  1. muelli75

    muelli75 Member HowtoForge Supporter

    Hi!

    We have a very large mailbox (~100GB). To this connecting ~7 Thunderbird-Clients (IMAP). All clients use STARTTLS or SSL/TLS, all are working fine.
    Thunderbird connects to the mailbox, new mails are shown as well.
    But old mails out of the cache are only shown by their subject, downloading the content is not possible. Looked at mail.log, now I can see

    Code:
    2025-08-23T09:18:00.898542+02:00 tesoro2 dovecot: imap([email protected])<2134936><7aQ1HwM9ev1QS/Yj>: Fatal: pool_system_malloc(3146424): Out of memory
    2025-08-23T09:18:00.902351+02:00 tesoro2 dovecot: imap([email protected])<2134936><7aQ1HwM9ev1QS/Yj>: Error: Raw backtrace: #0 t_askpass[0x7f85a00cabe0] -> #1 backtrace_append[0x7f85a00cae50] -> #2 backtrace_get[0x7f85a00cafe0] -> #3 execvp_const[0x7f85a00d61d0] -> #4 i_syslog_fatal_handler[0x7f85a00d6b40] -> #5 i_fatal_status[0x7f85a002c788] -> #6 i_fatal_status[0x7f85a0030b16] -> #7 hash_table_create_direct[0x7f85a00dbaa0] -> #8 hash_table_create_direct[0x7f85a00dbc50] -> #9 maildir_uidlist_refresh[0x7f85a0232d70] -> #10 maildir_uidlist_lookup[0x7f85a0233bb0] -> #11 maildir_sync_lookup[0x7f85a0236820] -> #12 mbox_is_backend_readonly[0x7f85a023c7a0] -> #13 maildir_file_do[0x7f85a023ca70] -> #14 maildir_sync_is_synced[0x7f85a0231280] -> #15 mail_get_stream_because[0x7f85a01ffdd0] -> #16 index_mail_prefetch[0x7f85a0276010] -> #17 mail_prefetch[0x7f85a01fb2a0] -> #18 index_search_get_mail[0x7f85a027e2a0] -> #19 index_storage_search_next_nonblock[0x7f85a027e800] -> #20 mailbox_search_next_nonblock[0x7f85a020c7d0] -> #21 mailbox_search_next[0x7f85a020c820] -> #22 imap_fetch_begin[0x55cc30f28170] -> #23 imap_fetch_more[0x55cc30f28550] -> #24 cmd_fetch[0x55cc30f1cc00] -> #25 command_exec[0x55cc30f25880] -> #26 cmd_x_cancel[0x55cc30f2b510] -> #27 cmd_x_cancel[0x55cc30f2b510] -> #28 cmd_x_cancel[0x55cc30f2b510] -> #29 client_handle_input[0x55cc30f2b880] -> #30 client_input[0x55cc30f2bd80] -> #31 io_loop_call_io[0x7f85a00edeb0] -> #32 io_loop_handler_run_internal[0x7f85a00efbb0] -> #33 io_loop_handler_run[0x7f85a00efd40] -> #34 io_loop_run[0x7f85a00eff10] -> #35 master_service_run[0x7f85a00601c0] -> #36 main[0x55cc30f17a00] -> #37 __libc_init_first[0x7f859fe131d0] -> #38 __libc_start_main[0x7f859fe13280] -> #39 _start[0x55cc30f18000]
    2025-08-23T09:18:00.903267+02:00 tesoro2 dovecot: imap([email protected])<2134936><7aQ1HwM9ev1QS/Yj>: Fatal: master: service(imap): child 2134936 returned error 83 (Out of memory (service imap { vsz_limit=256 MB }, you may need to increase it) - set CORE_OUTOFMEM=1 environment to get core dump)
    After that, i tried to increase vsz_limit.
    /etc/dovecot/conf.d/10-master.conf
    Code:
    service imap-login {
      inet_listener imap {
        #port = 143
      }
      inet_listener imaps {
        #port = 993
        #ssl = yes
      }
    
      # Number of connections to handle before starting a new process. Typically
      # the only useful values are 0 (unlimited) or 1. 1 is more secure, but 0
      # is faster. <doc/wiki/LoginProcess.txt>
      #service_count = 1
    
      # Number of processes to always keep waiting for more connections.
      #process_min_avail = 0
    
      # If you set service_count=0, you probably need to grow this.
      vsz_limit = 1024M
    }
    
    service imap {
      # Most of the memory goes to mmap()ing files. You may need to increase this
      # limit if you have huge mailboxes.
      vsz_limit = 1024M
    
    }
    and restarted dovecot '# systemctl restart dovecot'

    but '# doveconf -a | grep vsz_limit'
    Code:
    default_vsz_limit = 256 M
      vsz_limit = 18446744073709551615 B
      vsz_limit = 18446744073709551615 B
      vsz_limit = 18446744073709551615 B
      vsz_limit = 18446744073709551615 B
      vsz_limit = 18446744073709551615 B
      vsz_limit = 18446744073709551615 B
      vsz_limit = 18446744073709551615 B
      vsz_limit = 18446744073709551615 B
      vsz_limit = 18446744073709551615 B
      vsz_limit = 18446744073709551615 B
      vsz_limit = 18446744073709551615 B
      vsz_limit = 18446744073709551615 B
      vsz_limit = 18446744073709551615 B
      vsz_limit = 18446744073709551615 B
      vsz_limit = 18446744073709551615 B
      vsz_limit = 18446744073709551615 B
      vsz_limit = 18446744073709551615 B
      vsz_limit = 18446744073709551615 B
      vsz_limit = 18446744073709551615 B
      vsz_limit = 18446744073709551615 B
      vsz_limit = 18446744073709551615 B
      vsz_limit = 18446744073709551615 B
      vsz_limit = 18446744073709551615 B
      vsz_limit = 18446744073709551615 B
      vsz_limit = 18446744073709551615 B
      vsz_limit = 18446744073709551615 B
      vsz_limit = 18446744073709551615 B
      vsz_limit = 18446744073709551615 B
      vsz_limit = 18446744073709551615 B
      vsz_limit = 18446744073709551615 B
      vsz_limit = 18446744073709551615 B
      vsz_limit = 18446744073709551615 B
      vsz_limit = 18446744073709551615 B
    Do you know the right way to set the limit?

    TIA
     
    Last edited: Aug 23, 2025
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Files from /etc/dovecot/conf.d/ folder are not used, they are not from ISPConfig. Edit the file /etc/dovecot/docvecot.conf.
     
    muelli75 likes this.

Share This Page