From: Kevin R. <ke...@ro...> - 2004-01-22 13:44:45
|
Below is a patch from a Debian user to add encoding support. Kevin Eugene Konev wrote: > Package: cvs-syncmail > Severity: wishlist > Tags: patch > > Please, add the support for setting encoding for generated messages. > Patch is enclosed. > > Debian Release: testing/unstable > Architecture: i386 > Kernel: Linux ftp-local 2.6.0-test9 #7 Wed Nov 19 16:18:09 KRAT 2003 i686 > Locale: LANG=C, LC_CTYPE=C > > +++ syncmail 2004-01-16 21:27:58.000000000 +0700 > @@ -64,6 +64,9 @@ > Add a "Reply-To: ADDR" header to the email message. > > + --charset=charset > + Add a encoding header to message. > + > Don't print as much status to stdout. > > @@ -229,7 +232,7 @@ > > > -def blast_mail(subject, people, entries, contextlines, fromhost, replyto): > +def blast_mail(subject, people, entries, contextlines, fromhost, replyto, charset): > # cannot wait for child process or that will cause parent to retain cvs > # lock for too long. Urg! > if not os.fork(): > @@ -260,6 +263,8 @@ > To: %(people)s''' % vars > if replyto: > print 'Reply-To: %s' % replyto > + if charset: > + print 'MIME-Version: 1.0\nContent-Type: text/plain; charset=%s\nContent-Transfer-Encoding: 8bit' % charset > print '''\ > Subject: %(subject)s > Date: %(date)s > @@ -383,7 +388,7 @@ > sys.argv[1:], 'hC:cuS:R:qf:m:', > ['fromhost=', 'context=', 'cvsroot=', 'mailhost=', > 'subject-prefix=', 'reply-to=', > - 'help', 'quiet']) > + 'help', 'quiet', 'charset=']) > except getopt.error, msg: > usage(1, msg) > > @@ -392,6 +397,7 @@ > verbose = 1 > subject_prefix = "" > replyto = None > + charset = None > fromhost = None > for opt, arg in opts: > if opt in ('-h', '--help'): > @@ -409,6 +415,8 @@ > subject_prefix = arg > elif opt in ('-R', '--reply-to'): > replyto = arg > + elif opt == '--charset': > + charset = arg > elif opt in ('-q', '--quiet'): > verbose = 0 > elif opt in ('-f', '--fromhost'): > @@ -445,7 +453,7 @@ > print 'Mailing %s...' % string.join(people, COMMASPACE) > print 'Generating notification message...' > blast_mail(subject, people, changes.values(), > - contextlines, fromhost, replyto) > + contextlines, fromhost, replyto, charset) > if verbose: > print 'Generating notification message... done.' > -- Kevin Rosenberg ke...@ro... |