Pylons/pyramid_mailer — Issue #3: pyramid_mailer does not send to cc addresses
Author: dckc
Created: 2011-11-01 20:56:14+00:00
State: open

test case:

from pyramid_mailer.mailer import Mailer, DummyMailer
from pyramid_mailer.message import Message

def _test(to, cc, host, port=25):
m = Mailer(host=host, port=port, debug=1)
msg = Message(recipients=[to], cc=[cc],
sender=cc,
subject='pyramid_mailer cc test',
body='testing 1... 2... 3...')
m.send_immediately(msg)

before my patch:

(isolate-bug)dconnolly@bid-bse01:~/isolate-bug$ python mail_cc.py nobody@kumc.edu dconnolly@kumc.edu smtp.kumc.edu
send: 'ehlo [127.0.1.1]\r\n'
reply: '250-smtpout.kumc.edu\r\n'
reply: '250-AUTH LOGIN\r\n'
reply: '250-8BITMIME\r\n'
reply: '250-SIZE\r\n'
reply: '250 DSN\r\n'
reply: retcode (250); Msg: smtpout.kumc.edu
AUTH LOGIN
8BITMIME
SIZE
DSN
send: 'mail FROM: size=218\r\n'
reply: '250 Ok\r\n'
reply: retcode (250); Msg: Ok
send: 'rcpt TO:\r\n'
reply: '550 No such recipient\r\n'
reply: retcode (550); Msg: No such recipient
send: 'rset\r\n'
reply: '250 Ok\r\n'
reply: retcode (250); Msg: Ok
..

and after:

(isolate-bug)dconnolly@bid-bse01:~/isolate-bug$ python mail_cc.py nobody@kumc.edu dconnolly@kumc.edu smtp.kumc.edu
send: 'ehlo [127.0.1.1]\r\n'
reply: '250-smtpout.kumc.edu\r\n'
reply: '250-AUTH LOGIN\r\n'
reply: '250-8BITMIME\r\n'
reply: '250-SIZE\r\n'
reply: '250 DSN\r\n'
reply: retcode (250); Msg: smtpout.kumc.edu
AUTH LOGIN
8BITMIME
SIZE
DSN
send: 'mail FROM: size=218\r\n'
reply: '250 Ok\r\n'
reply: retcode (250); Msg: Ok
send: 'rcpt TO:\r\n'
reply: '250 Ok\r\n'
reply: retcode (250); Msg: Ok
send: 'rcpt TO:\r\n'
reply: '550 No such recipient\r\n'
reply: retcode (550); Msg: No such recipient
send: 'data\r\n'
reply: '354 Enter mail, end with "." on a line by itself\r\n'
reply: retcode (354); Msg: Enter mail, end with "." on a line by itself
data: (354, 'Enter mail, end with "." on a line by itself')
send: 'MIME-Version: 1.0\r\nCc: dconnolly@kumc.edu\r\nFrom: dconnolly@kumc.edu\r\nSubject: pyramid_mailer cc test\r\nTo: nobody@kumc.edu\r\nContent-Type: text/plain; charset="us-ascii"\r\nContent-Transfer-Encoding: 7bit\r\n\r\ntesting 1... 2... 3...\r\n.\r\n'
reply: '250 Ok\r\n'
reply: retcode (250); Msg: Ok
data: (250, 'Ok')
send: 'quit\r\n'
reply: '221 smtpout.kumc.edu Closing transmission channel\r\n'
reply: retcode (221); Msg: smtpout.kumc.edu Closing transmission channel

filed earlier as https://github.com/Pylons/pyramid/issues/333