Changeset 66
- Timestamp:
- 11/07/07 02:53:29 (1 year ago)
- Location:
- branches/3.0
- Files:
-
- 1 added
- 13 modified
-
setup.cfg (modified) (1 diff, 1 prop)
-
setup.py (modified) (2 diffs, 1 prop)
-
turbomail/api.py (modified) (1 diff, 1 prop)
-
turbomail/control.py (modified) (1 diff, 1 prop)
-
turbomail/exceptions.py (modified) (1 diff, 1 prop)
-
turbomail/extensions/smime.py (added)
-
turbomail/extensions/utf8qp.py (modified) (1 diff, 1 prop)
-
turbomail/managers/demand.py (modified) (1 diff, 1 prop)
-
turbomail/managers/immediate.py (modified) (1 diff, 1 prop)
-
turbomail/message.py (modified) (9 diffs, 1 prop)
-
turbomail/providers/debug.py (modified) (1 diff, 1 prop)
-
turbomail/providers/smtp.py (modified) (1 diff, 1 prop)
-
turbomail/release.py (modified) (1 diff, 1 prop)
-
turbomail/util.py (modified) (1 diff, 1 prop)
Legend:
- Unmodified
- Added
- Removed
-
branches/3.0/setup.cfg
- Property svn:keywords set to Revision
r33 r66 1 # $Revision$ 2 1 3 [egg_info] 2 4 tag_build = .dev -
branches/3.0/setup.py
- Property svn:keywords set to Revision
r52 r66 1 1 #!/usr/bin/env python 2 2 # encoding: utf-8 3 4 __version__ = "$Revision$" 3 5 4 6 import sys … … 63 65 'turbomail.extensions': [ 64 66 "utf8qp = turbomail.extensions.utf8qp", 65 "smime = turbomail.extensions.smime",67 # "smime = turbomail.extensions.smime", 66 68 # "gpg = turbomail.extensions.gpg", 67 69 ] -
branches/3.0/turbomail/api.py
- Property svn:keywords set to Revision
r63 r66 3 3 """TurboMail extension API.""" 4 4 5 __version__ = "$Revision : 1$"5 __version__ = "$Revision$" 6 6 __all__ = ['Extension', 'ProviderFactory', 'Provider', 'Manager'] 7 7 -
branches/3.0/turbomail/control.py
- Property svn:keywords set to Revision
r65 r66 20 20 """ 21 21 22 __version__ = "$Revision : 1$"22 __version__ = "$Revision$" 23 23 24 24 import logging -
branches/3.0/turbomail/exceptions.py
- Property svn:keywords set to Revision
r63 r66 3 3 """Exceptions used by TurboMail to report common errors.""" 4 4 5 __version__ = "$Revision : 1$"5 __version__ = "$Revision$" 6 6 __all__ = ['MailException', 'MailNotEnabledError', 'MailConfigurationError', 'ProviderException', 'ProviderExhaustedException', 'ManagerException'] 7 7 -
branches/3.0/turbomail/extensions/utf8qp.py
- Property svn:keywords set to Revision
r65 r66 3 3 """TurboMail extension API.""" 4 4 5 __version__ = "$Revision : 1$"5 __version__ = "$Revision$" 6 6 7 7 import logging -
branches/3.0/turbomail/managers/demand.py
- Property svn:keywords set to Revision
r63 r66 3 3 """TurboMail extension API.""" 4 4 5 __version__ = "$Revision : 1$"5 __version__ = "$Revision$" 6 6 7 7 import logging -
branches/3.0/turbomail/managers/immediate.py
- Property svn:keywords set to Revision
r63 r66 3 3 """TurboMail extension API.""" 4 4 5 __version__ = "$Revision : 1$"5 __version__ = "$Revision$" 6 6 7 7 import logging -
branches/3.0/turbomail/message.py
- Property svn:keywords set to Revision
r52 r66 2 2 3 3 """MIME-encoded electronic mail message classes.""" 4 5 __version__ = "$Revision$" 4 6 5 7 import turbomail … … 17 19 from email.Header import Header 18 20 19 from uuid import uuid 4as uuid21 from uuid import uuid1 as uuid 20 22 21 23 import logging … … 31 33 This allows you to define your own message to be delivered.""" 32 34 33 def __init__(self, id=None, sender=None, recipients=[], message=None):34 self.id = id35 self.sender = sender36 self.recipient s = recipients35 def __init__(self, sender, recipient, message): 36 self.id = str(uuid()) 37 self.sender = AddressList(sender) 38 self.recipient = AddressList(recipient) 37 39 self.message = message 38 40 39 if not self.id: self.id = uuid()40 41 41 super(StubMessage, self).__init__() 42 43 envelope = proeprty(lambda self: self.sender) 42 44 43 45 def __str__(self): … … 114 116 if not self._id or (self._processed and self._dirty): 115 117 self.__dict__['_id'] = str(uuid()) 118 116 119 self._processed = False 117 120 … … 122 125 def envelope(self): 123 126 if self.sender and self.senders != self.author: 124 return AddressList(self.sender s)127 return AddressList(self.sender) 125 128 return AddressList(self.author) 126 129 … … 132 135 recipients = property(recipients) 133 136 134 def mime(self): 135 """Produce the final MIME message.""" 136 137 assert self.author, "You must specify an author." 138 assert self.subject, "You must specify a subject." 139 assert self.to or self.cc or self.bcc, "You must specify at least one recipient." 140 assert self.plain, "You must provide plain text content." 141 142 #if not self._dirty and self._processed: 143 # return self._mime 144 145 self._processed = False 146 147 plain = MIMEText(self._callable(self.plain).encode(self.encoding), 'plain', self.encoding) 148 149 rich = None 150 if self.rich: 151 rich = MIMEText(self._callable(self.rich).encode(self.encoding), 'html', self.encoding) 152 153 def generate_mime(): 154 if not rich: return plain 155 137 def mimeDocument(self, plain, rich=None): 138 if not rich: 139 message = plain 140 141 else: 156 142 message = MIMEMultipart('alternative') 157 143 message.attach(plain) 158 144 159 145 if not self.embedded: 160 146 message.attach(rich) 161 147 162 148 else: 163 149 embedded = MIMEMultipart('related') … … 165 151 for attachment in self.embedded: embedded.attach(attachment) 166 152 message.attach(embedded) 167 168 return message169 170 message = generate_mime()171 153 172 154 if self.attachments: … … 175 157 for attachment in self.attachments: attachments.attach(attachment) 176 158 message = attachments 159 160 return message 161 162 def mime(self): 163 """Produce the final MIME message.""" 164 165 assert self.author, "You must specify an author." 166 assert self.subject, "You must specify a subject." 167 assert self.to or self.cc or self.bcc, "You must specify at least one recipient." 168 assert self.plain, "You must provide plain text content." 169 170 if not self._dirty and self._processed and not turbomail.config.get("mail.debug", False): 171 return self._mime 172 173 self._processed = False 174 175 plain = MIMEText(self._callable(self.plain).encode(self.encoding), 'plain', self.encoding) 176 177 rich = None 178 if self.rich: 179 rich = MIMEText(self._callable(self.rich).encode(self.encoding), 'html', self.encoding) 180 181 message = self.generate_mime_document(plain, rich) 177 182 178 183 if hasattr(self, "process_mime_message"): … … 196 201 ('X-Mailer', "%s <%s>" % (release.name, release.url)), 197 202 ('X-TurboMail-Version', release.version), 198 ('X-TurboMail-Message-GUID', self.id),199 203 ]) 204 205 if turbomail.config.get("mail.debug", False): 206 headers.append(('X-TurboMail-Message-GUID', self.id)) 200 207 201 208 if turbomail.provider: -
branches/3.0/turbomail/providers/debug.py
- Property svn:keywords set to Revision
r63 r66 3 3 """TurboMail extension API.""" 4 4 5 __version__ = "$Revision : 1$"5 __version__ = "$Revision$" 6 6 7 7 import logging -
branches/3.0/turbomail/providers/smtp.py
- Property svn:keywords set to Revision
r63 r66 3 3 """TurboMail extension API.""" 4 4 5 __version__ = "$Revision : 1$"5 __version__ = "$Revision$" 6 6 7 7 import logging -
branches/3.0/turbomail/release.py
- Property svn:keywords set to Revision
r64 r66 3 3 """Release information about TurboMail.""" 4 4 5 __version__ = "$Revision : 1$"5 __version__ = "$Revision$" 6 6 7 7 name = "TurboMail" -
branches/3.0/turbomail/util.py
- Property svn:keywords set to Revision
r63 r66 3 3 """MIME-encoded electronic mail message classes.""" 4 4 5 __version__ = "$Revision : 1$"5 __version__ = "$Revision$" 6 6 7 7 import re
