head 1.3; access; symbols netbsd-11-0-RC4:1.3 netbsd-11-0-RC3:1.3 netbsd-11-0-RC2:1.3 netbsd-11-0-RC1:1.3 perseant-exfatfs-base-20250801:1.3 netbsd-11:1.3.0.10 netbsd-11-base:1.3 netbsd-10-1-RELEASE:1.3 perseant-exfatfs-base-20240630:1.3 perseant-exfatfs:1.3.0.8 perseant-exfatfs-base:1.3 netbsd-10-0-RELEASE:1.3 netbsd-10-0-RC6:1.3 netbsd-10-0-RC5:1.3 netbsd-10-0-RC4:1.3 netbsd-10-0-RC3:1.3 netbsd-10-0-RC2:1.3 netbsd-10-0-RC1:1.3 netbsd-10:1.3.0.6 netbsd-10-base:1.3 cjep_sun2x-base1:1.3 cjep_sun2x:1.3.0.4 cjep_sun2x-base:1.3 cjep_staticlib_x-base1:1.3 cjep_staticlib_x:1.3.0.2 cjep_staticlib_x-base:1.3 blocklist-20200614:1.1.1.1 CHRISTOS:1.1.1; locks; strict; comment @# @; 1.3 date 2020.09.25.12.52.59; author christos; state Exp; branches; next 1.2; commitid WW4IBYl2id6HEqpC; 1.2 date 2020.06.15.02.29.45; author christos; state Exp; branches; next 1.1; commitid Hmw5T0TEena9ugcC; 1.1 date 2020.06.15.01.52.53; author christos; state Exp; branches 1.1.1.1; next ; commitid 178yOO8MwJTTggcC; 1.1.1.1 date 2020.06.15.01.52.53; author christos; state Exp; branches; next ; commitid 178yOO8MwJTTggcC; desc @@ 1.3 log @Add one more place to notify blocklistd @ text @Index: dist/src/smtpd/pfilter.c =================================================================== RCS file: dist/src/smtpd/pfilter.c diff -N dist/src/smtpd/pfilter.c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ dist/src/smtpd/pfilter.c 1 Feb 2018 03:29:09 -0000 @@@@ -0,0 +1,19 @@@@ +#include "pfilter.h" +#include /* for NULL */ +#include + +static struct blocklist *blstate; + +void +pfilter_notify(int a, int fd) +{ + if (blstate == NULL) + blstate = blocklist_open(); + if (blstate == NULL) + return; + (void)blocklist_r(blstate, a, fd, "smtpd"); + if (a == 0) { + blocklist_close(blstate); + blstate = NULL; + } +} Index: dist/src/smtpd/pfilter.h =================================================================== RCS file: dist/src/smtpd/pfilter.h diff -N dist/src/smtpd/pfilter.h --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ dist/src/smtpd/pfilter.h 1 Feb 2018 03:29:09 -0000 @@@@ -0,0 +1,2 @@@@ + +void pfilter_notify(int, int); Index: dist/src/smtpd/smtpd.c =================================================================== RCS file: /cvsroot/src/external/ibm-public/postfix/dist/src/smtpd/smtpd.c,v retrieving revision 1.14 diff -u -r1.14 smtpd.c --- dist/src/smtpd/smtpd.c 14 Feb 2017 01:16:48 -0000 1.14 +++ dist/src/smtpd/smtpd.c 1 Feb 2018 03:29:09 -0000 @@@@ -1197,6 +1197,8 @@@@ #include #include +#include "pfilter.h" + /* * Tunable parameters. Make sure that there is some bound on the length of * an SMTP command, so that the mail system stays in control even when a @@@@ -5048,6 +5050,7 @@@@ if (state->error_count >= var_smtpd_hard_erlim) { state->reason = REASON_ERROR_LIMIT; state->error_mask |= MAIL_ERROR_PROTOCOL; + pfilter_notify(1, vstream_fileno(state->client)); smtpd_chat_reply(state, "421 4.7.0 %s Error: too many errors", var_myhostname); break; Index: libexec/smtpd/Makefile =================================================================== RCS file: /cvsroot/src/external/ibm-public/postfix/libexec/smtpd/Makefile,v retrieving revision 1.6 diff -u -r1.6 Makefile --- libexec/smtpd/Makefile 21 May 2017 15:28:40 -0000 1.6 +++ libexec/smtpd/Makefile 1 Feb 2018 03:29:09 -0000 @@@@ -13,11 +13,14 @@@@ SRCS= smtpd.c smtpd_token.c smtpd_check.c smtpd_chat.c smtpd_state.c \ smtpd_peer.c smtpd_sasl_proto.c smtpd_sasl_glue.c smtpd_proxy.c \ smtpd_xforward.c smtpd_dsn_fix.c smtpd_milter.c smtpd_resolve.c \ - smtpd_expand.c smtpd_haproxy.c + smtpd_expand.c smtpd_haproxy.c pfilter.c DPADD+= ${LIBPMASTER} ${LIBPMILTER} ${LIBPGLOBAL} ${LIBPDNS} ${LIBPXSASL} LDADD+= ${LIBPMASTER} ${LIBPMILTER} ${LIBPGLOBAL} ${LIBPDNS} ${LIBPXSASL} +DPADD+= ${LIBBLOCKLIST} +LDADD+= -lblocklist + DPADD+= ${LIBPTLS} ${LIBSSL} ${LIBCRYPTO} LDADD+= ${LIBPTLS} -lssl -lcrypto Index: dist/src/smtpd/smtpd.c =================================================================== RCS file: /cvsroot/src/external/ibm-public/postfix/dist/src/smtpd/smtpd.c,v retrieving revision 1.17 diff -u -u -r1.17 smtpd.c --- dist/src/smtpd/smtpd.c 18 Mar 2020 19:05:20 -0000 1.17 +++ dist/src/smtpd/smtpd.c 25 Sep 2020 12:51:52 -0000 @@@@ -5795,6 +5795,8 @@@@ || strcmp(state->reason, REASON_LOST_CONNECTION)) { msg_info("%s after %s from %s", state->reason, state->where, state->namaddr); + if (strcmp(state->where, SMTPD_CMD_AUTH) == 0) + pfilter_notify(1, vstream_fileno(state->client)); } } @ 1.2 log @missed the capitalized ones. @ text @d83 16 @ 1.1 log @Initial revision @ text @d77 1 a77 1 +DPADD+= ${LIBBLACKLIST} @ 1.1.1.1 log @Import blocklist from https://github.com/zoulasc/blocklist. This is the same code as blacklist from the HEAD of the NetBSD tree. @ text @@