[Spambayes-checkins] spambayes/Outlook2000 msgstore.py,1.93,1.94

Kenny Pitt kpitt at users.sourceforge.net
Thu Dec 16 17:20:25 CET 2004


Update of /cvsroot/spambayes/spambayes/Outlook2000
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4936

Modified Files:
	msgstore.py 
Log Message:
Improve e-mail address formatting for fake Exchange headers so that it
supports multiple addresses, some of which may be real Internet addresses.

Also, RFC 822 uses the American spelling of "Organization".


Index: msgstore.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/Outlook2000/msgstore.py,v
retrieving revision 1.93
retrieving revision 1.94
diff -C2 -d -r1.93 -r1.94
*** msgstore.py	16 Dec 2004 03:23:16 -0000	1.93
--- msgstore.py	16 Dec 2004 16:20:23 -0000	1.94
***************
*** 1007,1011 ****
              ("Importance", 6, False, self._format_importance),
              ("Date", 7, False, self._format_time),
!             ("Organisation", 8, True, None),
  #            ("X-Mailer", 9, False, self._format_version),
              ):
--- 1007,1011 ----
              ("Importance", 6, False, self._format_importance),
              ("Date", 7, False, self._format_time),
!             ("Organization", 8, True, None),
  #            ("X-Mailer", 9, False, self._format_version),
              ):
***************
*** 1045,1049 ****
          # have enough information available to get an actual working
          # email address.
!         return "%s at invalid (%s)" % (self._address_re.sub('', raw), raw)
  
      def _EnsureObject(self):
--- 1045,1059 ----
          # have enough information available to get an actual working
          # email address.
!         addresses = raw.split(";")
!         formattedAddresses = []
!         for address in addresses:
!             address = address.strip()
!             if address.find("@") >= 0:
!                 formattedAddress = address
!             else:
!                 formattedAddress = "\"%s\" <%s>" % \
!                         (address, self._address_re.sub('.', address))
!             formattedAddresses.append(formattedAddress)
!         return "; ".join(formattedAddresses)
  
      def _EnsureObject(self):



More information about the Spambayes-checkins mailing list