Ignore:
Timestamp:
12 Aug 2014, 15:49:43 (10 years ago)
Author:
uli
Message:

Make sure that by default no CC is mailed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/smtp.py

    r11586 r11778  
    160160
    161161def send_mail(from_name, from_addr, rcpt_name, rcpt_addrs,
    162               subject, body, config=None):
     162              subject, body, config=None, cc=False):
    163163    """Send mail.
    164164
     
    167167
    168168    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
     169    (and cc) field only. It will _not_ be used for the `from` field,
     170    as yahoo does not allow non-yahoo servers to deliver mail with
    171171    ``@yahoo.com`` in the from-field.
    172172
    173173    The from-address set here will be: `FROM_ADDRESS` as set above.
     174
     175    ``cc`` tells whether we want the from-address to be CCed. This is
     176    not the case by default as we easily act as an open relay
     177    otherwise.
    174178
    175179    XXX: The hard-coded from-address should be changable or be
     
    187191    body["From"] = sender_addr
    188192    body["To"] = body_to.strip(', ')
    189     body["Cc"] = body["Reply-To"] = reply_addr
     193    if cc:
     194        body["Cc"] = reply_addr
     195    body["Reply-To"] = reply_addr
    190196    body["Subject"] = encode_header_item(subject)
    191197
Note: See TracChangeset for help on using the changeset viewer.