Mijn publieke IP, welke ik heb verkregen een half jaartje geleden ofzo, staat ook op de Spamhous blacklist met onderstaande vermelding:
Outbound Email policy of KPN Internet / AS8737 / AS1136. for this IP range
It is the policy of KPN Internet that unauthenticated email sent from this IP address should be sent out only via the designated outbound mail server allocated to KPN Internet customers. To find the hostname of the correct mail server to use, customers should consult the original signup documentation or contact KPN Internet Technical Support.
Removal procedure
If you are not using normal email software but instead are running a mail server and you are the owner of a Static IP address in the range 86.92.0.0/16 and you have a legitimate reason for operating a mail server on this IP, you can automatically remove (suppress) your static IP address from the PBL database.
Ik heb nu onderstaande gedraaid (omdat
postfix al was geinstalleerd en anders geconfigureerd):
code:
1
| sudo dpkg-reconfigure postfix |
En onderstaande ingevuld:
code:
1
2
3
4
5
6
7
8
| Mail server type = Satellite system
System mail name = ph5b.home.dehakkelaar.nl
SMTP relay host = smtp.kpnmail.nl
Root and postmaster mail recipient = Mijn publieke meel adres
Other destination to accept mail for = niks ingevuld oftewel blank/geen.
Force synchronous updates on mail queue = no
Local networks = de default loopback IP's die al zijn ingevuld.
Mailbox size limit = 51200000 |
Als ik nu een meeltje verstuur naar een adres welke zich niet in het KPN domein bevind:
pi@ph5b:~ $ date; sendmail to@mail.address <<< 'Subject: Hello'
Thu 18 Aug 21:27:31 CEST 2022
Zie ik deze in de logs netjes verwerkt met
status=sent plus hij verschijnt thuis in m'n INBOX:
pi@ph5b:~ $ tail -F /var/log/mail.log
[..]
Aug 18 21:27:31 ph5b postfix/pickup[4455]: 89A143E6E7: uid=1000 from=<pi>
Aug 18 21:27:31 ph5b postfix/cleanup[4694]: 89A143E6E7: message-id=<20220818192731.89A143E6E7@ph5b.home.dehakkelaar.nl>
Aug 18 21:27:31 ph5b postfix/qmgr[4456]: 89A143E6E7: from=<pi@ph5b.home.dehakkelaar.nl>, size=271, nrcpt=1 (queue active)
Aug 18 21:27:32 ph5b postfix/smtp[4696]: 89A143E6E7: to=<to@mail.address>, relay=smtp.kpnmail.nl[195.121.65.26]:25, delay=0.69, delays=0.23/0.18/0.15/0.12, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as cd4022a5-1f2b-11ed-ad28-00505699772e)
Aug 18 21:27:32 ph5b postfix/qmgr[4456]: 89A143E6E7: removed
Als ik nu
monit installeer:
pi@ph5b:~ $ sudo apt install monit
[..]
After this operation, 931 kB of additional disk space will be used.
[..]
pi@ph5b:~ $
En configureer met onderstaande:
pi@ph5b:~ $ sudo nano /etc/monit/monitrc
[..]
set mailserver localhost
set alert to@mail.address not on { instance, action }
set httpd port 2812 and
use address localhost # only accept connection from localhost
allow localhost # allow localhost to connect to the server and
allow admin:monit # require user 'admin' with password 'monit'
En het monitoren van de Pi-hole logs ergens anders configureer omdat dat wat netter is (ik monitor voor
test.domain.lookup in de Pi-hole logs):
pi@ph5b:~ $ sudo nano /etc/monit/conf-available/pihole-logs
check file pihole.log with path /var/log/pihole/pihole.log
if match "A] test.domain.lookup" then alert
Symlink naar de
conf-enabled folder:
pi@ph5b:~ $ sudo ln -s /etc/monit/conf-available/pihole-logs /etc/monit/conf-enabled/
pi@ph5b:~ $
Wijzigingen aktiveer:
pi@ph5b:~ $ sudo monit reload
Reinitializing monit daemon
Dan heb ik onderstaande voor status:
pi@ph5b:~ $ sudo monit status
Monit 5.27.2 uptime: 27m
File 'pihole.log'
status OK
monitoring status Monitored
monitoring mode active
on reboot start
permission 640
uid 999
gid 995
size 699.2 kB
access timestamp Sat, 28 May 2022 01:18:33
change timestamp Thu, 18 Aug 2022 22:00:00
modify timestamp Thu, 18 Aug 2022 22:00:00
content match no
data collected Thu, 18 Aug 2022 22:00:30
System 'ph5b'
status OK
monitoring status Monitored
monitoring mode active
on reboot start
load average [0.27] [0.23] [0.19]
cpu 1.6%usr 2.2%sys 0.0%nice 0.3%iowait 0.0%hardirq 0.1%softirq 0.0%steal 0.0%guest 0.0%guestnice
memory usage 100.7 MB [23.4%]
swap usage 26.5 MB [26.5%]
uptime 26d 2h 35m
boot time Sat, 23 Jul 2022 19:25:42
filedescriptors 1251 [0.0% of 2147483647 limit]
data collected Thu, 18 Aug 2022 22:00:30
En als ik nu een alert trigger:
pi@ph5b:~ $ date; dig +noall @localhost test.domain.lookup
Thu 18 Aug 22:16:19 CEST 2022
Zie ik die netjes in de
monit logs:
pi@ph5b:~ $ tail -F /var/log/monit.log
[..]
[2022-08-18T22:17:54+0200] error : 'pihole.log' content match:
Aug 18 22:16:20 dnsmasq[27353]: query[A] test.domain.lookup from ::1
En ook in de meel logs met
status=sent:
pi@ph5b:~ $ tail -F /var/log/mail.log
[..]
Aug 18 22:17:54 ph5b postfix/smtpd[5686]: connect from localhost[::1]
Aug 18 22:17:54 ph5b postfix/smtpd[5686]: A68033E714: client=localhost[::1]
Aug 18 22:17:54 ph5b postfix/cleanup[5689]: A68033E714: message-id=<1660853874.556a303f1e35389d@ph5b>
Aug 18 22:17:54 ph5b postfix/qmgr[4456]: A68033E714: from=<monit@ph5b.home.dehakkelaar.nl>, size=734, nrcpt=1 (queue active)
Aug 18 22:17:54 ph5b postfix/smtpd[5686]: disconnect from localhost[::1] ehlo=1 mail=1 rcpt=1 data=1 quit=1 commands=5
Aug 18 22:17:55 ph5b postfix/smtp[5690]: A68033E714: to=<to@mail.address>, relay=smtp.kpnmail.nl[195.121.65.26]:25, delay=1, delays=0.14/0.19/0.17/0.53, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as dff1e92a-1f32-11ed-8bc8-005056998788)
Aug 18 22:17:55 ph5b postfix/qmgr[4456]: A68033E714: removed
En thuis krijg ik netjes een meeltje:
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
| Return-Path: <monit@ph5b.home.dehakkelaar.nl>
Delivered-To: to@mail.address
Received: from localhost (localhost [127.0.0.1])
by meel.server (Postfix) with ESMTP id 39688580066
for <to@mail.address>; Thu, 18 Aug 2022 22:18:35 +0200 (CEST)
X-Virus-Scanned: Debian amavisd-new at meel.server
Received: from meel.server ([127.0.0.1])
by localhost (meel.server [127.0.0.1]) (amavisd-new, port 10024)
with ESMTP id LYLrwB5+-pF2 for <to@mail.address>;
Thu, 18 Aug 2022 22:17:55 +0200 (CEST)
Received: from ewsoutbound.kpnmail.nl (ewsoutbound.kpnmail.nl [195.121.94.184])
by meel.server (Postfix) with ESMTPS id C1F72580065
for <to@mail.address>; Thu, 18 Aug 2022 22:17:55 +0200 (CEST)
X-KPN-MessageId: d5c89477-1f32-11ed-bd66-005056994fde
Received: from smtp.kpnmail.nl (unknown [10.31.155.7])
by ewsoutbound.so.kpn.org (Halon) with ESMTPS
id d5c89477-1f32-11ed-bd66-005056994fde;
Thu, 18 Aug 2022 22:17:51 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=kpnmail.nl; s=kpnmail01;
h=message-id:content-type:mime-version:date:subject:to:from;
bh=Xj58jcjXwxiIB8Ju66oiKB0sViK+2cjSNulvezu4cII=;
b=l/pdtjzSAZ/iTdrtFvSm2hLUAgKBdeV8LtxQXK6nYvHWL7dAvJQxlvLf+H5sMwDrsgmbcmvCtLVSg
gqI+vAcqeeMa+b0XwEZCKLYkhjb/xryosQV/8JahMgyTWqDaGBTz+sSZ4cwtGw/1TSkJFBe/wis/NJ
rXeQ2F6IO+fSm2tE=
X-Originating-IP: 86.92.XX.XX
Received: from ph5b.home.dehakkelaar.nl (XX-XX-XX-XX.fixed.kpn.net [XX.XX.XX.XX])
by smtp.kpnmail.nl (Halon) with ESMTPS
id dff1e92a-1f32-11ed-8bc8-005056998788;
Thu, 18 Aug 2022 22:18:08 +0200 (CEST)
Received: from ph5b (localhost [IPv6:::1])
by ph5b.home.dehakkelaar.nl (Postfix) with ESMTP id A68033E714
for <to@mail.address>; Thu, 18 Aug 2022 22:17:54 +0200 (CEST)
From: monit@ph5b.home.dehakkelaar.nl
To: to@mail.address
Subject: monit alert -- Content match pihole.log
Date: Thu, 18 Aug 2022 20:17:54 GMT
X-Mailer: Monit 5.27.2
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Message-Id: <1660853874.556a303f1e35389d@ph5b>
Content match Service pihole.log
Date: Thu, 18 Aug 2022 22:17:54
Action: alert
Host: ph5b
Description: content match:
Aug 18 22:16:20 dnsmasq[27353]: query[A] test.domain.lookup from ::1
Your faithful employee,
Monit |
Met bovenstaande omzeil ik dus enige poort 25 blokkades en ook de blacklisting bij Spamhous volgens mij ... toch?
There are only 10 types of people in the world: those who understand binary, and those who don't