OSSP CVS Repository

ossp - Difference in ossp-pkg/lmtp2nntp/test/run.sh versions 1.5 and 1.6
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [History

ossp-pkg/lmtp2nntp/test/run.sh 1.5 -> 1.6

--- run.sh       2001/08/14 14:42:41     1.5
+++ run.sh       2001/08/16 15:00:50     1.6
@@ -1,7 +1,17 @@
 #/bin/sh
 
+# -h news-muc1.de.cw.net
+# -h news-ffm2.de.cw.net
+# -h news-dus2.de.cw.net
+# -h news.ecrc.de
+# -h dev16
+
 before ()
 {
+    #set -v -x
+    h="H"
+    z="Z"
+    e="E"
     if [ -e /tmp/tracing ]
     then
         ssh -t -x root@localhost exec rm -f /tmp/tracing
@@ -13,53 +23,77 @@
 {
     for h in 0 1 2 3 4 5 6 7 8 9
     do
-        for z in 0 1 2 3 4 5 6 7 8 9
+       for z in 0 1 2 3 4 5 6 7 8 9
         do
             for e in 0 1 2 3 4 5 6 7 8 9
             do
                 echo -n $h$z$e
-                awk <testmessage.viasendmail "\
-                  /^#$/        { print \"$h$z$e\" } \
-                  /Message-ID/ { print \"Message-ID: <`date +%Y%m%d%H%M%S`-$h$z$e@dev12.dev.de.cw.net>\" } \
-                 !/Message-ID/ { print \$0 } \
-                 " \
+                newmsg sendmail
+                cat /tmp/testmessage \
                  | sendmail -i posting+$h$z$e@dev12.dev.de.cw.net
             done
         done
     done
 }
 
-postdup ()
+lmtp()
 {
-    echo -----------------------------------------------------------
-#./lmtp2nntp -h news-muc1.de.cw.net -h news-ffm2.de.cw.net -h news-dus2.de.cw.net -h news-ecrc.de
-#clear ; ./lmtp2nntp <testmessage2 -g envelope -h dev16
-#exit
-    awk <testmessage.viasendmail "\
-      /Message-ID/ { print \"Message-ID: <`date +%Y%m%d%H%M%S`@dev12.dev.de.cw.net>\" } \
-     !/Message-ID/ { print \$0 } \
-     " \
-     >/tmp/testmessage
-    echo -----------------------------------------------------------
+    newmsg lmtp
     cat /tmp/testmessage \
-     | sendmail -i posting+x@dev12.dev.de.cw.net
-    echo -----------------------------------------------------------
+     | ./lmtp2nntp -t /tmp/tracing -d $1 -g $2 -h dev16 cw.de.sd.apps.dev.test
     cat /tmp/testmessage \
-     | sendmail -i posting+x@dev12.dev.de.cw.net
-    echo -----------------------------------------------------------
+     | ./lmtp2nntp -t /tmp/tracing -d $1 -g $2 -h dev16 cw.de.sd.apps.dev.test
 }
 
+sendmaildup()
+{
+    newmsg sendmail
+    cat /tmp/testmessage \
+     | sendmail -i posting+$h$z$e@dev12.dev.de.cw.net
+    cat /tmp/testmessage \
+     | sendmail -i posting+$h$z$e@dev12.dev.de.cw.net
+}
+
+newmsg()
+{
+    if [ -r testmessage.via$1 ]
+    then
+        awk <testmessage.via$1 \
+         -v pid=$$ \
+         -v id=I${h}${z}${e}D \
+         -v date=`date +%Y%m%d%H%M%S` \
+         '
+            BEGIN          { gotit = 0; IGNORECASE = 1 }
+            /^#$/          { gotit = 1; print "#" date " [" pid "] " id }
+            /^Message-ID:/ { gotit = 1; print "Message-Id: <" date "-" id "@dev12.dev.de.cw.net>" }
+            /^Subject:/    { gotit = 1; print "Subject: [" pid "] " $2 }
+                           { if (gotit == 0) { print }; gotit = 0 }
+         ' | tee /tmp/testmessage
+    else
+        echo "ERROR: file testmessage.via$1 not readable!"
+        exit 1
+    fi
+    echo -----------------------------------------------------------
+}
 after ()
 {
     if [ -r /tmp/tracing ]
     then
-        echo tail -f /tmp/tracing
-        tail -f /tmp/tracing
+        echo more /tmp/tracing
+        #tail -f /tmp/tracing
     fi
 }
 
 before
-post1000
+
+#ok newmsg sendmail; ls -l /tmp/testmessage && cat /tmp/testmessage
+#ok lmtp feed arg
+#ok lmtp post arg
+#ok lmtp feed envelope
+#ok lmtp post envelope
+sendmaildup
+#post1000
+
 after
 exit 0
 

CVSTrac 2.0.1