acl_smtp_data = acl_check_data ... acl_check_data: ... # # REPORT command # warn set acl_m0 = ${dlfunc{/usr/local/libexec/exim/exim-dlfunc.so}{spamd}\ {127.0.0.1 783}{defer_ok}{spamd}{report}} warn condition = ${if eq{$acl_m0}{}{yes}{no}} logwrite = SPAMD check failed warn condition = ${if match{$acl_m0}{\N^spamd dlfunc:\s*\N}{yes}{no}} logwrite = SPAMD check defer: ${sg{$acl_m0}{\N^spamd dlfunc:\s*\N}{}} set acl_m0 = warn condition = ${if eq{$acl_m0}{}{no}{yes}} set acl_m1 = ${if match{$acl_m0}\ {\N^SPAMD answer: SPAMD/(\S+) 0 EX_OK\N}{$1}{}} logwrite = SPAMD check: SPAMD version: ${if eq{$acl_m1}{}{not found}{$acl_m1}} warn condition = ${if eq{$acl_m0}{}{no}{yes}} set acl_m1 = ${if match{$acl_m0}\ {\N^SPAMD answer: SPAMD/.+\r\nSpam: (\S+) ; (-?\d+\.\d+ / \d+\.\d+)\N}{$1}{}} logwrite = SPAMD check: SPAMD status: ${if eq{$acl_m1}{}{not found}{\ ${if match{$acl_m1}{\N^(?i)true$\N}{Yes}{No}}\ }} warn condition = ${if eq{$acl_m0}{}{no}{yes}} set acl_m1 = ${if match{$acl_m0}\ {\N^SPAMD answer: SPAMD/.+\r\nSpam: \S+ ; (-?\d+\.\d+ / \d+\.\d+)\N}{$1}{}} logwrite = SPAMD check: SPAMD scores: ${if eq{$acl_m1}{}{not found}{$acl_m1}} warn condition = ${if eq{$acl_m0}{}{no}{yes}} set acl_m1 = ${if match{$acl_m0}\ {\N(?s)^SPAMD answer: SPAMD/.+?\r\nSpam:.+?\r\n\r\n(.+)$\N}{$1}{}} logwrite = SPAMD check: SPAMD report: ${if eq{$acl_m1}{}{not found}{$acl_m1}} # # PROCESS command # warn set acl_m0 = ${dlfunc{/usr/local/libexec/exim/exim-dlfunc.so}{spamd}\ {127.0.0.1 783}{defer_ok}{spamd}{process}} warn condition = ${if eq{$acl_m0}{}{yes}{no}} logwrite = SPAMD check failed warn condition = ${if match{$acl_m0}{\N^spamd dlfunc:\s*\N}{yes}{no}} logwrite = SPAMD check defer: ${sg{$acl_m0}{\N^spamd dlfunc:\s*\N}{}} set acl_m0 = warn condition = ${if eq{$acl_m0}{}{no}{yes}} set acl_m1 = ${if match{$acl_m0}\ {\N^SPAMD answer: SPAMD/(\S+) 0 EX_OK\N}{$1}{}} logwrite = SPAMD check: SPAMD version: ${if eq{$acl_m1}{}{not found}{$acl_m1}} warn condition = ${if eq{$acl_m0}{}{no}{yes}} set acl_m1 = ${if match{$acl_m0}\ {\N(?s)^SPAMD answer: SPAMD/.+?\r\nContent-length:.+?\r\n\r\n(.+)$\N}{$1}{}} set acl_m1 = ${sg{$acl_m1}{\N^From .+@.+ \w+ \w+ \d+ \d\d:\d\d:\d\d \d\d\d\d.*?\n\N}{}} logwrite = SPAMD check: all headers: ${if eq{$acl_m1}{}{not found}{$acl_m1}} warn condition = ${if eq{$acl_m0}{}{no}{yes}} set acl_m1 = ${sg{$acl_m1}\ {\N(?m)^(?!((?=X-Spam-)|(?=\s))).+\r?\n(\s.*\r?\n)*\N}{}} logwrite = SPAMD check: X-Spam headers: ${if eq{$acl_m1}{}{not found}{$acl_m1}} warn condition = ${if eq{$acl_m0}{}{no}{yes}} set acl_m1 = ${sg{$acl_m1}\ {\N(?m)^(?!((?=X-Spam-)|(?=\s))).+\r?\n(\s.*\r?\n)*\N}{}} logwrite = SPAMD check: X-Spam headers: ${if eq{$acl_m1}{}{not found}{$acl_m1}} warn condition = ${if eq{$acl_m1}{}{no}{yes}} set acl_m0 = ${if match{$acl_m1}\ {\N(?s)(?:^|\n)X-Spam-Status: (\S+), score=(-?\d+\.\d+) required=(-?\d+\.\d+)\N}{$1}{}} logwrite = SPAMD check: SPAMD status: ${if eq{$acl_m0}{}{not found}{$acl_m0}} warn condition = ${if eq{$acl_m1}{}{no}{yes}} set acl_m0 = ${if match{$acl_m1}\ {\N(?s)(?:^|\n)X-Spam-Status: (\S+), score=(-?\d+\.\d+) required=(-?\d+\.\d+)\N}{$2 / $3}{}} logwrite = SPAMD check: SPAMD scores: ${if eq{$acl_m0}{}{not found}{$acl_m0}} warn condition = ${if eq{$acl_m1}{}{no}{yes}} set acl_m0 = ${if match{$acl_m1}\ {\N(?s)(?:^|\n)X-Spam-Report: (.+\r?\n(\s.*\r?\n)*)\N}{$1}{}} logwrite = SPAMD check: SPAMD report: ${if eq{$acl_m0}{}{not found}{$acl_m0}}