diff --git a/data/Dockerfiles/postfix/Dockerfile b/data/Dockerfiles/postfix/Dockerfile index 8b913af4..56b274aa 100644 --- a/data/Dockerfiles/postfix/Dockerfile +++ b/data/Dockerfiles/postfix/Dockerfile @@ -45,7 +45,6 @@ COPY postfix.sh /opt/postfix.sh COPY rspamd-pipe-ham /usr/local/bin/rspamd-pipe-ham COPY rspamd-pipe-spam /usr/local/bin/rspamd-pipe-spam COPY whitelist_forwardinghosts.sh /usr/local/bin/whitelist_forwardinghosts.sh -COPY smtpd_last_login.sh /usr/local/bin/smtpd_last_login.sh COPY stop-supervisor.sh /usr/local/sbin/stop-supervisor.sh COPY docker-entrypoint.sh /docker-entrypoint.sh @@ -53,7 +52,6 @@ RUN chmod +x /opt/postfix.sh \ /usr/local/bin/rspamd-pipe-ham \ /usr/local/bin/rspamd-pipe-spam \ /usr/local/bin/whitelist_forwardinghosts.sh \ - /usr/local/bin/smtpd_last_login.sh \ /usr/local/sbin/stop-supervisor.sh RUN rm -rf /tmp/* /var/tmp/* diff --git a/data/Dockerfiles/postfix/postfix.sh b/data/Dockerfiles/postfix/postfix.sh index dec007fa..422a4cfb 100755 --- a/data/Dockerfiles/postfix/postfix.sh +++ b/data/Dockerfiles/postfix/postfix.sh @@ -395,9 +395,6 @@ if [[ ! -f /opt/postfix/conf/custom_postscreen_whitelist.cidr ]]; then EOF fi -# Fix SMTP last login on slaves -sed -i "s/__REDIS_SLAVEOF_IP__/${REDIS_SLAVEOF_IP}/g" /usr/local/bin/smtpd_last_login.sh - # Fix Postfix permissions chown -R root:postfix /opt/postfix/conf/sql/ /opt/postfix/conf/custom_transport.pcre chmod 640 /opt/postfix/conf/sql/*.cf /opt/postfix/conf/custom_transport.pcre diff --git a/data/Dockerfiles/postfix/smtpd_last_login.sh b/data/Dockerfiles/postfix/smtpd_last_login.sh deleted file mode 100755 index 9d249af9..00000000 --- a/data/Dockerfiles/postfix/smtpd_last_login.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash - -REDIS_SLAVEOF_IP=__REDIS_SLAVEOF_IP__ - -# Do not attempt to write to slave -if [[ ! -z ${REDIS_SLAVEOF_IP} ]]; then - REDIS_CMDLINE="redis-cli -h ${REDIS_SLAVEOF_IP} -p ${REDIS_SLAVEOF_PORT}" -else - REDIS_CMDLINE="redis-cli -h redis -p 6379" -fi - -while read QUERY; do - QUERY=($QUERY) - # If nothing matched, end here - Postfix last line will be empty - if [[ -z "$(echo ${QUERY[0]} | tr -d '\040\011\012\015')" ]]; then - echo -ne "action=dunno\n\n" - # We found a username, log and return - elif [[ "${QUERY[0]}" =~ sasl_username ]]; then - MUSER=$(printf "%q" ${QUERY[0]#sasl_username=}) - ${REDIS_CMDLINE} SET "last-login/smtp/$MUSER" "$(date +%s)" - echo -ne "action=dunno\n\n" - fi -done diff --git a/data/conf/postfix/main.cf b/data/conf/postfix/main.cf index c4704d56..bc9fd8a2 100644 --- a/data/conf/postfix/main.cf +++ b/data/conf/postfix/main.cf @@ -193,7 +193,6 @@ smtp_sasl_auth_soft_bounce = no postscreen_discard_ehlo_keywords = silent-discard, dsn compatibility_level = 2 smtputf8_enable = no -smtpd_last_auth = check_policy_service inet:127.0.0.1:10028 # Define protocols for SMTPS and submission service submission_smtpd_tls_mandatory_protocols = !SSLv2, !SSLv3, !TLSv1, !TLSv1.1 smtps_smtpd_tls_mandatory_protocols = !SSLv2, !SSLv3, !TLSv1, !TLSv1.1 diff --git a/data/conf/postfix/master.cf b/data/conf/postfix/master.cf index 3b814bc0..a8bb0abf 100644 --- a/data/conf/postfix/master.cf +++ b/data/conf/postfix/master.cf @@ -125,7 +125,6 @@ smtp_sender_cleanup unix n - y - 0 cleanup # start whitelist_fwd 127.0.0.1:10027 inet n n n - 0 spawn user=nobody argv=/usr/local/bin/whitelist_forwardinghosts.sh -127.0.0.1:10028 inet n n n - 0 spawn user=nobody argv=/usr/local/bin/smtpd_last_login.sh # end whitelist_fwd # start watchdog-specific