Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

This should fix most of 2.3 issues reported in #545 & #586 #612

Merged
merged 2 commits into from
May 22, 2017
Merged

Conversation

tomav
Copy link
Contributor

@tomav tomav commented May 21, 2017

This should fix most of 2.3 issues reported in #545 & #586

@tomav tomav changed the title This should fix most of 2.3 issues reported in #545 & 586 This should fix most of 2.3 issues reported in #545 & #586 May 21, 2017
@tomav
Copy link
Contributor Author

tomav commented May 21, 2017

Hmm, tests are working locally...

➜  docker-mailserver git:(issue-545) ✗
# Start tests
./test/bats/bin/bats test/tests.bats
 ✓ checking configuration: hostname/domainname
 ✓ checking configuration: hostname/domainname override
 ✓ checking configuration: hostname/domainname override: check container hostname is applied correctly
 ✓ checking configuration: hostname/domainname override: check overriden hostname is applied to all configs
 ✓ checking configuration: hostname/domainname override: check hostname in postfix HELO message
 ✓ checking configuration: hostname/domainname override: check headers of received mail
 ✓ checking process: postfix
 ✓ checking process: clamd
 ✓ checking process: new
 ✓ checking process: opendkim
 ✓ checking process: opendmarc
 ✓ checking process: fail2ban (disabled in default configuration)
 ✓ checking process: fail2ban (fail2ban server enabled)
 ✓ checking process: fetchmail (disabled in default configuration)
 ✓ checking process: fetchmail (fetchmail server enabled)
 ✓ checking process: clamav (clamav disabled by ENABLED_CLAMAV=0)
 ✓ checking process: saslauthd (saslauthd server enabled)
 ✓ checking process: saslauthd (saslauthd server enabled)
 ✓ checking process: postgrey (disabled in default configuration)
 ✓ checking postgrey: /etc/postfix/main.cf correctly edited
 ✓ checking postgrey: /etc/default/postgrey correctly edited and has the default values
 ✓ checking process: postgrey (postgrey server enabled)
 ✓ checking postgrey: there should be a log entry about a new greylisted e-mail user@external.tld in /var/log/mail/mail.log
 ✓ checking postgrey: there should be a log entry about the retried and passed e-mail user@external.tld in /var/log/mail/mail.log
 ✓ checking postgrey: there should be a log entry about the whitelisted and passed e-mail user@whitelist.tld in /var/log/mail/mail.log
 ✓ checking process: dovecot imaplogin (enabled in default configuration)
 ✓ checking process: dovecot imaplogin (disabled using SMTP_ONLY)
 ✓ checking imap: server is ready with STARTTLS
 ✓ checking imap: authentication works
 ✓ checking pop: server is ready
 ✓ checking pop: authentication works
 ✓ checking sasl: doveadm auth test works with good password
 ✓ checking sasl: doveadm auth test fails with bad password
 ✓ checking sasl: sasl_passwd exists
 ✓ checking logs: mail related logs should be located in a subdirectory
 ✓ checking smtp: authentication works with good password (plain)
 ✓ checking smtp: authentication fails with wrong password (plain)
 ✓ checking smtp: authentication works with good password (login)
 ✓ checking smtp: authentication fails with wrong password (login)
 ✓ checking smtp: delivers mail to existing account
 ✓ checking smtp: delivers mail to existing alias
 ✓ checking smtp: delivers mail to existing alias with recipient delimiter
 ✓ checking smtp: delivers mail to existing catchall
 ✓ checking smtp: delivers mail to regexp alias
 ✓ checking smtp: user1 should have received 6 mails
 ✓ checking smtp: rejects mail to unknown user
 ✓ checking smtp: redirects mail to external aliases
 ✓ checking smtp: rejects spam
 ✓ checking smtp: rejects virus
 ✓ checking smtp_only: mail send should work
 ✓ checking accounts: user accounts
 ✓ checking accounts: user mail folders for user1
 ✓ checking accounts: user mail folders for user2
 ✓ checking accounts: comments are not parsed
 ✓ checking postfix: vhost file is correct
 ✓ checking postfix: main.cf overrides
 ✓ checking dovecot: config additions
 ✓ checking spamassassin: should be listed in amavis when enabled
 ✓ checking spamassassin: should not be listed in amavis when disabled
 ✓ checking spamassassin: docker env variables are set correctly (default)
 ✓ checking spamassassin: docker env variables are set correctly (custom)
 ✓ checking spamassassin: all registered domains should see spam headers
 ✓ checking clamav: should be listed in amavis when enabled
 ✓ checking clamav: should not be listed in amavis when disabled
 ✓ checking clamav: should not be called when disabled
 ✓ checking opendkim: /etc/opendkim/KeyTable should contain 2 entries
 ✓ checking opendkim: /etc/opendkim/keys/ should contain 2 entries
 ✓ checking opendkim: generator creates keys, tables and TrustedHosts
 ✓ checking opendkim: generator creates keys, tables and TrustedHosts without postfix-accounts.cf
 ✓ checking opendkim: generator creates keys, tables and TrustedHosts without postfix-virtual.cf
 ✓ checking ssl: generated default cert works correctly
 ✓ checking ssl: lets-encrypt-x3-cross-signed.pem is installed
 ✓ checking ssl: letsencrypt configuration is correct
 ✓ checking ssl: letsencrypt cert works correctly
 ✓ checking ssl: manual configuration is correct
 ✓ checking ssl: manual configuration copied files correctly
 ✓ checking ssl: manual cert works correctly
 ✓ checking fail2ban: localhost is not banned because ignored
 ✓ checking fail2ban: fail2ban-jail.cf overrides
 ✓ checking fail2ban: ban ip on multiple failed login
 ✓ checking fail2ban: unban ip works
 ✓ checking fetchmail: gerneral options in fetchmailrc are loaded
 ✓ checking fetchmail: fetchmail.cf is loaded
 ✓ checking system: freshclam cron is enabled
 ✓ checking amavis: virusmail wiper cron exists
 ✓ checking amavis: VIRUSMAILS_DELETE_DELAY override works as expected
 ✓ checking amavis: old virusmail is wipped by cron
 ✓ checking amavis: recent virusmail is not wipped by cron
 ✓ checking system: /var/log/mail/mail.log is error free
 ✓ checking system: /var/log/auth.log is error free
 ✓ checking system: sets the server fqdn
 ✓ checking system: sets the server domain name in /etc/mailname
 ✓ checking system: postfix should not log to syslog
 ✓ checking sieve: user1 should have received 1 email in folder INBOX.spam
 ✓ checking manage sieve: server is ready when ENABLE_MANAGESIEVE has been set
 ✓ checking manage sieve: disabled per default
 ✓ checking sieve: user2 should have piped 1 email to /tmp/
 ✓ checking accounts: user3 should have been added to /tmp/docker-mailserver/postfix-accounts.cf
 ✓ checking accounts: auser3 should have been added to /tmp/docker-mailserver/postfix-accounts.cf
 ✓ checking accounts: a.ser3 should have been added to /tmp/docker-mailserver/postfix-accounts.cf
 ✓ checking accounts: user3 should have been removed from /tmp/docker-mailserver/postfix-accounts.cf but not auser3
 ✓ checking user updating password for user in /tmp/docker-mailserver/postfix-accounts.cf
 ✓ checking accounts: listmailuser
 ✓ checking accounts: no error is generated when deleting a user if /tmp/docker-mailserver/postfix-accounts.cf is missing
 ✓ checking accounts: user3 should have been added to /tmp/docker-mailserver/postfix-accounts.cf even when that file does not exist
 ✓ checking PERMIT_DOCKER: can get container ip
 ✓ checking PERMIT_DOCKER: opendmarc/opendkim config
 ✓ checking PERMIT_DOCKER: my network value
 ✓ checking amavis: config overrides
 ✓ checking setup.sh: Without arguments: status 1, show help text
 ✓ checking setup.sh: Wrong arguments
 ✓ checking setup.sh: setup.sh email add
 ✓ checking setup.sh: setup.sh email list
 ✓ checking setup.sh: setup.sh email update
 ✓ checking setup.sh: setup.sh email del
 ✓ checking setup.sh: setup.sh alias list
 ✓ checking setup.sh: setup.sh alias add
 ✓ checking setup.sh: setup.sh alias del
 ✓ checking setup.sh: setup.sh config dkim
 ✓ checking setup.sh: setup.sh debug fetchmail
 ✓ checking setup.sh: setup.sh debug inspect
 ✓ checking setup.sh: setup.sh debug login ls
 ✓ checking postfix: ldap lookup works correctly
 ✓ checking postfix: ldap custom config files copied
 ✓ checking postfix: ldap config overwrites success
 ✓ checking dovecot: ldap imap connection and authentication works
 ✓ checking dovecot: mail delivery works
 ✓ checking saslauthd: sasl ldap authentication works
 ✓ checking saslauthd: ldap smtp authentication
 ✓ checking dovecot: ldap rimap connection and authentication works
 ✓ checking saslauthd: sasl rimap authentication works
 ✓ checking saslauthd: rimap smtp authentication
 ✓ checking postfix-lmtp: virtual_transport config is set
 ✓ checking postfix-lmtp: delivers mail to existing account
 ✓ checking dovecot: only A grade TLS ciphers are used
 ✓ checking dovecot: nmap produces no warnings on TLS ciphers verifying
 ✓ checking postfix: only A grade TLS ciphers are used
 ✓ checking postfix: nmap produces no warnings on TLS ciphers verifying

138 tests, 0 failures

@@ -744,6 +744,10 @@ load 'test_helper/bats-assert/load'
assert_failure
run docker exec mail grep -i '(!)connect' /var/log/mail/mail.log
assert_failure
run docker exec mail grep -i 'backwards-compatible default setting chroot=y' /var/log/mail/mail.log
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checking that master.cf is fixed.

@@ -744,6 +744,10 @@ load 'test_helper/bats-assert/load'
assert_failure
run docker exec mail grep -i '(!)connect' /var/log/mail/mail.log
assert_failure
run docker exec mail grep -i 'backwards-compatible default setting chroot=y' /var/log/mail/mail.log
assert_failure
run docker exec mail grep -i 'connect to 127.0.0.1:10023: Connection refused' /var/log/mail/mail.log
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checking that postgrey is running

fi

if [[ ! $(grep '@' /tmp/docker-mailserver/postfix-accounts.cf | grep '|') ]]; then
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check that there's at least 1 user account, except when using LDAP.

@@ -1096,10 +1104,17 @@ function _misc_save_states() {
ln -s $dest $d
fi
done

notify 'inf' 'Fixing /var/mail-state/* permissions'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixing permissions in state dir.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant