diff --git a/docs/firststeps-snat.md b/docs/firststeps-snat.md new file mode 100644 index 000000000..3f6179b7e --- /dev/null +++ b/docs/firststeps-snat.md @@ -0,0 +1,20 @@ +## SNAT + +SNAT is used to change the source address of the packets sent by mailcow. +It can be used to change the outgoing IP on systems with multiple IP addresses. + +Open `mailcow.conf`, set either or both of the following parameters: + +``` +# Use this IPv4 for outgoing connections (SNAT) +SNAT_TO_SOURCE=1.2.3.4 + +# Use this IPv6 for outgoing connections (SNAT) +SNAT6_TO_SOURCE=dead:beef +``` + +Run `docker-compose up -d`. + +The values are read by netfilter-mailcow. netfilter-mailcow will make sure, the post-routing rules are on position 1 in the netfilter table. It does automatically delete and re-create them if they are found on another position than 1. + +Check the output of `docker-compose logs --tail=200 netfilter-mailcow` to ensure the SNAT settings have been applied. diff --git a/docs/u_e-nginx.md b/docs/u_e-nginx.md new file mode 100644 index 000000000..0404274dc --- /dev/null +++ b/docs/u_e-nginx.md @@ -0,0 +1,26 @@ +## Custom sites + +To create persistent (over updates) sites hosted by mailcow: dockerized, a new site configuration must be placed inside `data/conf/nginx/`: + +``` +nano data/conf/nginx/my_custom_site.conf +``` + +The filename is not important, as long as the filename carries a .conf extension. + +It is also possible to extend the configuration of the default file `site.conf` file: + +``` +nano data/conf/nginx/site.my_content.custom +``` + +This filename does not need to have a ".conf" extension, but follows the pattern `site.*.custom`, where `*` is a custom name. + +If PHP is to be included in a custom site, please use the PHP-FPM listener on phpfpm:9002 or create a new listener in `data/conf/phpfpm/php-fpm.d/pools.conf`. + +Restart Nginx (and PHP-FPM, if a new listener was created): + +``` +docker-compose restart nginx-mailcow +docker-compose restart php-fpm-mailcow +``` diff --git a/mkdocs.yml b/mkdocs.yml index f3650fbea..d3f41a11d 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -28,6 +28,7 @@ pages: - 'SSL': 'firststeps-ssl.md' - 'Rspamd Web UI': 'firststeps-rspamd_ui.md' - 'Reverse Proxy': 'firststeps-rp.md' + - 'SNAT': 'firststeps-snat.md' - 'Setup a relayhost': 'firststeps-relayhost.md' - 'Logging': 'firststeps-logging.md' - 'Local MTA on Docker host': 'firststeps-local_mta.md' @@ -62,6 +63,7 @@ pages: - "Expunge a User's Mails": 'u_e-dovecot-expunge.md' - 'More Examples with DOVEADM': 'u_e-dovecot-more.md' - 'Move vmail volume': 'u_e-dovecot-vmail-volume.md' + - 'Nginx': 'u_e-nginx.md' - 'Redis': 'u_e-redis.md' - 'Rspamd': 'u_e-rspamd.md' - 'SOGo': 'u_e-sogo.md'