# Exim filter # based on Exim filter ## Version: 0.10 ifdef(`confM4_DIR', `', `define(`confM4_DIR', `../m4')')dnl ifdef(`confSYSTEMFILTERS_DIR', `', `define(`confSYSTEMFILTERS_DIR', `.')')dnl include(confFEATURES_DIR`/cfhead.m4')dnl include(confM4_DIR`/conf.default')dnl include(confSITE_DIR/`conf')dnl define(`SECTION', `SYSTEM_FILTER')dnl # # touch /var/log/exim/filterlog # chown mailnull /var/log/exim/filterlog # chgrp mail /var/log/exim/filterlog # chmod 640 /var/log/exim/filterlog # logfile confLOGDIR/filterlog #logwrite "$tod_log $message_exim_id - processed" # # Only run any of this stuff on the first pass through the # filter - this is an optimisation for messages that get # queued and have several delivery attempts # # we express this in reverse so we can just bail out # on inappropriate messages # sinclude(confSITE_DIR`/system_filter_top')dnl ifdef(`confANTIVIRUS_SAVE_BACKUP', `ifelse(confANTIVIRUS_SAVE_BACKUP, `YES', `dnl ifelse_strstr(confMAIL_BACKUP, `SYSTEM_FILTER', `dnl if first_delivery then include(confSITE_DIR`/system_filter_backup')dnl endif ') dnl ifelse_strstr(confMAIL_BACKUP, `SYSTEM_FILTER', `') ')') ifdef(`confANTIVIRUS0_ACT', `dnl include(confSYSTEMFILTERS_DIR`/system_filter_quarantine_infected.m4')dnl ') ifdef(`confANTIVIRUS_SAVE_BACKUP', `ifelse(confANTIVIRUS_SAVE_BACKUP, `NO', `dnl ifelse_strstr(confMAIL_BACKUP, `SYSTEM_FILTER', `dnl if first_delivery then include(confSITE_DIR`/system_filter_backup')dnl endif ') dnl ifelse_strstr(confMAIL_BACKUP, `SYSTEM_FILTER', `') ')') if not first_delivery then finish endif undefine(`_SPAMASSASSIN_') ifelse_strstr(confCONTENT_SCANNING, `SPAMASSASSIN', `define(`_SPAMASSASSIN_')') ifelse_strstr(` 'confCONTENT_SCANNING, ` SPAMD', `define(`_SPAMASSASSIN_')') ifdef(`_SPAMASSASSIN_', ` ifelse_strstr(confSPAMASSASSIN_ACTION, `QUARANTINE', `include(confSITE_DIR`/system_filter_quarantine_content_scaned')') ', ` ifelse_strstr(confCONTENT_SCANNING, `DSPAM', ` ifelse_strstr(confDSPAM_ACTION, `QUARANTINE', `include(confSITE_DIR`/system_filter_quarantine_content_scaned')') ', ` ifelse_strstr(confCONTENT_SCANNING, `KAS3', ` ifelse_strstr(confKAS3_ACTION, `QUARANTINE', `include(confSITE_DIR`/system_filter_quarantine_content_scaned')') ',` ifelse_strstr(confCONTENT_SCANNING, `SO2', ` ifelse_strstr(confSO2_ACTION, `QUARANTINE', `include(confSITE_DIR`/system_filter_quarantine_content_scaned')') ',` ifelse_strstr(confCONTENT_SCANNING, `DCC', ` ifelse_strstr(confDCC_ACTION, `QUARANTINE', `include(confSITE_DIR`/system_filter_quarantine_content_scaned')') ',` ifelse_strstr(confCONTENT_SCANNING, `RSPAMD', ` ifelse_strstr(confRSPAMD_ACTION, `QUARANTINE', `include(confSITE_DIR`/system_filter_quarantine_content_scaned')') ') dnl ifelse_strstr(confCONTENT_SCANNING, `RSPAMD', `') ') dnl ifelse_strstr(confCONTENT_SCANNING, `DCC', `') ') dnl ifelse_strstr(confCONTENT_SCANNING, `SO2', `') ') dnl ifelse_strstr(confCONTENT_SCANNING, `KAS3', `') ') dnl ifelse_strstr(confCONTENT_SCANNING, `DSPAM', `') ') dnl ifdef(`_SPAMASSASSIN_', `') if $acl_m_quarantined contains "envelope" or $acl_m_quarantined contains "data" then headers add "X-Quarantined: YES" endif ifdef(`confSYSTEM_FILTER_QUARANTINE_DIR', `ifelse(len(X`'confSYSTEM_FILTER_QUARANTINE_DIR), `1', `', `dnl ifelse(confSYSTEM_FILTER_QUARANTINE_AGE,`0',`',` include(confSITE_DIR`/system_filter_quarantine_quarantined') ')dnl ifelse(confSYSTEM_FILTER_QUARANTINE_AGE,`0',`',`') ')')dnl ifdef(`confSYSTEM_FILTER_QUARANTINE_DIR', `ifelse(len(X`'confSYSTEM_FILTER_QUARANTINE_DIR), `1', `', `')') if error_message then finish endif ifdef(`confSYSTEM_FILTER_WARNINGS_DIR', `ifelse(len(X`'confSYSTEM_FILTER_WARNINGS_DIR), `1', `', `dnl ifelse(confSYSTEM_FILTER_WARNINGS_AGE,`0',`',` include(confSITE_DIR`/system_filter_quarantine_warned') ')dnl ifelse(confSYSTEM_FILTER_WARNINGS_AGE,`0',`',`') ')')dnl ifdef(`confSYSTEM_FILTER_WARNINGS_DIR', `ifelse(len(X`'confSYSTEM_FILTER_WARNINGS_DIR), `1', `', `')') sinclude(confSITE_DIR`/system_filter_bottom')dnl finish