summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRolf Eike Beer <eike@sf-mail.de>2022-05-16 16:47:32 +0200
committerUlrich Müller <ulm@gentoo.org>2022-05-21 19:00:01 +0200
commit47fb5c77609357b8e521491e194cea495b229b4c (patch)
tree8889ec3388485d893c74ba29b69221e50213298a /eclass/qmail.eclass
parentqmail.eclass: drop obsolete install hooks (diff)
downloadgentoo-47fb5c77609357b8e521491e194cea495b229b4c.tar.gz
gentoo-47fb5c77609357b8e521491e194cea495b229b4c.tar.bz2
gentoo-47fb5c77609357b8e521491e194cea495b229b4c.zip
qmail.eclass: remove usage of egrep
This does not use extended regular expressions in any way. While at it change the way these matches are done: it's irrelevant if the entire expression is in the file, if there is any rule for the given IP address then do not add the new expression. Signed-off-by: Rolf Eike Beer <eike@sf-mail.de> Signed-off-by: Ulrich Müller <ulm@gentoo.org>
Diffstat (limited to 'eclass/qmail.eclass')
-rw-r--r--eclass/qmail.eclass5
1 files changed, 2 insertions, 3 deletions
diff --git a/eclass/qmail.eclass b/eclass/qmail.eclass
index 9b2c5a8c7fbe..ed53bca56fae 100644
--- a/eclass/qmail.eclass
+++ b/eclass/qmail.eclass
@@ -409,7 +409,7 @@ qmail_config_fast() {
}
qmail_tcprules_config() {
- local localips ip tcpstring line proto f
+ local localips ip tcpstring proto f
einfo "Accepting relaying by default from all ips configured on this machine."
@@ -425,10 +425,9 @@ qmail_tcprules_config() {
tcpstring=':allow,RELAYCLIENT="",RBLSMTPD=""'
for ip in ${localips}; do
- line="${ip}${tcpstring}"
for proto in smtp qmtp qmqp; do
f="${EROOT}${TCPRULES_DIR}/tcp.qmail-${proto}"
- egrep -qs "${line}" "${f}" || echo "${line}" >> "${f}"
+ grep -qs "^${ip}:" "${f}" || echo "${ip}${tcpstring}" >> "${f}"
done
done
}