[mmjp-users 2339] Re: 送信者の名前を本文に表示する方法

Nagae Hidetake nagae @ eagan.jp
2008年 2月 29日 (金) 07:20:43 JST


永江です。何度もすみません。
ひとつ前のファイルを送っていました。

何やっているんだか…。

--
永江  英武		nagae @ eagan.jp
Nagae Hidetake		http://www.eagan.jp/nagae/

-------------- next part --------------
*** Mailman/Handlers/Cleanse.py.orig	Mon Jan 16 06:01:35 2006
--- Mailman/Handlers/Cleanse.py	Thu Feb 28 20:52:46 2008
***************
*** 32,37 ****
--- 32,38 ----
      del msg['approve']
      # Also remove this header since it can contain a password
      del msg['urgent']
+     msgdata['orig-sender'] = msg.get('from')
      # We remove other headers from anonymous lists
      if mlist.anonymous_list:
          syslog('post', 'post to %s from %s anonymized',
*** Mailman/Handlers/Decorate.py.orig	Sun Sep 30 16:11:02 2007
--- Mailman/Handlers/Decorate.py	Fri Feb 29 06:40:05 2008
***************
*** 41,46 ****
--- 41,61 ----
      if msgdata.get('isdigest') or msgdata.get('nodecorate'):
          return
      d = {}
+     lcset = Utils.GetCharSet(mlist.preferred_language)
+     from email.Utils import parseaddr
+     sender_parsed = parseaddr(msgdata['orig-sender'])
+     d['sender_address'] = sender_parsed[1]
+     d['sender_fullname'] = d['sender_address']
+     if sender_parsed[0] != '':
+         d['sender_fullname'] = Utils.oneline(sender_parsed[0], lcset)
+     d['sender_nickname'] = d['sender_fullname']
+     if mlist.isMember(sender_parsed[1]):
+         nickname = mlist.getMemberName(sender_parsed[1])
+         if nickname != None and nickname != '':
+             try:
+                 d['sender_nickname'] = nickname.encode(lcset)
+             except (AttributeError, UnicodeError):
+                 d['sender_nickname'] = d['sender_fullname']
      if msgdata.get('personalize'):
          # Calculate the extra personalization dictionary.  Note that the
          # length of the recips list better be exactly 1.
*** Mailman/Gui/Digest.py.orig	Sat Aug 27 10:40:17 2005
--- Mailman/Gui/Digest.py	Thu Feb 28 20:49:49 2008
***************
*** 27,32 ****
--- 27,33 ----
  # to this.
  ALLOWEDS = ('real_name', 'list_name', 'host_name', 'web_page_url',
              'description', 'info', 'cgiext', '_internal_name',
+             'sender_fullname', 'sender_address', 'sender_nickname',
              )
  
  


mailman-users-jp メーリングリストの案内