diff --git a/docs/courier-to-mailman3.md b/docs/courier-to-mailman3.md index 2e8380b..8237543 100644 --- a/docs/courier-to-mailman3.md +++ b/docs/courier-to-mailman3.md @@ -25,4 +25,5 @@ This is our current version trying to communicate between courier and mailman3. * Now let's see if this works... * Date format set: * Level and File set in variable - * Format had errors with `$` used instead of `%` \ No newline at end of file + * Format had errors with `$` used instead of `%` +* Clean up logging to not log what was logged for logging diagnostics. \ No newline at end of file diff --git a/source/courier-to-mailman3.py b/source/courier-to-mailman3.py index 06ff9de..333f662 100644 --- a/source/courier-to-mailman3.py +++ b/source/courier-to-mailman3.py @@ -22,26 +22,20 @@ LEVEL=logging.INFO LOGFILE='/opt/mailman/logs/courier-to-mailman.log' logging.basicConfig(filename=LOGFILE, level=LEVEL, format=FORMAT, datefmt=DATEFMT) -logger.info('format set to: %s', FORMAT) -print('format set to: %s', FORMAT) - -logger.info('Starting Logging (outside try)') -print('Starting Logging (outside try)') - try: import os import sys import smtplib logger.info('Starting Logging (inside try)') - print('Starting Logging (inside try)') # Setup LTMP connection lmtp_host = sys.argv[3] if len(sys.argv) > 3 else 'localhost' logger.info('lmtp_host: %s', lmtp_host) # class smtplib.LMTP(host='', port=LMTP_PORT, local_hostname=None, source_address=None) - lmtp = smtplib.LMTP(lmtp_host, int(sys.argv[1])) logger.info('lmtp_port: %s', sysv.arg[1]) + lmtp = smtplib.LMTP(lmtp_host, int(sys.argv[1])) + logger.info('lmtp_port (lmtp setup): %s', sysv.arg[1]) try: # Unfortunately qmail sends to local bare LF for end line, while