--- # Configure MTA Front server for email relay and SMTP smuggling - name: Update system packages apt: update_cache: yes upgrade: dist - name: Install MTA packages apt: name: - postfix - postfix-pcre - dovecot-core - dovecot-imapd - opendkim - opendkim-tools - python3-pip - python3-venv - nginx - certbot - python3-certbot-nginx - dnsutils - swaks - telnet state: present - name: Configure Postfix for MTA fronting template: src: "../templates/phishing/postfix-mta-front.j2" dest: /etc/postfix/main.cf backup: yes notify: restart postfix - name: Configure Postfix master.cf for advanced relaying blockinfile: path: /etc/postfix/master.cf block: | # SMTP smuggling and advanced relay configurations 587 inet n - y - - smtpd -o syslog_name=postfix/submission -o smtpd_tls_security_level=encrypt -o smtpd_sasl_auth_enable=yes -o smtpd_tls_wrappermode=no -o smtpd_client_restrictions=permit_sasl_authenticated,reject -o smtpd_relay_restrictions=permit_sasl_authenticated,reject -o milter_macro_daemon_name=ORIGINATING # SMTP smuggling support cleanup unix n - y - 0 cleanup -o header_checks=pcre:/etc/postfix/header_checks -o nested_header_checks=pcre:/etc/postfix/nested_header_checks - name: Create SMTP smuggling header checks copy: dest: /etc/postfix/header_checks content: | # SMTP smuggling techniques /^Content-Transfer-Encoding:\s*7bit/i REPLACE Content-Transfer-Encoding: 8bit /^Content-Type:\s*text\/plain/i REPLACE Content-Type: text/html mode: '0644' notify: - reload postfix - postmap header_checks - name: Create nested header checks for advanced smuggling copy: dest: /etc/postfix/nested_header_checks content: | # Advanced SMTP smuggling patterns /^\s*