diff --git a/honeypot/__init__.py b/honeypot/__init__.py index aec6cd8..847e352 100644 --- a/honeypot/__init__.py +++ b/honeypot/__init__.py @@ -98,8 +98,10 @@ def the_view(context, request): name, email = context.get_moin_user() body = [ - 'Someone Wanted Some Sweet Honey', - '-------------------------------', + 'The Honey Pot Was Accessed', + '--------------------------', + '', + 'This might be an attempt to scrape the whole wiki', '', 'wiki user: %s (%s)' % (name, email), '', @@ -114,15 +116,17 @@ def the_view(context, request): headers = [' %s: %s' % (k, v) for k, v in request.headers.items()] body.extend(headers) + body = '\n'.join(body) + message = Message( - subject='[wikis]: HoneyPot Link Was Accessed', - sender=event.request.registry.settings['mail.default_sender'], + subject='[cpi wikis]: HoneyPot Link Was Accessed', + sender=request.registry.settings['mail.default_sender'], recipients=context.admin_emails, body=body ) - request.mailer.send(message) + request.mailer.send_immediately(message) - return Response(body='\n'.join(body), content_type='text/plain') + return Response(body=body, content_type='text/plain') def main(global_config, **settings):