Hi, thanks for your excellent project, It is really simple to deploy mailing system.
However, I have few troubles with mail delivery. The mailing system somehow cannot deliver emails, but the login is ok.
Here are the docker logs from mail container:
#
#
# ENV
#
#
HOSTNAME=mail.mydomain.com
DMS_DEBUG=1
VIRUSMAILS_DELETE_DELAY=7
ENABLE_CLAMAV=1
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
ENABLE_FAIL2BAN=1
ENABLE_SPAMASSASSIN=1
PWD=/
SHLVL=1
HOME=/root
ONE_DIR=1
SSL_TYPE=letsencrypt
DEBIAN_FRONTEND=noninteractive
_=/usr/bin/printenv
#
#
# docker-mailserver
#
#
Initializing setup
Registering check,setup,fix,misc and start-daemons functions
* _check_environment_variables() registered
* _check_hostname() registered
* _setup_default_vars() registered
* _setup_dovecot() registered
* _setup_dovecot_local_user() registered
* _setup_dkim() registered
* _setup_ssl() registered
* _setup_docker_permit() registered
* _setup_mailname() registered
* _setup_amavis() registered
* _setup_dmarc_hostname() registered
* _setup_postfix_hostname() registered
* _setup_dovecot_hostname() registered
* _setup_postfix_override_configuration() registered
* _setup_postfix_sasl_password() registered
* _setup_security_stack() registered
* _setup_postfix_aliases() registered
* _setup_postfix_vhost() registered
* _setup_environment() registered
* _fix_var_mail_permissions() registered
* _fix_var_amavis_permissions() registered
* _misc_save_states() registered
* _start_daemons_cron() registered
* _start_daemons_rsyslog() registered
* _start_daemons_dovecot() registered
* _start_daemons_opendkim() registered
* _start_daemons_opendmarc() registered
* _start_daemons_postfix() registered
* _start_daemons_fail2ban() registered
* _start_daemons_clamav() registered
* _start_daemons_amavis() registered
Checking configuration
Check that there are no conflicts with env variables [_check_environment_variables]
Check that hostname/domainname is provided or overidden (no default docker hostname/kubernetes) [_check_hostname]
* Domain has been set to mydomain.com
* Hostname has been set to mail.mydomain.com
Configuring mail server
Setting up default variables [_setup_default_vars]
* Set ENABLE_LDAP=0
* Set ENABLE_FETCHMAIL=0
* Set OVERRIDE_HOSTNAME=
* Set ENABLE_MANAGESIEVE=0
* Set DMS_DEBUG=1
* Set ENABLE_POP3=0
* Set ENABLE_SASLAUTHD=0
* Set ENABLE_CLAMAV=1
* Set SMTP_ONLY=0
* Set ENABLE_FAIL2BAN=1
* Set ENABLE_SPAMASSASSIN=1
* Set POSTGREY_DELAY=300
* Set POSTGREY_TEXT=Delayed by postgrey
* Set ENABLE_POSTGREY=0
* Set POSTGREY_MAX_AGE=35
Setting up Dovecot
Setting up Dovecot Local User
* Checking file line endings
* Regenerating postfix user list
* user 'myemail' for domain 'mydomain.com' with password '********'
Setting up DKIM
* DKIM keys added for: mydomain.com
* Changing permissions on /etc/opendkim
Setting up SSL
Setting up PERMIT_DOCKER Option
* Adding container ip in my networks
Setting up Mailname
* Creating /etc/mailname
Setting up Amavis
* Applying hostname to /etc/amavis/conf.d/05-node_id
Setting up dmarc
* Applying hostname to /etc/opendmarc.conf
Applying hostname and domainname to Postfix
* Applying hostname to /etc/postfix/main.cf
Applying hostname to Dovecot
* Applying hostname to /etc/dovecot/conf.d/15-lda.conf
Setting up Postfix Override configuration
* Loaded 'config/postfix-main.cf'
Setting up Postfix SASL Password
* Warning: 'SASL_PASSWD' is not provided. /etc/postfix/sasl_passwd not created.
Setting up Security Stack
* Enabling and configuring spamassassin
* Enabling clamav
* Fail2ban enabled
Setting up Postfix Aliases
Setting up Postfix vhost
Setting up /etc/environment
Checking /var/mail permissions
* Fixing /var/mail permissions
Checking $amavis_state_dir permissions
* Permissions in /var/mail-state/lib-amavis look OK
Starting Misc
* Consolidating all state onto /var/mail-state
* Destination /var/mail-state/spool-postfix exists, linking /var/spool/postfix to it
* Destination /var/mail-state/lib-postfix exists, linking /var/lib/postfix to it
* Destination /var/mail-state/lib-amavis exists, linking /var/lib/amavis to it
* Destination /var/mail-state/lib-clamav exists, linking /var/lib/clamav to it
* Destination /var/mail-state/lib-spamassasin exists, linking /var/lib/spamassasin to it
* Destination /var/mail-state/lib-fail2ban exists, linking /var/lib/fail2ban to it
* Destination /var/mail-state/lib-postgrey exists, linking /var/lib/postgrey to it
Starting mail server
Starting cron [ OK ]
Starting rsyslog [ OK ]
Starting dovecot services [ OK ]
Starting opendkim [ OK ]
Starting opendmarc [ OK ]
Starting postfix [ OK ]
Starting fail2ban [ OK ]
Starting clamav [ OK ]
Starting amavis [ OK ]
#
# mail.mydomain.com is up and running
#
tail: unrecognized file system type 0x794c7630 for '/var/log/mail/mail.log'. please report this to [email protected]. reverting to polling
Apr 16 09:35:16 mail amavis[1384]: Creating db in /var/lib/amavis/db/; BerkeleyDB 0.54, libdb 5.3
Apr 16 09:35:17 mail amavis[1384]: (!)Net::Server: 2017/04/16-09:35:17 Bad fork [Cannot allocate memory]\n at line 145 in file /usr/share/perl5/Net/Server/PreForkSimple.pm
Apr 16 09:35:31 mail dovecot: ssl-params: SSL parameters regeneration completed
Apr 16 09:37:44 mail dovecot: imap-login: Login: user=<[email protected]>, method=PLAIN, rip=95.91.249.171, lip=172.19.0.2, mpid=1389, TLS, session=<ZsE/bUVNGABfW/mr>
Apr 16 09:38:14 mail postfix/scache[977]: statistics: start interval Apr 16 09:34:54
Apr 16 09:38:14 mail postfix/scache[977]: statistics: domain lookup hits=0 miss=1 success=0%
Apr 16 09:38:14 mail postfix/scache[977]: statistics: address lookup hits=0 miss=1 success=0%
Apr 16 09:40:24 mail postfix/smtpd[1390]: connect from unknown[95.91.249.171]
Apr 16 09:40:29 mail postfix/smtpd[1390]: 3A408850C9: client=unknown[95.91.249.171], sasl_method=PLAIN, [email protected]
Apr 16 09:40:29 mail postfix/cleanup[1395]: 3A408850C9: message-id=<>
Apr 16 09:40:29 mail opendkim[150]: 3A408850C9: DKIM-Signature field added (s=mail, d=mydomain.com)
Apr 16 09:40:29 mail opendmarc[161]: 3A408850C9: mydomain.com none
Apr 16 09:40:29 mail postfix/qmgr[968]: 3A408850C9: from=<[email protected]>, size=796, nrcpt=1 (queue active)
Apr 16 09:40:29 mail postfix/smtp[1396]: connect to 127.0.0.1[127.0.0.1]:10024: Connection refused
Apr 16 09:40:29 mail postfix/smtp[1396]: 3A408850C9: to=<[email protected]>, relay=none, delay=0.23, delays=0.23/0.01/0/0, dsn=4.4.1, status=deferred (connect to 127.0.0.1[127.0.0.1]:10024: Connection refused)
Apr 16 09:40:29 mail postfix/smtpd[1390]: disconnect from unknown[95.91.249.171]
I am using a python script to send emails, here is my script:
def send_mail(host, account, passcode, receiver, title, content):
"""Send Email
"""
# login
smtp = SMTP(host)
smtp.ehlo(host)
smtp.login(account, passcode)
smtp.set_debuglevel(1)
# construct message
email = MIMEText(content, "plain", 'utf-8')
email["Subject"] = Header(title, 'utf-8')
email["From"] = account
email["To"] = receiver
smtp.sendmail(account, receiver, email.as_string())
smtp.quit()
The debug info from SMTP of the script as follows:
reply: retcode (250); Msg: b'2.1.0 Ok'
send: 'rcpt TO:<[email protected]>\r\n'
reply: b'250 2.1.5 Ok\r\n'
reply: retcode (250); Msg: b'2.1.5 Ok'
send: 'data\r\n'
reply: b'354 End data with <CR><LF>.<CR><LF>\r\n'
reply: retcode (354); Msg: b'End data with <CR><LF>.<CR><LF>'
data: (354, b'End data with <CR><LF>.<CR><LF>')
send: b'Content-Type: text/plain; charset="utf-8"\r\nMIME-Version: 1.0\r\nContent-Transfer-Encoding: base64\r\nSubject: =?utf-8?q
?mail_title?=\r\nFrom: [email protected]\r\nTo: [email protected]\r\n\r\nblablabla...\r\n.\r\n'
reply: b'250 2.0.0 Ok: queued as 3A408850C9\r\n'
reply: retcode (250); Msg: b'2.0.0 Ok: queued as 3A408850C9'
data: (250, b'2.0.0 Ok: queued as 3A408850C9')
send: 'quit\r\n'
reply: b'221 2.0.0 Bye\r\n'
reply: retcode (221); Msg: b'2.0.0 Bye'
The delivery function was ok but somehow it cannot deliver mail anymore. I also tried to recreate the container but it still give me the error.
Could you help me find out why the connection refused error happens?
Please let me know if you need more infos.
Hi, thanks for your excellent project, It is really simple to deploy mailing system.
However, I have few troubles with mail delivery. The mailing system somehow cannot deliver emails, but the login is ok.
Here are the docker logs from mail container:
I am using a python script to send emails, here is my script:
The debug info from SMTP of the script as follows:
The delivery function was ok but somehow it cannot deliver mail anymore. I also tried to recreate the container but it still give me the error.
Could you help me find out why the
connection refusederror happens?Please let me know if you need more infos.