Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
docker_notes:docker-mailserver [2024-01-08 Mon wk02 20:33] – [alias] baumkpdocker_notes:docker-mailserver [2025-06-22 Sun wk25 15:19] (current) – [dovecot] baumkp
Line 1: Line 1:
 {{tag>linux docker mail mailserver Alpine dovecot postfix sqlite s6 s6-rc}} {{tag>linux docker mail mailserver Alpine dovecot postfix sqlite s6 s6-rc}}
 ======Docker mailserver====== ======Docker mailserver======
-This mailserver setup follows Workaround's [[https://workaround.org/ispmail-bookworm/|SPmail guide for Debian 12 “Bookworm”]].  Key changes are that instead of installing on Debian 11 virtual machine<sup>1</sup>, with a Maria mysql database<sup>2</sup>, this setup is for installation on latest Alpine linux Docker image with s6-rc init using sqlite database.+This mailserver setup follows Workaround's [[https://workaround.org/ispmail-bookworm/|SPmail guide for Debian 12 “Bookworm”]].  Key changes are that instead of installing on Debian 12 virtual machine<sup>1</sup>, with a Maria mysql database<sup>2</sup>, this setup is for installation on latest Alpine linux Docker image with s6-rc init using maria database.  I toyed with sqlite and basically got it functional, however the support apps do not function with sqlite, so I went back to using MySQL/MariaDB.
  
 //As this follows Workaround's [[https://workaround.org/ispmail-bookworm/|SPmail guide for Debian 12 “Bookworm”]], significant amounts of text have been copied and generally modified from there. **I hereby credit Workaround's author Christoph Haas.**  Furthermore Christoph's guide is very descriptive and should be referenced to get a better understanding of how to put together a mailserver.// //As this follows Workaround's [[https://workaround.org/ispmail-bookworm/|SPmail guide for Debian 12 “Bookworm”]], significant amounts of text have been copied and generally modified from there. **I hereby credit Workaround's author Christoph Haas.**  Furthermore Christoph's guide is very descriptive and should be referenced to get a better understanding of how to put together a mailserver.//
  
-<fc #ff0000>**The notes here are my current working attempt to get an Alpine s6-rc Docker implementation of Postfix and Dovecot, with sqlite based mail server functional and are currently incomplete.** 
-</fc>  
   - Use of virtual machines is much more common these days than base metal for applications. However Workarounds Debian email server could be loaded on base metal.   - Use of virtual machines is much more common these days than base metal for applications. However Workarounds Debian email server could be loaded on base metal.
   - The database requirements for a small mailserver with a few dozen domains, with each domain having hundreds of emails and aliases is well within the capacity of the sqlite database. The use of a full multi user server / client relational database is not necessary, particularly for a Docker based server implementation. See [[https://www.digitalocean.com/community/tutorials/sqlite-vs-mysql-vs-postgresql-a-comparison-of-relational-database-management-systems|SQLite vs MySQL vs PostgreSQL: A Comparison Of Relational Database Management Systems]]   - The database requirements for a small mailserver with a few dozen domains, with each domain having hundreds of emails and aliases is well within the capacity of the sqlite database. The use of a full multi user server / client relational database is not necessary, particularly for a Docker based server implementation. See [[https://www.digitalocean.com/community/tutorials/sqlite-vs-mysql-vs-postgresql-a-comparison-of-relational-database-management-systems|SQLite vs MySQL vs PostgreSQL: A Comparison Of Relational Database Management Systems]]
 +
 +<fc #008000>I got the Docker emailer server functional mid 2023.  It still needs some more work. I recently went through and clean up some non-fatal errors in the configuration that were showing in the logs, mid 2024.  Currently I run the mail server 2 containers, I would rather have it all in one container.  The email server could also have some more optimisations performed.
 +</fc>
 =====Dockerfile===== =====Dockerfile=====
 I go annoyed with the messy UID and GID and found this reference to attempt to standardise upon.  <fc #ffa500>//Sadly there seems to be no comprehensive standard!//</fc> I go annoyed with the messy UID and GID and found this reference to attempt to standardise upon.  <fc #ffa500>//Sadly there seems to be no comprehensive standard!//</fc>
Line 52: Line 53:
 ====alias==== ====alias====
 I could not get the alias command to work in Alpine shell.  I tried /etc/profile and /etc/profile.d to no avail.  So the following seems to meet my needs: I could not get the alias command to work in Alpine shell.  I tried /etc/profile and /etc/profile.d to no avail.  So the following seems to meet my needs:
-  *create file ++++ll.sh| +  *create file ''ll.sh'' 
-<code>#!/bin/sh+    *<code>#!/bin/sh
 exec ls -la "$@"</code> exec ls -la "$@"</code>
-+++++  *chmod +x ll.sh to allow to to be an executable. 
 +  *Copy the ll.sh file to /bin/ll or link it ''/bin/ln -s /app/scripts/ll.sh /bin/ll''
  
 =====sqlite===== =====sqlite=====
Line 221: Line 223:
 ====ISPmail Admin==== ====ISPmail Admin====
 I will setup DNS and Traefik for this to be ''mailadmin.local.kptree.net'' This will only be accessible on the LAN. I will setup DNS and Traefik for this to be ''mailadmin.local.kptree.net'' This will only be accessible on the LAN.
 +Admin user is mailserver with associated password.
 =====adminer===== =====adminer=====
 **phpMyAdmin** is a web based mysql management interface. **phpMyAdmin** is a web based mysql management interface.
Line 248: Line 251:
 <code>/ # postconf mail_version <code>/ # postconf mail_version
 mail_version = 3.7.4</code> mail_version = 3.7.4</code>
 +  *''postconf -d''  to print default parameters
 +  *''postconf -n''  to print parameters specifically changed in main.cf
  
 ====Making Postfix get its information from the sqlite database==== ====Making Postfix get its information from the sqlite database====
Line 309: Line 314:
   *''postfix stop'' to stop postfix   *''postfix stop'' to stop postfix
   *''postfix reload'' to reload configuration   *''postfix reload'' to reload configuration
-  *''pstfix status'' to return current postfix operating status+  *''postfix status'' to return current postfix operating status
 It looks a shell script is used to control Postfix, in Alpine is is located ++here|/usr/libexec/postfix/postfix-script++ It looks a shell script is used to control Postfix, in Alpine is is located ++here|/usr/libexec/postfix/postfix-script++
  
Line 348: Line 353:
 Alpine posfix would seem to be setup to use postlogd, as master.cf has the following line already configured:  ''%%postlog   unix-dgram n  -                         postlogd%%''. Hence the following does not need to be used: ''%%/bin/echo 'postlog   unix-dgram n  -                         postlogd' >> '/etc/postfix/master.cf'%%'' Alpine posfix would seem to be setup to use postlogd, as master.cf has the following line already configured:  ''%%postlog   unix-dgram n  -                         postlogd%%''. Hence the following does not need to be used: ''%%/bin/echo 'postlog   unix-dgram n  -                         postlogd' >> '/etc/postfix/master.cf'%%''
  
 +The ''postfix.log'' warning "postfix/postfix-script[228]: warning: group or other writable: /etc/postfix/./master.cf"  is probably as the noted file has been setup using a symlink.  As it is a warning only no further concern.
 +====/etc/postfix/aliases====
 +I get an error when recreating the container; "error: open database /etc/postfix/aliases.lmdb: No such file or directory"  The postfix command recreates the missing/corupt aliases.lmdb file; ''newaliases''.I added this to my Docker container startup script.  This solved the problem, but not sure if this is the right way to do this.
 ====Postfix References==== ====Postfix References====
   *Postfix:   *Postfix:
Line 363: Line 371:
  
 =====dovecot===== =====dovecot=====
-''/etc/dovecot/conf.d''+In Dovecot <2.4.x the main configuration are in files ''/etc/dovecot/conf.d'', although /etc/dovecot/dovecot.conf is still used and can be used for all configuration. In Dovecot >= 2.4.x the main configuration is in /etc/dovecot/dovecot.conf, however configuration files in /etc/dovecot/conf.d may also still be used.  That being said, Dovecot version 2.4.x has significant breaking configuration setting changes from earlier versions.
 <code>/ # dovecot --version <code>/ # dovecot --version
 2.3.20 (80a5ac675d) </code> 2.3.20 (80a5ac675d) </code>
 +  *''doveconf -d''  to print default parameters
 +  *''doveconf -n''  to print parameters specifically changed in main.cf
 +
 +Alpine Linux version 3.22 from May 2025 used Dovecot 2.4.1 and while I can use an older version of Alpine eventually I would need to upgrade Dovecot to the new configuration file syntax.  Basically Dovecot now recommends placing all configuration in one configuration file instead of many, ''/etc/dovecot/dovecot.conf'' It does allow the previous  configuration files under /etc/dovecot/conf.d to be used by the directive ''!include conf.d/*.conf'' in the dovecot.conf file.  The later directives will overwrite previous. Below is a copy on my update dovecot.conf file that appears to function on Dovecot 2.4.1. See [[https://doc.dovecot.org/2.4.1/core/settings/syntax.html#config-version|Dovecot Config File Syntax ]]
 +++++Discussion on configuration files|
 +I suspect the ''conf.d'' directory breakdown style configuration files is a bit of a legacy hangover from where the configuration files also effectively included many comments and commented options. Breaking into smaller files helps navigate this style of configuration.  The past 10+ years where search engines can be used to easily find configuration information and example configuration files the fully documented configuration files are no longer as necessary.  A single simplified configuration file with reference to online help files makes more sense and is easier to navigated.  I prefer the single file to multiple files.
 +The only other issue is use of override files in ''conf.d'' versus default distributors conf file.  I do not believe this is or was the fundamental intent of dovecot use of ''conf.d''
 +++++  
 +====dovecot.conf====
 +++++/etc/dovecot/dovecot.conf|
 +# Start new configs with the latest Dovecot version numbers here:\\
 +[[https://doc.dovecot.org/main/core/summaries/settings.html#dovecot_config_version|dovecot_config_version]] = 2.4.1\\
 +[[https://doc.dovecot.org/main/core/summaries/settings.html#dovecot_storage_version|dovecot_storage_version]] = 2.4.1\\
 +
 +#[[https://doc.dovecot.org/main/core/summaries/settings.html#mail_debug|mail_debug]] = yes\\
 +#[[https://doc.dovecot.org/main/core/summaries/settings.html#log_debug|log_debug]] = category=ssl\\
 +[[https://doc.dovecot.org/main/core/summaries/settings.html#mail_cache_max_size|mail_cache_max_size]] = 128M\\
 +
 +[[https://doc.dovecot.org/main/core/summaries/settings.html#auth_mechanisms|auth_mechanisms]] = plain login\\
 +[[https://doc.dovecot.org/main/core/summaries/settings.html#info_log_path|info_log_path]] = /var/log/dovecot-info.log\\
 +[[https://doc.dovecot.org/main/core/summaries/settings.html#log_path|log_path]] = /var/log/dovecot.log\\
 +[[https://doc.dovecot.org/main/core/summaries/settings.html#mail_driver|mail_driver]] = maildir\\
 +mail_path = ~/Maildir\\
 +
 +mail_plugins {\\
 +  quota = yes\\
 +}\\
 +
 +#sieve_plugins {\\
 +#  sieve_extprograms = yes\\
 +#}\\
 +
 +managesieve_notify_capability = mailto\\
 +managesieve_sieve_capability = fileinto reject envelope encoded-character vacation subaddress comparator-i;ascii-numeric relational regex imap4flags copy include variables body enotify environment mailbox date index ihave duplicate mime foreverypart extracttext\\
 +
 +mbox_write_locks = fcntl\\
 +
 +namespace inbox {\\
 +  inbox = yes\\
 +  mailbox Drafts {\\
 +    special_use = \Drafts\\
 +  }\\
 +  mailbox Junk {\\
 +    special_use = \Junk\\
 +  }\\
 +  mailbox Sent {\\
 +    special_use = \Sent\\
 +  }\\
 +  mailbox "Sent Messages" {\\
 +    special_use = \Sent\\
 +  }\\
 +  mailbox Trash {\\
 +    special_use = \Trash\\
 +  }\\
 +  prefix = \\
 +}\\
 +
 +quota "Shared quota" {\\
 +#quota = maildir:User quota\\
 +  quota_status_nouser = DUNNO\\
 +  quota_status_overquota = 452 4.2.2 Mailbox is full and cannot receive any more emails\\
 +  quota_status_success = DUNNO\\
 +  warning warn-95 {\\
 +    quota_storage_percentage = 95 \\
 +    execute quota-warning {\\
 +      args = 95 %{user}\\
 +      }\\
 +    }\\
 +  warning warn-80 {\\
 +    quota_storage_percentage = 80\\
 +    execute quota-warning {\\
 +      args = 80 %{user}\\
 +      }\\
 +    }\\
 +}\\
 +
 +#sieve = file:~/sieve;active=~/.dovecot.sieve\\
 +sieve_script_driver = file\\
 +sieve_script_active_path = ~/.dovecot.sieve\\
 +sieve_script_type = after \\
 +sieve_script_path = /etc/dovecot/sieve-after\\
 +
 +protocols = imap lmtp\\
 +service auth {\\
 +  unix_listener /var/spool/postfix/private/auth {\\
 +    group = postfix\\
 +    mode = 0660\\
 +    user = postfix\\
 +  }\\
 +}\\
 +service lmtp {\\
 +  unix_listener /var/spool/postfix/private/dovecot-lmtp {\\
 +    group = postfix\\
 +    mode = 0600\\
 +    user = postfix\\
 +  }\\
 +}\\
 +service quota-status {\\
 +  executable = quota-status -p postfix\\
 +  unix_listener /var/spool/postfix/private/quota-status {\\
 +    user = postfix\\
 +  }\\
 +}\\
 +service quota-warning {\\
 +  executable = script /usr/local/bin/quota-warning.sh\\
 +  unix_listener quota-warning {\\
 +    group = vmail\\
 +    mode = 0660\\
 +    user = vmail\\
 +  }\\
 +}\\
 +ssl = required\\
 +ssl_server_cert_file = /app/certificates/kptree.net.cer\\
 +ssl_server_dh_file = /etc/dovecot/dh.pem \\
 +ssl_server_key_file = /app/certificates/kptree.net.key\\
 +ssl_server_prefer_ciphers = server\\
 +ssl_min_protocol = TLSv1.2\\
 +
 +sql_driver = mysql\\
 +
 +mysql localhost {\\
 +  host = mail_db \\
 +  dbname = mailserver\\
 +  user = mailserver \\
 +  password = K6oF4xOZFIo2cYrwTQ03jQWwx7t2my\\
 +}\\
 +
 +passdb sql {\\
 +  query = SELECT password FROM virtual_users WHERE email='%{user}'\\
 +}\\
 +
 +userdb sql {\\
 +  query = SELECT email as user, \
 +  concat('*:bytes=', quota) AS quota_rule, \
 +  '/var/vmail/%{user | domain}/%{user | username}' AS home, \
 +  5000 AS uid, 5000 AS gid \
 +  FROM virtual_users WHERE email='%{user}'\\
 +  iterate_query = SELECT email AS user FROM virtual_users\\
 +}\\
 +
 +protocol lmtp {\\
 +  mail_plugins = " quota sieve"\\
 +}\\
 +
 +protocol imap {\\
 +  mail_plugins = " quota imap_quota"\\
 +}\\
 +
 +#!include conf.d/*.conf\\
 +++++
  
 ====dovecot database configuration and testing==== ====dovecot database configuration and testing====
Line 476: Line 634:
 ====dovecot testing with mutt==== ====dovecot testing with mutt====
 Workaround suggests the following command to be used to test: ''%%mutt -f imaps://john@example.org@webmail.example.org%%''  The webmail.example.org simple made no sense to me and did not function with error ''Could not find the host "webmail.example.org"'' As I am creating this in Docker and separately taking the certificates from Traefik, this mailserver simple is not linked in a anyway with a webserver!  The webservers for the database access and webmail are totally separate containers.  The "simple" solution was to use "localhost" from within the mailserver docker container, e.g. ''%%mutt -f imaps://john@example.org@localhost%%''.   Workaround suggests the following command to be used to test: ''%%mutt -f imaps://john@example.org@webmail.example.org%%''  The webmail.example.org simple made no sense to me and did not function with error ''Could not find the host "webmail.example.org"'' As I am creating this in Docker and separately taking the certificates from Traefik, this mailserver simple is not linked in a anyway with a webserver!  The webservers for the database access and webmail are totally separate containers.  The "simple" solution was to use "localhost" from within the mailserver docker container, e.g. ''%%mutt -f imaps://john@example.org@localhost%%''.  
 +
 +====dovecot ssl_dh====
 +
 +I was getting the following error coming up occasionally in my Dovecot log file, "May 25 12:16:05 imap-login: Error: Diffie-Hellman key exchange requested, but no DH parameters provided. Set ssl_dh=</path/to/dh.pem". To help resolve this error I set up the ssl_dh parameter in 10-ssl.conf, see [[https://doc.dovecot.org/configuration_manual/dovecot_ssl_configuration/#id8|Dovecot SSL configuration]] for instructions.  The creation of the dh.pem was taking so long on the server that I stopped and created on the desktop, it was much faster.  I then simply text copied to the server.
  
 ====dovecot logging==== ====dovecot logging====
 +
 +====dovecot pigeonhole====
 +Pigeonhole is the name of the project that adds support for the [[http://www.sieve.info/|Sieve language (RFC 5228)]] and the [[http://tools.ietf.org/html/rfc5804|ManageSieve protocol (RFC 5804)]] to the [[http://www.dovecot.org/|Dovecot Secure IMAP Server]].
  
 ====Dovecot References==== ====Dovecot References====
   *Doc Dovecot:   *Doc Dovecot:
-    *[[https://doc.dovecot.org/configuration_manual/dovecot_ssl_configuration/|Dovecot SSL configuration]] +    *[[https://doc.dovecot.org/|Dovecot Community Edition Documentation]] 
-    *[[https://doc.dovecot.org/configuration_manual/howto/simple_virtual_install/#simple-virtual-install-smtp-auth|Simple Virtual User Installation]] +    *Dovecot 2.4.x 
-    *[[https://doc.dovecot.org/configuration_manual/namespace/|Namespaces]] +      *[[https://dovecot.org/mailman3/archives/list/dovecot@dovecot.org/message/WYKOYFBRIC622755CYOZQJV7IO7RKUM6/|Dovecot 2.4 Example config]] 
-    *[[https://wiki.dovecot.org/HowTo|HOWTOs Examples Tutorials]] +    ++++Dovecot 2.3.x| 
-    *[[https://doc.dovecot.org/settings/plugin/|Plugin Settings]] +      *[[https://doc.dovecot.org/2.3/configuration_manual/dovecot_ssl_configuration/|Dovecot SSL configuration]] 
-    *[[https://wiki2.dovecot.org/LDA/Postfix|Dovecot LDA with Postfix]] +      *[[https://doc.dovecot.org/2.3/configuration_manual/howto/simple_virtual_install/#simple-virtual-install-smtp-auth|Simple Virtual User Installation]] 
-    *[[https://doc.dovecot.org/configuration_manual/mail_location/|Mail Location Settings]] +      *[[https://doc.dovecot.org/2.3/configuration_manual/namespace/|Namespaces]] 
-    *[[https://doc.dovecot.org/admin_manual/doveadm_mailbox_commands/|Doveadm Mailbox Commands]] +      *[[https://doc.dovecot.org/2.3/settings/plugin/|Plugin Settings]] 
-    *[[https://wiki.dovecot.org/Tools/Doveadm|ToolsDoveadm]] +      *[[https://doc.dovecot.org/2.3/configuration_manual/mail_location/|Mail Location Settings]] 
-    *[[https://doc.dovecot.org/configuration_manual/authentication/password_schemes/|Password Schemes]] +      *[[https://doc.dovecot.org/2.3/admin_manual/doveadm_mailbox_commands/|Doveadm Mailbox Commands]] 
-    *[[https://wiki1.dovecot.org/AuthDatabase/SQL|AuthDatabase / SQL]] +      *[[https://doc.dovecot.org/2.3/configuration_manual/authentication/password_schemes/|Password Schemes]] 
-    *[[https://doc.dovecot.org/configuration_manual/authentication/sql/|SQL]] +      *[[https://doc.dovecot.org/2.3/configuration_manual/authentication/sql/|SQL]] 
-    *[[https://doc.dovecot.org/admin_manual/logging/|Dovecot Logging]] +      *[[https://doc.dovecot.org/2.3/admin_manual/logging/|Dovecot Logging]] 
-    *[[https://doc.dovecot.org/configuration_manual/quota_plugin/|Quota Plugin]] +      *[[https://doc.dovecot.org/2.3/configuration_manual/quota_plugin/|Quota Plugin]] 
-  *Other: +        *Other: 
-    *[[http://rob0.nodns4.us/|Postfix, DNS and general Linux system administration and consulting]] +          *[[http://rob0.nodns4.us/|Postfix, DNS and general Linux system administration and consulting]] 
-    *[[http://rob0.nodns4.us/howto/3-dovecot|F. Dovecot configuration]] +          *[[http://rob0.nodns4.us/howto/3-dovecot|F. Dovecot configuration]] 
-    *[[https://serverfault.com/questions/803533/dovecot-storing-mails-in-var-mail-but-mail-location-set-to-maildir-var-mail-v|Dovecot storing mails in /var/mail, but mail_location set to maildir:/var/mail/vhosts/%d/%n]] +          *[[https://serverfault.com/questions/803533/dovecot-storing-mails-in-var-mail-but-mail-location-set-to-maildir-var-mail-v|Dovecot storing mails in /var/mail, but mail_location set to maildir:/var/mail/vhosts/%d/%n]] 
-    *[[https://manpages.org/dovecot|man dovecot]] +++++
 =====Certificates SSL/TSL===== =====Certificates SSL/TSL=====
-Early on, before 2015 there were not many free SSL certificate providers. I used StartSSL for a free certificate.  They would purchased by a company that managed to get their certificate deregister...... So StartSSL basically became non-usable circa 2017.  Fourtunately a better solution came about a year or 2 earlier called LetsEncrypt. This could be used with certbot to get free certificates and eventually free wildcard certificates. Then came Traefik which handled certificates +Early on, before 2015 there were not many free SSL certificate providers. I used StartSSL for a free certificate.  They would purchased by a company that managed to get their certificate deregister...... So StartSSL basically became non-usable circa 2017.  Fourtunately a better solution came about a year or 2 earlier called LetsEncrypt. This could be used with certbot to get free certificates and eventually free wildcard certificates. Then came Traefik which handled certificates.
 =====apache2===== =====apache2=====
 Alpine apk apache2 distribution seems to follow the Red Hat setup style. The daemon is httpd instead of apache2.  So I need to learn a new setup. Alpine apk apache2 distribution seems to follow the Red Hat setup style. The daemon is httpd instead of apache2.  So I need to learn a new setup.
Line 598: Line 762:
     * https://wiki.nginx.org/QuickStart     * https://wiki.nginx.org/QuickStart
     * https://wiki.nginx.org/Configuration     * https://wiki.nginx.org/Configuration
 +
 +Places to change php version number:
 +  *In the Docker file us the variable ''ARG PHPVERION=82''
 +  *All the /php82/ paths in the pre_start_script.sh, ''.config_php/scripts/pre_start_script.sh''
 +  *The php-fpm82 reference in ''.config_php/s6-rc.d/php-fpm/run''
 +  *''.config_php/etc/php/php-fpm.conf'' change the following /php82/ path references:
 +    *''error_log = log/php82/error.log''
 +    *''include=/etc/php82/php-fpm.d/*.conf''
  
 ===Reference=== ===Reference===
Line 754: Line 926:
         └── www (directory location of Roundcube files, created by Roundcube if empty)</code>         └── www (directory location of Roundcube files, created by Roundcube if empty)</code>
 ++++ ++++
 +
 +====Roundcube Docker Plugins====
 +See https://github.com/roundcube/roundcubemail-docker/tree/master/examples#installing-roundcube-plugins  that indicate plugins can be directly added to the container using ''docker exec -it roundcubemail composer require source/plugin_name --update-no-dev'' I have used the following plugins:
 +  *''weird-birds/thunderbird_labels''
 +    *See https://github.com/mike-kfed/roundcube-thunderbird_labels
 +  *''jfcherng-roundcube/show-folder-size''
 +    *See https://github.com/jfcherng-roundcube/plugin-show-folder-size
 +    *To use, in Roundcube right click on a mail directory and select ''show folder size'' menu item
 +  *''takika/rc_tls_icon''
 +    *See https://github.com/Takika/rc_tls_icon
 +  *managesieve - haven't got this working
  
 Some links: Some links:
Line 772: Line 955:
   *[[https://github.com/roundcube/roundcubemail-docker|Roundcube Docker Git Page]]   *[[https://github.com/roundcube/roundcubemail-docker|Roundcube Docker Git Page]]
   *[[https://wiki.alpinelinux.org/wiki/Roundcube|Alpine Roundcube]] seems to be based upon Lighttpd web server and postgres database with manual download of Roundcube.   *[[https://wiki.alpinelinux.org/wiki/Roundcube|Alpine Roundcube]] seems to be based upon Lighttpd web server and postgres database with manual download of Roundcube.
 +=====dmarc=====
 +[[https://www.mailercheck.com/articles/how-to-read-a-dmarc-report-and-actually-understand-it|How to read a DMARC report—and actually understand it!]]
 +
 +=====rspamd=====
 +
 +rspamd -u rspamd -g rspamd
 +
 +Help from rspamd: ++++rspamd -h|
 +<code>Usage:
 +  rspamd [OPTION*] - run rspamd daemon
 +
 +Summary:
 +  Rspamd daemon version 3.7.4
 +
 +Help Options:
 +  -h, --help              Show help options
 +
 +Application Options:
 +  -f, --no-fork           Do not daemonize main process
 +  -c, --config            Specify config file(s)
 +  -u, --user              User to run rspamd as
 +  -g, --group             Group to run rspamd as
 +  -p, --pid               Path to pidfile
 +  -d, --debug             Force debug output
 +  -i, --insecure          Ignore running workers as privileged users (insecure)
 +  -v, --version           Show version and exit
 +  --var                   Redefine/define environment variable
 +  -T, --skip-template     Do not apply Jinja templates
 +  --lua-env               Load lua environment from the specified files </code>
 +++++
 +
 +[[https://rspamd.com/doc/quickstart.html|Rspamd quick start]]
 +
 +=====redis=====
 +  *Load the Alpine package ''redis''
 +  *To start on command line ''redis-server /etc/redis.conf &''
 +    *The redis configuration file ''/etc/redis.conf'' is installed with the redis package.
 +    *The default conf log file is ''/var/log/redis/redis.log'' Use ''mkdir /var/log/redis'' to make directory if required.
 +  *To stop on command line ''redis-cli shutdown''
 +  *Redis complains if 'vm.overcommit_memory' is not equal to 1.
 +    *This is not set in the container (Docker does have sysctl directive, but not all kernal parameters are support, including this one.)
 +    *This can be set in the host ''sudo sysctl -w vm.overcommit_memory=1''
 +Some reference links:
 +  *Redis
 +    *[[https://redis.io/docs/install/install-redis/|Install Redis]]
 +    *[[https://redis.io/docs/get-started/faq/#background-saving-fails-with-a-fork-error-on-linux|Redis FAQ]]
 +  *[[https://ourcodeworld.com/articles/read/2083/how-to-remove-redis-warning-on-docker-memory-overcommit-must-be-enabled|How to remove Redis warning on Docker: Memory overcommit must be enabled ]]
 +  *[[https://docs.docker.com/engine/reference/commandline/run/#sysctl|Docker sysctl]]
 +====nftables====
 +rspamd requires netfilter chains to functions. So a nftables needs to be available and a basic input chain setup to function.  See [[https://wiki.kptree.net/doku.php?id=docker_notes:docker#dns_and_nftable_iptables_netfilter_within_containers|netfilter use within containers]] that describe why care must be taken no to interfere with existing netfilter nat chains required for container DNS function.
 +
 +=====Mailserver testing from CLI=====
 +  *''telnet mail.kptree.net 25'' Tests the main SMPT mail server connectivity. Port 25 is also designated smtp.
 +  *''telnet mail.kptree.net 587'' Tests the mail client SMPT server connectivity.  Port 25 is also designated submission.  STARTTLS; Normal Password
 +  *''telnet mail.kptree.net imap'' Tests the mail client imap server connectivity.  The designation imap is port 143.  STARTTLS; Normal Password
 +
 +The mailserver exit control character is '^]' or control key ].
 +The SMTP and mailserver exit control character is '^]' or control key ].
 +
 +
 +=====Errors=====
 +<code>Temporary lookup failure.
 +Please check the message recipient "admin@kptree.net" and try again.</code>
 +[[https://serverfault.com/questions/506347/postfix-temporary-lookup-failure]]
 +[[https://serverfault.com/questions/745545/postfix-rcpt-to-temporary-lookup-failure]]
 +
 +=====Email Clients=====
 +====mutt====
 +Mutt is a small but very powerful text-based MIME mail client.
 +  *[[http://www.mutt.org/doc/manual/|Mutt manual]]
 +  *[[https://commandmasters.com/commands/mutt-common/|How to use the command 'mutt' (with examples)]]
 +  *[[https://www.howtogeek.com/command-line-email-with-mutt/|Command Line Email With Mutt: Manage Your Inbox in the Terminal]]
 +
 +====swaks====
 +The swaks command, short for “Swiss Army Knife SMTP,” is an all-purpose SMTP transaction tester.
 +  *[[http://jetmore.org/john/code/swaks/|Swaks - Swiss Army Knife for SMTP]]
 +  *[[https://easyengine.io/tutorials/mail/swaks-smtp-test-tool/|swaks – SMTP test tool]]
 +  *[[https://commandmasters.com/commands/swaks-linux/|How to Use the Command 'swaks' (with Examples)]]
 =====References===== =====References=====
   *Workaround.org [[https://workaround.org/ispmail/bullseye/|ISPmail guide for Debian 11 “Bullseye”]]   *Workaround.org [[https://workaround.org/ispmail/bullseye/|ISPmail guide for Debian 11 “Bullseye”]]