head 1.2; access; symbols perseant-exfatfs-base-20250801:1.2 perseant-exfatfs-base-20240630:1.2 perseant-exfatfs:1.2.0.6 perseant-exfatfs-base:1.2 netbsd-9-4-RELEASE:1.1 netbsd-9-3-RELEASE:1.1 cjep_sun2x:1.2.0.4 cjep_sun2x-base:1.2 cjep_staticlib_x-base1:1.2 netbsd-9-2-RELEASE:1.1 cjep_staticlib_x:1.2.0.2 cjep_staticlib_x-base:1.2 netbsd-9-1-RELEASE:1.1 phil-wifi-20200421:1.1 phil-wifi-20200411:1.1 is-mlppp:1.1.0.8 is-mlppp-base:1.1 phil-wifi-20200406:1.1 netbsd-9-0-RELEASE:1.1 netbsd-9-0-RC2:1.1 netbsd-9-0-RC1:1.1 phil-wifi-20191119:1.1 netbsd-9:1.1.0.6 netbsd-9-base:1.1 phil-wifi-20190609:1.1 pgoyette-compat-merge-20190127:1.1 pgoyette-compat-20190127:1.1 pgoyette-compat-20190118:1.1 pgoyette-compat-1226:1.1 pgoyette-compat-1126:1.1 pgoyette-compat-1020:1.1 pgoyette-compat-0930:1.1 pgoyette-compat-0906:1.1 pgoyette-compat-0728:1.1 phil-wifi:1.1.0.4 phil-wifi-base:1.1 pgoyette-compat-0625:1.1 pgoyette-compat-0521:1.1 pgoyette-compat-0502:1.1 pgoyette-compat-0422:1.1 pgoyette-compat-0415:1.1 pgoyette-compat-0407:1.1 pgoyette-compat-0330:1.1 pgoyette-compat-0322:1.1 pgoyette-compat-0315:1.1 pgoyette-compat:1.1.0.2 pgoyette-compat-base:1.1; locks; strict; comment @# @; 1.2 date 2020.06.15.01.57.32; author christos; state dead; branches; next 1.1; commitid 1zJ7owqywyzYigcC; 1.1 date 2018.02.01.03.32.31; author christos; state Exp; branches; next ; commitid T7ydawefO6MzD6pA; desc @@ 1.2 log @Rename blacklist -> blocklist @ 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 blacklist *blstate; + +void +pfilter_notify(int a, int fd) +{ + if (blstate == NULL) + blstate = blacklist_open(); + if (blstate == NULL) + return; + (void)blacklist_r(blstate, a, fd, "smtpd"); + if (a == 0) { + blacklist_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+= ${LIBBLACKLIST} +LDADD+= -lblacklist + DPADD+= ${LIBPTLS} ${LIBSSL} ${LIBCRYPTO} LDADD+= ${LIBPTLS} -lssl -lcrypto @ 1.1 log @add a diff for smtpd @ text @@