root@beta:~ # uname -v FreeBSD 10.3-RELEASE-p3 #0: Tue May 17 08:43:55 UTC 2016 root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC root@beta:~ # pkg info | grep exim exim-4.87 High performance MTA for Unix systems on the Internet
root@beta:~ # exim --version Exim version 4.87 #0 (FreeBSD 10.3) built 21-Apr-2016 19:02:37 Copyright (c) University of Cambridge, 1995 - 2016 (c) The Exim Maintainers and contributors in ACKNOWLEDGMENTS file, 2007 - 2016 Probably Berkeley DB version 1.8x (native mode) Support for: crypteq iconv() use_setclassresources PAM Perl Expand_dlfunc TCPwrappers OpenSSL Content_Scanning Old_Demime DKIM DNSSEC I18N PRDR Experimental_SPF Experimental_DCC Experimental_DMARC Lookups (built-in): lsearch wildlsearch nwildlsearch iplsearch cdb dbm dbmjz dbmnz dnsdb dsearch mysql nis nis0 passwd Authenticators: cram_md5 dovecot plaintext spa Routers: accept dnslookup ipliteral manualroute queryprogram redirect Transports: appendfile/maildir/mailstore/mbx autoreply lmtp pipe smtp Fixed never_users: 0 Size of off_t: 8 Configuration file is /usr/local/etc/exim/configure
root@beta:~ # pkg info | grep dmarc opendmarc-1.3.1_3 DMARC library and milter implementation
root@beta:~ # cd /usr/local/etc/mail/ root@beta:/usr/local/etc/mail # cp opendmarc.conf.sample opendmarc.conf root@beta:/usr/local/etc/mail # cat opendmarc.conf | egrep -v '^#|^$' AuthservID my.server ForensicReports true ForensicReportsSentBy noreply@my.server HistoryFile /usr/local/etc/exim/dmarc.dat
root@beta:/usr/local/etc/mail # cd ../exim root@beta:/usr/local/etc/exim # touch dmarc.dat root@beta:/usr/local/etc/exim # chmod 666 dmarc.dat root@beta:/usr/local/etc/exim # ll dmarc.dat -rw-rw-rw- 1 root wheel 0 24 22:47 dmarc.dat
root@beta:/usr/local/etc/exim # cat configure | grep dmarc dmarc_tld_file = /usr/local/etc/exim/public_suffix_list.dat dmarc_history_file = /usr/local/etc/exim/dmarc.dat dmarc_forensic_sender = noreply@my.server
root@beta:/usr/local/etc/exim # fetch https://publicsuffix.org/list/public_suffix_list.dat public_suffix_list.dat 100% of 179 kB 227 kBps 00m01s root@beta:/usr/local/etc/exim # ll public_suffix_list.dat -rw-r--r-- 1 root wheel 183718 24 18:52 public_suffix_list.dat
root@beta:/usr/local/etc/exim # cat /etc/crontab | grep publicsuffix 0 3 * * 1 root fetch -q https://publicsuffix.org/list/public_suffix_list.dat -o /usr/local/etc/exim && service exim reload
control = dmarc_disable_verify
warn control = dmarc_enable_forensic
accept authenticated = *
accept hosts = +relay_from_hosts
# --- check sender's DMARC policy
warn dmarc_status = *
add_header = $dmarc_ar_header
deny dmarc_status = reject
message = Rejected by sender's DMARC policy
warn dmarc_status = quarantine
set acl_c0 = ${eval:$acl_c0+40}
set acl_c1 = QDMARC(40) suspicious message according DMARC policy; $acl_c1
root@beta:/usr/local/etc/exim # service exim restart Stopping exim. Waiting for PIDS: 78683. Starting exim.
Return-path: <>
Envelope-to: d@ruf.agari.com
Delivery-date: Wed, 18 May 2016 19:25:30 +0200
Received: from mailnull by my.server with local (Exim 4.87 (FreeBSD))
id 1b35Du-0000Te-QK
for d@ruf.agari.com; Wed, 18 May 2016 19:25:30 +0200
Auto-Submitted: auto-replied
From: noreply@my.server
To: d@ruf.agari.com
Subject: DMARC Forensic Report for mail.ru from IP 190.223.42.106
Message-Id: <E1b35Du-0000Te-QK@my.server>
Date: Wed, 18 May 2016 19:25:30 +0200
Failed message published DMARC
policy for your domain.
Sender Domain: mail.ru
Sender IP Address: 190.223.42.106
Received Date: Wed, 18 May 2016 19:25:30 +0200
SPF Alignment: no
DKIM Alignment: no
DMARC Results: Reject
- This is a copy of the headers that were received before the error.
was detected.
Received: from [190.223.42.106]
by my.server with esmtp (Exim 4.87 (FreeBSD))
(envelope-from <outletqn@mail.ru>)
id 1b35Du-0000TE-Eb
for sales@my.server; Wed, 18 May 2016 19:25:30 +0200
Received: from [163.116.8.100] (account frontenace19@inbox.ru HELO exbtaaovmshlgq.peejojgxxotd.tv)
by (CommuniGate Pro SMTP 5.2.3)
with ESMTPA id 745786287 for sales@my.server; Wed, 18 May 2016 12:17:49 -0500
Date: Wed, 18 May 2016 12:17:49 -0500
From: =? Koi8-r? B? 48XO1NIg4dfUz83B1MnawcPJyQ ==? = <Outletqn@mail.ru>
X-Mailer: The Bat! (v2.12.00) Educational
X-Priority: 3 (Normal)
Message-ID: <2803497135.OXX007B0034066@xnfwvhhklng.fffnarj.va>
To: <sales@peek.ru>
Subject: =? Koi8-r? B? 8M8g0M / Xz8TVIMvPztTSz8zRIMvB3sXT1NfBINDSz8TVy8PJyQ ==? =
MIME-Version: 1.0
Content-Type: text / plain;
charset = koi8-r
Content-Transfer-Encoding: 8bit
Received-SPF: softfail (my.server: not allowed) 190.223.42.106 as permitted sender client-ip = 190.223.42.106; envelope-from=outletqn@mail.ru; helo = [190.223.42.106];
root@beta:/usr/local/etc/exim # cd /usr/local/share/doc/opendmarc/ root@beta:/usr/local/share/doc/opendmarc # mysql -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 29062 Server version: 5.6.30 Source distribution Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> CREATE DATABASE opendmarc; mysql> GRANT ALL PRIVILEGES ON opendmarc.* TO opendmarc IDENTIFIED BY 'opendmarc'; mysql> quit; root@beta:/usr/local/share/doc/opendmarc # root@beta:/usr/local/share/doc/opendmarc # mysql -h localhost -u opendmarc -p opendmarc < schema.mysql
root@beta:/usr/local/share/doc/opendmarc # cd /usr/local/etc/exim root@beta:/usr/local/etc/exim # touch dmarc-cron.sh root@beta:/usr/local/etc/exim # chmod 755 dmarc-cron.sh root@beta:/usr/local/etc/exim # ll dmarc-cron.sh -rwxr-xr-x 1 root wheel 735 24 22:48 dmarc-cron.sh* root@beta:/usr/local/etc/exim # cat dmarc-cron.sh #!/bin/sh # Update DMARC database and send reports # (c)2014 by Max Kostikov http://kostikov.co e-mail: max@kostikov.co # # cat /etc/crontab | grep dmarc # 0 */6 * * * root /usr/local/etc/exim/dmarc-cron.sh >/dev/null 2>&1 LOG="/usr/local/etc/exim/dmarc.dat" HOST="localhost" PORT="3306" USER="opendmarc" PASS="opendmarc" DB="opendmarc" opendmarc-import --dbhost=$HOST --dbport=$PORT --dbname=$DB --dbuser=$USER --dbpasswd=$PASS --verbose < $LOG cat /dev/null > $LOG opendmarc-reports --dbhost=$HOST --dbport=$PORT --dbname=$DB --dbuser=$USER --dbpasswd=$PASS --interval=86400 --verbose --report-email 'noreply@my.server' opendmarc-expire --dbhost=$HOST --dbport=$PORT --dbname=$DB --dbuser=$USER --dbpasswd=$PASS --verbose --expire=30
root@beta:/usr/local/etc/exim # cat /etc/crontab | grep dmarc 0 */6 * * * root /usr/local/etc/exim/dmarc-cron.sh >/dev/null 2>&1
Source: https://habr.com/ru/post/302162/
All Articles