mirror of
				https://github.com/optim-enterprises-bv/Mailu.git
				synced 2025-11-03 19:47:52 +00:00 
			
		
		
		
	Merge #3463
3463: Fix #3450 r=mergify[bot] a=nextgens ## What type of PR? bug-fix ## What does this PR do? Ensure we can do more than 100 parallel sessions. This will use more RAM. ### Related issue(s) - close #3450 ## Prerequisites Before we can consider review and merge, please make sure the following list is done and checked. If an entry in not applicable, you can check it or remove it from the list. - [ ] In case of feature or enhancement: documentation updated accordingly - [x] Unless it's docs or a minor change: add [changelog](https://mailu.io/master/contributors/workflow.html#changelog) entry file. Co-authored-by: Florent Daigniere <nextgens@freenetproject.org> Co-authored-by: Florent Daigniere <nextgens@users.noreply.github.com> Co-authored-by: Dimitri Huisman <diman@huisman.xyz>
This commit is contained in:
		@@ -64,7 +64,7 @@ test_unsupported()
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
cmdline = [
 | 
					cmdline = [
 | 
				
			||||||
    "gunicorn",
 | 
					    "gunicorn",
 | 
				
			||||||
    "--threads", f"{os.cpu_count()}",
 | 
					    "--threads", os.environ.get('CPU_COUNT', '1'),
 | 
				
			||||||
    # If SUBNET6 is defined, gunicorn must listen on IPv6 as well as IPv4
 | 
					    # If SUBNET6 is defined, gunicorn must listen on IPv6 as well as IPv4
 | 
				
			||||||
    "-b", f"{'[::]' if os.environ.get('SUBNET6') else '0.0.0.0'}:8080",
 | 
					    "-b", f"{'[::]' if os.environ.get('SUBNET6') else '0.0.0.0'}:8080",
 | 
				
			||||||
    "--logger-class mailu.Logger",
 | 
					    "--logger-class mailu.Logger",
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -141,6 +141,8 @@ def clean_env():
 | 
				
			|||||||
        for item in os.environ.get('TLS', ALL_PORTS).split(','):
 | 
					        for item in os.environ.get('TLS', ALL_PORTS).split(','):
 | 
				
			||||||
            if item in PORTS_REQUIRING_TLS:
 | 
					            if item in PORTS_REQUIRING_TLS:
 | 
				
			||||||
                os.environ[f'TLS_{item}']='True'
 | 
					                os.environ[f'TLS_{item}']='True'
 | 
				
			||||||
 | 
					    if 'CPU_COUNT' not in os.environ:
 | 
				
			||||||
 | 
					        os.environ['CPU_COUNT'] = str(os.cpu_count())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def drop_privs_to(username='mailu'):
 | 
					def drop_privs_to(username='mailu'):
 | 
				
			||||||
    pwnam = getpwnam(username)
 | 
					    pwnam = getpwnam(username)
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -137,12 +137,22 @@ service imap-login {
 | 
				
			|||||||
  inet_listener imap {
 | 
					  inet_listener imap {
 | 
				
			||||||
    port = 143
 | 
					    port = 143
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					  service_count = 0
 | 
				
			||||||
 | 
					  client_limit = 25000
 | 
				
			||||||
 | 
					  process_min_avail = {{ CPU_COUNT }}
 | 
				
			||||||
 | 
					  process_limit = {{ CPU_COUNT }}
 | 
				
			||||||
 | 
					  vsz_limit = 256M
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
service pop3-login {
 | 
					service pop3-login {
 | 
				
			||||||
  inet_listener pop3 {
 | 
					  inet_listener pop3 {
 | 
				
			||||||
    port = 110
 | 
					    port = 110
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					  service_count = 0
 | 
				
			||||||
 | 
					  client_limit = 25000
 | 
				
			||||||
 | 
					  process_min_avail = {{ CPU_COUNT }}
 | 
				
			||||||
 | 
					  process_limit = {{ CPU_COUNT }}
 | 
				
			||||||
 | 
					  vsz_limit = 256M
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
###############
 | 
					###############
 | 
				
			||||||
@@ -166,6 +176,11 @@ service managesieve-login {
 | 
				
			|||||||
  inet_listener sieve {
 | 
					  inet_listener sieve {
 | 
				
			||||||
    port = 4190
 | 
					    port = 4190
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					  service_count = 0
 | 
				
			||||||
 | 
					  client_limit = 25000
 | 
				
			||||||
 | 
					  process_min_avail = {{ CPU_COUNT }}
 | 
				
			||||||
 | 
					  process_limit = {{ CPU_COUNT }}
 | 
				
			||||||
 | 
					  vsz_limit = 256M
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
protocol sieve {
 | 
					protocol sieve {
 | 
				
			||||||
@@ -223,4 +238,4 @@ service anvil {
 | 
				
			|||||||
# Extensions
 | 
					# Extensions
 | 
				
			||||||
###############
 | 
					###############
 | 
				
			||||||
 | 
					
 | 
				
			||||||
!include_try /overrides/dovecot.conf
 | 
					!include_try /overrides/dovecot/proxy.conf
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -87,6 +87,11 @@ service managesieve-login {
 | 
				
			|||||||
  inet_listener sieve-webmail {
 | 
					  inet_listener sieve-webmail {
 | 
				
			||||||
    port = 14190
 | 
					    port = 14190
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					  service_count = 0
 | 
				
			||||||
 | 
					  client_limit = 25000
 | 
				
			||||||
 | 
					  process_min_avail = {{ CPU_COUNT }}
 | 
				
			||||||
 | 
					  process_limit = {{ CPU_COUNT }}
 | 
				
			||||||
 | 
					  vsz_limit = 256M
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
{% endif %}
 | 
					{% endif %}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -114,6 +119,11 @@ service imap-login {
 | 
				
			|||||||
  inet_listener imap-webmail {
 | 
					  inet_listener imap-webmail {
 | 
				
			||||||
   port = 10143
 | 
					   port = 10143
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					  service_count = 0
 | 
				
			||||||
 | 
					  client_limit = 25000
 | 
				
			||||||
 | 
					  process_min_avail = {{ CPU_COUNT }}
 | 
				
			||||||
 | 
					  process_limit = {{ CPU_COUNT }}
 | 
				
			||||||
 | 
					  vsz_limit = 256M
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
service pop3-login {
 | 
					service pop3-login {
 | 
				
			||||||
@@ -132,6 +142,11 @@ service pop3-login {
 | 
				
			|||||||
{% endif %}
 | 
					{% endif %}
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
{% endif %}
 | 
					{% endif %}
 | 
				
			||||||
 | 
					  service_count = 0
 | 
				
			||||||
 | 
					  client_limit = 25000
 | 
				
			||||||
 | 
					  process_min_avail = {{ CPU_COUNT }}
 | 
				
			||||||
 | 
					  process_limit = {{ CPU_COUNT }}
 | 
				
			||||||
 | 
					  vsz_limit = 256M
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
recipient_delimiter = {{ RECIPIENT_DELIMITER }}
 | 
					recipient_delimiter = {{ RECIPIENT_DELIMITER }}
 | 
				
			||||||
@@ -161,4 +176,11 @@ service submission-login {
 | 
				
			|||||||
   inet_listener submission-webmail {
 | 
					   inet_listener submission-webmail {
 | 
				
			||||||
    port = 10025
 | 
					    port = 10025
 | 
				
			||||||
   }
 | 
					   }
 | 
				
			||||||
 | 
					  service_count = 0
 | 
				
			||||||
 | 
					  client_limit = 25000
 | 
				
			||||||
 | 
					  process_min_avail = {{ CPU_COUNT }}
 | 
				
			||||||
 | 
					  process_limit = {{ CPU_COUNT }}
 | 
				
			||||||
 | 
					  vsz_limit = 256M
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					!include_try /overrides/dovecot.conf
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -256,8 +256,10 @@ correct syntax. The following file names will be taken as override configuration
 | 
				
			|||||||
   - For both ``postfix.cf`` and ``postfix.master``, you need to put one configuration per line, as they are fed line-by-line
 | 
					   - For both ``postfix.cf`` and ``postfix.master``, you need to put one configuration per line, as they are fed line-by-line
 | 
				
			||||||
     to postfix.
 | 
					     to postfix.
 | 
				
			||||||
   - ``logrotate.conf`` as ``$ROOT/overrides/postfix/logrotate.conf`` - Replaces the logrotate.conf file used for rotating ``POSTFIX_LOG_FILE``.
 | 
					   - ``logrotate.conf`` as ``$ROOT/overrides/postfix/logrotate.conf`` - Replaces the logrotate.conf file used for rotating ``POSTFIX_LOG_FILE``.
 | 
				
			||||||
- `Dovecot`_ - ``dovecot.conf`` in dovecot sub-directory;
 | 
					- `Dovecot`_ - ``dovecot.conf`` in dovecot sub-directory.
 | 
				
			||||||
- `Nginx`_ - All ``*.conf`` files in the ``nginx`` sub-directory;
 | 
					- `Nginx`_ :
 | 
				
			||||||
 | 
					   - All ``*.conf`` files in the ``nginx`` sub-directory.
 | 
				
			||||||
 | 
					   - ``proxy.conf`` in the ``nginx/dovecot`` sub-directory.
 | 
				
			||||||
- `Rspamd`_ - All files in the ``rspamd`` sub-directory.
 | 
					- `Rspamd`_ - All files in the ``rspamd`` sub-directory.
 | 
				
			||||||
- `Roundcube`_ - All ``*.inc.php`` files in the ``roundcube`` sub directory.
 | 
					- `Roundcube`_ - All ``*.inc.php`` files in the ``roundcube`` sub directory.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										2
									
								
								towncrier/newsfragments/3450.bugfix
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										2
									
								
								towncrier/newsfragments/3450.bugfix
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,2 @@
 | 
				
			|||||||
 | 
					Ensure we can do more than 100 parallel sessions.
 | 
				
			||||||
 | 
					Allow dovecot's config to be overriden in front too
 | 
				
			||||||
		Reference in New Issue
	
	Block a user