diff options
Diffstat (limited to 'climl/hooks.py')
-rw-r--r-- | climl/hooks.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/climl/hooks.py b/climl/hooks.py index a521376..e4a0a8e 100644 --- a/climl/hooks.py +++ b/climl/hooks.py @@ -5,10 +5,10 @@ from . import interface def hook_extract_listname(context): lines = context['content'].split(b'\n') for line in lines: - print('line: ', line) if line.startswith(b'Delivered-To: '): listname = line.split()[1].decode('ascii') - context['listname'] = listname + context['listname'] = listname.split('@')[0] + context['listaddress'] = listname print('found listname: {}'.format(listname)) return raise interface.HookAbortError('listname not found') @@ -30,7 +30,7 @@ def hook_generate_rcpt_list(context): listname = context.get('listname', None) if not listname: raise interface.HookStopIteration('list name not found') - recipients_filename = ''.join([listname, '-recipents.txt']) + recipients_filename = ''.join([listname, '-recipients.txt']) try: with open(recipients_filename, encoding='utf8') as fi: recipients = [recipient for recipient in fi] @@ -51,7 +51,7 @@ def hook_send_all(context): raise interface.HookStopIteration() # TODO: how to send emails here ? - smtp_server = smtplib.SMTP(context.conf.get('smtp.server')) + smtp_server = smtplib.SMTP(context['conf']['smtp.server']) #smtp_server.set_debuglevel(1) smtp_server.sendmail(listaddress, context['recipients'], |