Lines Matching refs:smtp
65 smtp = smtplib.SMTP(HOST, self.port)
66 smtp.close()
70 smtp = smtplib.SMTP("%s:%s" % (HOST, self.port))
71 smtp.close()
75 smtp = smtplib.SMTP(HOST, self.port, local_hostname="testhost")
76 self.assertEqual(smtp.local_hostname, "testhost")
77 smtp.close()
83 smtp = smtplib.SMTP(HOST, self.port)
86 self.assertEqual(smtp.sock.gettimeout(), 30)
87 smtp.close()
93 smtp = smtplib.SMTP(HOST, self.port, timeout=None)
96 self.assertIsNone(smtp.sock.gettimeout())
97 smtp.close()
100 smtp = smtplib.SMTP(HOST, self.port, timeout=30)
101 self.assertEqual(smtp.sock.gettimeout(), 30)
102 smtp.close()
182 smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=15)
183 smtp.quit()
186 smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=15)
188 self.assertEqual(smtp.noop(), expected)
189 smtp.quit()
192 smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=15)
194 self.assertEqual(smtp.rset(), expected)
195 smtp.quit()
199 smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=15)
201 self.assertEqual(smtp.ehlo(), expected)
202 smtp.quit()
206 smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=15)
208 self.assertEqual(smtp.vrfy('nobody@nowhere.com'), expected)
209 self.assertEqual(smtp.verify('nobody@nowhere.com'), expected)
210 smtp.quit()
215 smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=15)
216 smtp.helo()
218 self.assertEqual(smtp.helo(), expected)
219 smtp.quit()
222 smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=15)
223 self.assertEqual(smtp.help(), 'Error: command "HELP" not implemented')
224 smtp.quit()
229 smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=15)
230 smtp.sendmail('John', 'Sally', m)
235 smtp.quit()
251 smtp = smtplib.SMTP()
252 self.assertRaises(smtplib.SMTPServerDisconnected, smtp.ehlo)
254 smtp.send, 'test msg')
453 smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=15)
454 smtp.quit()
457 smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=15)
460 self.assertEqual(smtp.esmtp_features, {})
470 smtp.ehlo()
471 self.assertEqual(smtp.esmtp_features, expected_features)
473 self.assertTrue(smtp.has_extn(k))
474 self.assertFalse(smtp.has_extn('unsupported-feature'))
475 smtp.quit()
478 smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=15)
482 self.assertEqual(smtp.vrfy(email), expected_known)
486 self.assertEqual(smtp.vrfy(u), expected_unknown)
487 smtp.quit()
490 smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=15)
497 self.assertEqual(smtp.expn(listname), expected_known)
501 self.assertEqual(smtp.expn(u), expected_unknown)
502 smtp.quit()
506 smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=15)
509 self.assertEqual(smtp.login(sim_auth[0], sim_auth[1]), expected_auth_ok)
521 smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=15)
522 try: smtp.login(sim_auth[0], sim_auth[1])
529 smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=15)
531 try: smtp.login(sim_auth[0], sim_auth[1])
540 smtp = smtplib.SMTP(HOST, self.port,
543 code, message = smtp.ehlo()
545 self.assertIn('size', smtp.esmtp_features)
546 smtp.quit()
547 self.assertNotIn('size', smtp.esmtp_features)
548 smtp.connect(HOST, self.port)
549 self.assertNotIn('size', smtp.esmtp_features)
550 smtp.ehlo_or_helo_if_needed()
551 self.assertIn('size', smtp.esmtp_features)
552 smtp.quit()