diff --git a/contrib/backends/srndv2/src/srnd/frontend_http.go b/contrib/backends/srndv2/src/srnd/frontend_http.go index dcd3ca9..852a89a 100644 --- a/contrib/backends/srndv2/src/srnd/frontend_http.go +++ b/contrib/backends/srndv2/src/srnd/frontend_http.go @@ -680,6 +680,13 @@ func (self *httpFrontend) handle_postRequest(pr *postRequest, b bannedFunc, e er e(err) return } + + if !hasAtLeastNWords(m, 3) { + err = errors.New("your message is too short") + e(err) + return + } + nntp := new(nntpArticle) defer nntp.Reset() var banned bool diff --git a/contrib/backends/srndv2/src/srnd/util.go b/contrib/backends/srndv2/src/srnd/util.go index dc7f286..e7cf61a 100644 --- a/contrib/backends/srndv2/src/srnd/util.go +++ b/contrib/backends/srndv2/src/srnd/util.go @@ -800,3 +800,9 @@ func storeMessage(daemon *NNTPDaemon, hdr textproto.MIMEHeader, body io.Reader) } return } + + +func hasAtLeastNWords(str string, n int) bool { + parts := strings.Split(str, " ") + return len(parts) > n +} \ No newline at end of file