Received: by mail.netbsd.org (Postfix, from userid 605) id C948884E03; Sat, 17 Jun 2017 13:55:07 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.netbsd.org (Postfix) with ESMTP id 5709B84D9C for ; Sat, 17 Jun 2017 13:55:07 +0000 (UTC) X-Virus-Scanned: amavisd-new at netbsd.org Received: from mail.netbsd.org ([127.0.0.1]) by localhost (mail.netbsd.org [127.0.0.1]) (amavisd-new, port 10025) with ESMTP id cw8Si3RYLD3Y for ; Sat, 17 Jun 2017 13:55:06 +0000 (UTC) Received: from cvs.NetBSD.org (ivanova.NetBSD.org [IPv6:2001:470:a085:999:28c:faff:fe03:5984]) by mail.netbsd.org (Postfix) with ESMTP id A864984D77 for ; Sat, 17 Jun 2017 13:55:06 +0000 (UTC) Received: by cvs.NetBSD.org (Postfix, from userid 500) id 9F76FFAE8; Sat, 17 Jun 2017 13:55:06 +0000 (UTC) Content-Transfer-Encoding: 7bit Content-Type: multipart/mixed; boundary="_----------=_1497707706174810" MIME-Version: 1.0 Date: Sat, 17 Jun 2017 13:55:06 +0000 From: "Amitai Schleier" Subject: CVS commit: pkgsrc/mail/pymsgauth To: pkgsrc-changes@NetBSD.org Reply-To: schmonz@netbsd.org X-Mailer: log_accum Message-Id: <20170617135506.9F76FFAE8@cvs.NetBSD.org> Sender: pkgsrc-changes-owner@NetBSD.org List-Id: pkgsrc-changes.NetBSD.org Precedence: bulk List-Unsubscribe: This is a multi-part message in MIME format. --_----------=_1497707706174810 Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" Module Name: pkgsrc Committed By: schmonz Date: Sat Jun 17 13:55:06 UTC 2017 Modified Files: pkgsrc/mail/pymsgauth: Makefile PLIST distinfo Added Files: pkgsrc/mail/pymsgauth/patches: patch-pymsgauth-tag patch-pymsgauth.py Log Message: Add pymsgauth-tag, a Unix filter that takes an RFC822 mail message on stdin and prints it to stdout, adding a pymsgauth token in the header if needed. Patch has been submitted upstream. Bump PKGREVISION. To generate a diff of this commit: cvs rdiff -u -r1.14 -r1.15 pkgsrc/mail/pymsgauth/Makefile cvs rdiff -u -r1.2 -r1.3 pkgsrc/mail/pymsgauth/PLIST \ pkgsrc/mail/pymsgauth/distinfo cvs rdiff -u -r0 -r1.1 pkgsrc/mail/pymsgauth/patches/patch-pymsgauth-tag \ pkgsrc/mail/pymsgauth/patches/patch-pymsgauth.py Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. --_----------=_1497707706174810 Content-Disposition: inline Content-Length: 5836 Content-Transfer-Encoding: binary Content-Type: text/x-diff; charset=us-ascii Modified files: Index: pkgsrc/mail/pymsgauth/Makefile diff -u pkgsrc/mail/pymsgauth/Makefile:1.14 pkgsrc/mail/pymsgauth/Makefile:1.15 --- pkgsrc/mail/pymsgauth/Makefile:1.14 Fri May 26 01:35:58 2017 +++ pkgsrc/mail/pymsgauth/Makefile Sat Jun 17 13:55:06 2017 @@ -1,8 +1,8 @@ -# $NetBSD: Makefile,v 1.14 2017/05/26 01:35:58 schmonz Exp $ +# $NetBSD: Makefile,v 1.15 2017/06/17 13:55:06 schmonz Exp $ # DISTNAME= pymsgauth-2.1.0 -PKGREVISION= 6 +PKGREVISION= 7 CATEGORIES= mail MASTER_SITES= ${HOMEPAGE} @@ -29,6 +29,9 @@ FILES_SUBST+= SHAREDIR=${SHAREDIR:Q} INSTALLATION_DIRS= ${SHAREDIR} ${DOCDIR} ${HTMLDOCDIR} ${EGDIR} bin +pre-install: + cd ${WRKSRC} && ${RM} -f *.orig + do-install: for f in ${REPLACE_PYTHON}; do \ ${INSTALL_SCRIPT} ${WRKSRC}/$${f} ${DESTDIR}${PREFIX}/${SHAREDIR}; \ Index: pkgsrc/mail/pymsgauth/PLIST diff -u pkgsrc/mail/pymsgauth/PLIST:1.2 pkgsrc/mail/pymsgauth/PLIST:1.3 --- pkgsrc/mail/pymsgauth/PLIST:1.2 Sun Jun 14 18:04:40 2009 +++ pkgsrc/mail/pymsgauth/PLIST Sat Jun 17 13:55:06 2017 @@ -1,4 +1,4 @@ -@comment $NetBSD: PLIST,v 1.2 2009/06/14 18:04:40 joerg Exp $ +@comment $NetBSD: PLIST,v 1.3 2017/06/17 13:55:06 schmonz Exp $ share/doc/html/pymsgauth/pymsgauth.html share/doc/pymsgauth/BUGS share/doc/pymsgauth/CHANGELOG @@ -9,4 +9,5 @@ share/pymsgauth/ConfParser.py share/pymsgauth/pymsgauth-clean share/pymsgauth/pymsgauth-confirm share/pymsgauth/pymsgauth-mail +share/pymsgauth/pymsgauth-tag share/pymsgauth/pymsgauth.py Index: pkgsrc/mail/pymsgauth/distinfo diff -u pkgsrc/mail/pymsgauth/distinfo:1.2 pkgsrc/mail/pymsgauth/distinfo:1.3 --- pkgsrc/mail/pymsgauth/distinfo:1.2 Tue Nov 3 23:27:17 2015 +++ pkgsrc/mail/pymsgauth/distinfo Sat Jun 17 13:55:06 2017 @@ -1,6 +1,8 @@ -$NetBSD: distinfo,v 1.2 2015/11/03 23:27:17 agc Exp $ +$NetBSD: distinfo,v 1.3 2017/06/17 13:55:06 schmonz Exp $ SHA1 (pymsgauth-2.1.0.tar.gz) = fe6c60022529ce2444db3423f84d44e457ae61bb RMD160 (pymsgauth-2.1.0.tar.gz) = 0a5d7d6be65d9623647a3dfe014cb89a2c213183 SHA512 (pymsgauth-2.1.0.tar.gz) = a53ab929659106903a0c0fb83984a478d3bf32556467cf2ccf88d36f7b749a692edc3253a49ef78b0a3fe6e7475cca1ae583d4b8bc162fb693b395b6ab80ebc1 Size (pymsgauth-2.1.0.tar.gz) = 17915 bytes +SHA1 (patch-pymsgauth-tag) = 44d27f8d915752c35cd07acd556490d93945d21e +SHA1 (patch-pymsgauth.py) = 2d27f17b1c37d7e4646a69424bec68aa3380c29f Added files: Index: pkgsrc/mail/pymsgauth/patches/patch-pymsgauth-tag diff -u /dev/null pkgsrc/mail/pymsgauth/patches/patch-pymsgauth-tag:1.1 --- /dev/null Sat Jun 17 13:55:06 2017 +++ pkgsrc/mail/pymsgauth/patches/patch-pymsgauth-tag Sat Jun 17 13:55:06 2017 @@ -0,0 +1,17 @@ +$NetBSD: patch-pymsgauth-tag,v 1.1 2017/06/17 13:55:06 schmonz Exp $ + +Add pymsgauth-tag, a Unix filter that takes an RFC822 mail message on stdin +and prints it to stdout, adding a pymsgauth token in the header if needed. + +--- pymsgauth-tag.orig 2017-05-31 01:57:20.000000000 +0000 ++++ pymsgauth-tag +@@ -0,0 +1,9 @@ ++#!/usr/bin/python ++ ++from pymsgauth import * ++ ++import cStringIO ++import sys ++ ++msg = tokenize_message_if_needed (cStringIO.StringIO (sys.stdin.read ())) ++sys.stdout.write (msg) Index: pkgsrc/mail/pymsgauth/patches/patch-pymsgauth.py diff -u /dev/null pkgsrc/mail/pymsgauth/patches/patch-pymsgauth.py:1.1 --- /dev/null Sat Jun 17 13:55:06 2017 +++ pkgsrc/mail/pymsgauth/patches/patch-pymsgauth.py Sat Jun 17 13:55:06 2017 @@ -0,0 +1,67 @@ +$NetBSD: patch-pymsgauth.py,v 1.1 2017/06/17 13:55:06 schmonz Exp $ + +Add pymsgauth-tag, a Unix filter that takes an RFC822 mail message on stdin +and prints it to stdout, adding a pymsgauth token in the header if needed. + +--- pymsgauth.py.orig 2003-12-15 16:49:28.000000000 +0000 ++++ pymsgauth.py +@@ -362,9 +362,24 @@ def sendmail_wrapper (args): + mailcmd += args + log (TRACE, 'mailcmd == %s' % mailcmd) + buf = cStringIO.StringIO (sys.stdin.read()) +- msg = rfc822.Message (buf, seekable=1) ++ new_buf = tokenize_message_if_needed (buf, args) ++ ++ send_mail (new_buf, mailcmd) ++ if (new_buf != buf.getvalue ()): ++ log (TRACE, 'Sent tokenized mail.') ++ else: ++ log (TRACE, 'Passed mail through unchanged.') ++ ++ except StandardError, txt: ++ log (FATAL, 'Fatal: caught exception (%s)' % txt) ++ log_exception () ++ sys.exit (1) + ++############################# ++def should_tokenize_message (msg, *args): ++ try: + sign_message = 0 ++ + for arg in args: + if arg in config['token_recipient']: + sign_message = 1 +@@ -378,15 +393,27 @@ def sendmail_wrapper (args): + if recip in config['token_recipient']: + sign_message = 1 + break +- if sign_message: ++ ++ return sign_message ++ ++ except StandardError, txt: ++ log (FATAL, 'Fatal: caught exception (%s)' % txt) ++ log_exception () ++ sys.exit (1) ++ ++############################# ++def tokenize_message_if_needed (buf, *args): ++ try: ++ read_config () ++ log (TRACE) ++ msg = rfc822.Message (buf, seekable=1) ++ ++ if should_tokenize_message (msg, args): + token = gen_token (msg) + log (INFO, 'Generated token %s.' % token) +- new_buf = '%s: %s\n' % (config['auth_field'], token) + buf.getvalue () +- send_mail (new_buf, mailcmd) +- log (TRACE, 'Sent tokenized mail.') ++ return '%s: %s\n' % (config['auth_field'], token) + buf.getvalue () + else: +- send_mail (buf.getvalue (), mailcmd) +- log (TRACE, 'Passed mail through unchanged.') ++ return buf.getvalue () + + except StandardError, txt: + log (FATAL, 'Fatal: caught exception (%s)' % txt) --_----------=_1497707706174810--