Re: Regex in db table

2021-08-26 Thread Jack

Could you resend with proper line breaks. This is difficult to read.



Sorry, the line breaks got messed up.

I'm using OpenSTMPD 6.8 portable and want to filter on DNS names or HELO
strings with regular expressions. Therefore I created the following
minified config:


$ cat /etc/opensmtpd/smptd.conf
table helotable db:/etc/opensmtpd/helotable.db
filter block_helo phase helo match helo regex  disconnect
"554 Not welcome"
listen on 0.0.0.0 filter { block_helo }

$ makemaup -U /etc/opensmtpd/helotable.db
myte.t 


However the filter "block_helo" only matches when someone connects with
the verbatim string "HELO myte.t" (with a dot), which is of course not
how regex are supposed to work.
As soon as I replace the database entry with a regular text file (table
helotable file:/etc/opensmtpd/helotable.txt), the regex starts to work,
ie "HELO mytest" or "HELO mytett" are matched.
Question: How can I use regular expressions in db files? Text files
don't seem to be an option, because they are only read on startup so I
cannot update them on the fly.



Regex in db table

2021-08-25 Thread Jack

Hello list,

I already posted this on the bug tracker of OpenSMTPD, but maybe I'm
doing something wrong in the config and you can help me:

I'm using OpenSTMPD 6.8 portable and want to filter on DNS names or HELO
strings with regular expressions. Therefore I created the following
minified config:




||$ cat /etc/opensmtpd/smptd.conf |table helotable
db:/etc/opensmtpd/helotable.db filter block_helo phase helo match helo
regex  disconnect "554 Not welcome" listen on 0.0.0.0 filter
{ block_helo } $ cat /etc/opensmtpd/helotable.txt myte.t
| However the filter block_helo only
matches when someone connects with the verbatim string "HELO myte.t"
(with a dot). As soon as I replace the database entry with a regular
text file, the regex starts to work, ie "HELO mytest" or "HELO mytett"
are matched. How can I use regular expressions in db files? Text files
don't seem to be an option, because they are only read on startup so I
cannot update them on the fly. Thanks in advance. ||