diff options
| author | Barry Warsaw | 2009-10-18 19:32:07 -0400 |
|---|---|---|
| committer | Barry Warsaw | 2009-10-18 19:32:07 -0400 |
| commit | 9f6eaef1d836a4234773c0f64dbb09b901ccf21f (patch) | |
| tree | 4342f0943bfe807aa9fefeb13324363be866b3a5 | |
| parent | 2980db25a729060abbe541c80272b4d8cc956ce3 (diff) | |
| download | mailman-9f6eaef1d836a4234773c0f64dbb09b901ccf21f.tar.gz mailman-9f6eaef1d836a4234773c0f64dbb09b901ccf21f.tar.zst mailman-9f6eaef1d836a4234773c0f64dbb09b901ccf21f.zip | |
| -rw-r--r-- | src/mailman/mta/connection.py | 2 | ||||
| -rw-r--r-- | src/mailman/mta/docs/connection.txt | 27 |
2 files changed, 27 insertions, 2 deletions
diff --git a/src/mailman/mta/connection.py b/src/mailman/mta/connection.py index 5c9ba7474..922c492e9 100644 --- a/src/mailman/mta/connection.py +++ b/src/mailman/mta/connection.py @@ -53,7 +53,7 @@ class Connection: """ self._host = host self._port = port - self._connections_per_session = sessions_per_connection + self._sessions_per_connection = sessions_per_connection self._connection = None def _connect(self): diff --git a/src/mailman/mta/docs/connection.txt b/src/mailman/mta/docs/connection.txt index d00df0579..d57e301d6 100644 --- a/src/mailman/mta/docs/connection.txt +++ b/src/mailman/mta/docs/connection.txt @@ -13,8 +13,33 @@ is created, as is the host and port number of the SMTP server. >>> connection = Connection( ... config.mta.smtp_host, int(config.mta.smtp_port), 1) - + At the start, there have been no connections to the server. >>> smtpd.get_session_count() 0 + +By sending a message to the server, a session is started. + + >>> connection.sendmail('anne@example.com', ['bart@example.com'], """\ + ... From: anne@example.com + ... To: bart@example.com + ... Subject: aardvarks + ... + ... """) + {} + + >>> smtpd.get_session_count() + 1 + +We can reset the session count back to zero. + + >>> from smtplib import SMTP + >>> def reset(): + ... smtpd = SMTP() + ... smtpd.connect(config.mta.smtp_host, int(config.mta.smtp_port)) + ... smtpd.docmd('RSET') + + >>> reset() + >>> smtpd.get_session_count() + 0 |
