Author: hjp
Date: Sat Dec 16 08:32:30 2006
New Revision: 690

Added:
   contrib/hjp/check_text/Makerules
Modified:
   contrib/hjp/check_text/Makefile
   contrib/hjp/check_text/check_text
   contrib/hjp/check_text/qpsmtpd-plugin-check_text.spec

Log:
- Fixed parsing of HTML parts.
- Strip leading and trailing space to catch messages containing only 
  whitespace.



Modified: contrib/hjp/check_text/Makefile
==============================================================================
--- contrib/hjp/check_text/Makefile     (original)
+++ contrib/hjp/check_text/Makefile     Sat Dec 16 08:32:30 2006
@@ -1,8 +1,13 @@
-PKG = qpsmtpd-plugin-check_text
+NAME=check_text
+FILES = $(PKG).spec \
+    Makefile \
+    Makerules \
+    check_text \
+
+
 all:
 
-rpm: $(PKG).tar.gz
-       rpm -ta --clean --sign --rmsource $^
+clean:
+       rm -f $(PKG).tar.gz *.tmp
 
-$(PKG).tar.gz: $(PKG).spec check_text
-       tar cfz $@ $^
+include Makerules

Added: contrib/hjp/check_text/Makerules
==============================================================================
--- (empty file)
+++ contrib/hjp/check_text/Makerules    Sat Dec 16 08:32:30 2006
@@ -0,0 +1,15 @@
+PKG = qpsmtpd-plugin-$(NAME)
+CONTRIB_BASE=~/wrk/qpsmtpd/contrib/hjp
+CONTRIB_FILES=$(patsubst %, $(CONTRIB_BASE)/$(NAME)/%, $(FILES))
+
+contrib: $(CONTRIB_FILES)
+
+$(CONTRIB_BASE)/$(NAME)/%: %
+       cp -p $^ $@
+
+rpm: $(PKG).tar.gz
+       rpm -ta --clean --sign --rmsource $^
+
+$(PKG).tar.gz: $(FILES)
+       tar cfz $@ $^
+

Modified: contrib/hjp/check_text/check_text
==============================================================================
--- contrib/hjp/check_text/check_text   (original)
+++ contrib/hjp/check_text/check_text   Sat Dec 16 08:32:30 2006
@@ -51,6 +51,7 @@
 use strict;
 use Data::Dumper;
 use MIME::Parser;
+use HTML::TokeParser;
 
 sub hook_rcpt {
     my ($self, $transaction, $recipient) = @_;
@@ -103,6 +104,9 @@
                    $text = extract_text($entity);
                }
 
+               $text =~ s/^\s+//s;
+               $text =~ s/\s+$//s;
+
                $self->log(LOGINFO, "text length:", length($text));
                if (length($text) == 0) {
                    $self->log(LOGINFO, "$r doesn't want mails without text");

Modified: contrib/hjp/check_text/qpsmtpd-plugin-check_text.spec
==============================================================================
--- contrib/hjp/check_text/qpsmtpd-plugin-check_text.spec       (original)
+++ contrib/hjp/check_text/qpsmtpd-plugin-check_text.spec       Sat Dec 16 
08:32:30 2006
@@ -1,5 +1,5 @@
 Name: qpsmtpd-plugin-check_text
-Version: 182
+Version: 215
 Release: 1
 Packager: [EMAIL PROTECTED]
 Summary: plugin for qpsmtpd to reject mails without text
@@ -40,6 +40,14 @@
 /usr/share/qpsmtpd/plugins/check_text
 
 %changelog
+* Sat Sep 02 2006 <[EMAIL PROTECTED]> 215-1
+- Fixed parsing of HTML parts.
+
+* Wed Jul 26 2006 <[EMAIL PROTECTED]> 188-1
+- Added documentation.
+- Strip leading and trailing space to catch messages containing only 
+  whitespace.
+
 * Fri May 05 2006 <[EMAIL PROTECTED]> 182-1
 - First RPM package.
 

Reply via email to