Changeset 11585 for main/waeup.kofa/trunk/src/waeup/kofa/smtp.py
- Timestamp:
- 10 Apr 2014, 12:57:45 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/smtp.py
r11584 r11585 52 52 from zope.sendmail.interfaces import IMailDelivery 53 53 from waeup.kofa.interfaces import IMailService 54 55 56 #: The hardcoded from address. Must not by yahoo.com. 57 FROM_ADDRESS = 'no-reply@waeup.org' 54 58 55 59 … … 158 162 subject, body, config=None): 159 163 """Send mail. 164 165 Use `IMailService` to send a mail with the parameters 166 delivered. 167 168 Please note: the `from_addr` given will be used for the reply-to 169 and cc field only. It will _not_ be used for the `from` field, as 170 yahoo does not allow non-yahoo servers to deliver mail with 171 ``@yahoo.com`` in the from-field. 172 173 The from-address set here will be: `FROM_ADDRESS` as set above. 174 175 XXX: The hard-coded from-address should be changable or be 176 determined smarter by looking up a FQDN or similar. 177 160 178 """ 161 179 # format message … … 165 183 body_to += '%s, ' % encode_address(email, rcpt_name) 166 184 body = encode_body(body) 167 body["From"] = body["Cc"] = encode_address(from_addr, from_name) 185 sender_addr = encode_address(FROM_ADDRESS, from_name) 186 reply_addr = encode_address(from_addr, from_name) 187 body["From"] = sender_addr 168 188 body["To"] = body_to.strip(', ') 189 body["Cc"] = body["Reply-To"] = reply_addr 169 190 body["Subject"] = encode_header_item(subject) 170 191
Note: See TracChangeset for help on using the changeset viewer.