· 10 years ago · Sep 17, 2015, 07:38 PM
1Referring:
2http://www.postfix.org/postconf.5.html#smtpd_recipient_restrictions
3
4
5[root@n0 postfix]# postconf | grep "mail_version ="
6mail_version = 3.0.2
7
8
9[root@n0 postfix]# tail access
10#85.115 REJECT
11#173.194 555 TT
12#gmail.com REJECT
13#74.125. 555 TT
14#162.144.48.233 555 TT
15216.231.139.87 555 TT
16steelchild.com REJECT
17
18
19[root@n0 postfix]# postconf -d | grep "smtpd_recipient_restrictions ="
20smtpd_recipient_restrictions =
21
22[root@n0 postfix]# cat main.cf
23.
24.
25smtpd_recipient_restrictions =
26 permit_mynetworks,
27 check_recipient_a_access
28 hash:/etc/postfix/access
29 reject_unauth_destination,
30 permit
31#smtpd_recipient_restrictions = check_recipient_a_access hash:/etc/postfix/access
32#check_recipient_access hash:/etc/postfix/access, check_recipient_a_access hash:/etc/postfix/access, check_recipient_mx_access hash:/etc/postfix/access, reject_unauth_destination
33
34
35TESTING USING MAIL COMMAND:
36[root@n0 postfix]# echo "smtpd_recipient_restrictions TEST" | mail -s "smtpd_recipient_restrictions TEST 1" contact@steelchild.com
37
38
39Sep 17 23:12:37 n0 postfix/smtp[22345]: 2DD66A468036: to=<contact@steelchild.com>, relay=steelchild.com[216.231.139.87]:25, delay=0.65, delays=0.02/0/0.37/0.25, dsn=2.0.0, status=sent (250 2.0.0 t8HLALSi017130 Message accepted for delivery)
40
41
42TESTING USING SMTP:
43LOGS:
44Sep 17 23:33:30 n0 postfix/smtpd[24216]: connect from unknown[45.55.73.197]
45Sep 17 23:33:30 n0 postfix/smtpd[24216]: 643C7A46801D: client=unknown[45.55.73.197]
46Sep 17 23:33:30 n0 postfix/cleanup[24219]: 643C7A46801D: message-id=70e240706d134a238fda37a28ab4721b
47Sep 17 23:33:30 n0 postfix/qmgr[24220]: 643C7A46801D: from=<bounce@n0.vbesttour.com>, size=501, nrcpt=1 (queue active)
48Sep 17 23:33:30 n0 postfix/smtpd[24216]: disconnect from unknown[45.55.73.197] ehlo=1 mail=1 rcpt=1 data=1 quit=1 commands=5
49Sep 17 23:33:31 n0 postfix/smtp[24221]: 643C7A46801D: to=<contact@steelchild.com>, relay=steelchild.com[216.231.139.87]:25, delay=0.93, delays=0.25/0/0.4/0.28, dsn=2.0.0, status=sent (250 2.0.0 t8HLVEmG017438 Message accepted for delivery)
50Sep 17 23:33:31 n0 postfix/qmgr[24220]: 643C7A46801D: removed
51
52
53
54>> PROBLEM:
55Ideally with "check_recipient_a_access" in action, this mail should NOT be SENT from the system at all.
56Still the mail was SENT.
57Mail was SENT using mail command and from SMTP method too.
58Kindly help to resolve this situation, so that we can BLOCK mails to IP addresses resolving to "steelchild.com" and others like them.
59
60Thanks.