Skip to content

Commit b402bae

Browse files
author
Richard Jones
committed
fixes
1 parent 0a461d5 commit b402bae

File tree

2 files changed

+15
-16
lines changed

2 files changed

+15
-16
lines changed

roundup/mailer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""Sending Roundup-specific mail over SMTP.
22
"""
33
__docformat__ = 'restructuredtext'
4-
# $Id: mailer.py,v 1.11 2006-01-13 02:38:45 richard Exp $
4+
# $Id: mailer.py,v 1.12 2006-01-20 03:04:14 richard Exp $
55

66
import time, quopri, os, socket, smtplib, re
77

@@ -60,7 +60,7 @@ def get_standard_message(self, to, subject, author=None):
6060
writer.addheader('Subject', encode_header(subject, charset))
6161
writer.addheader('To', ', '.join(to))
6262
writer.addheader('From', author)
63-
writer.addheader('Date', formatdate(time.gmtime()))
63+
writer.addheader('Date', formatdate(time.mktime(time.gmtime())))
6464

6565
# Add a unique Roundup header to help filtering
6666
writer.addheader('X-Roundup-Name', encode_header(tracker_name,

roundup/mailgw.py

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ class node. Any parts of other types are each stored in separate files
7272
an exception, the original message is bounced back to the sender with the
7373
explanatory message given in the exception.
7474
75-
$Id: mailgw.py,v 1.169 2006-01-13 03:56:36 richard Exp $
75+
$Id: mailgw.py,v 1.170 2006-01-20 03:04:14 richard Exp $
7676
"""
7777
__docformat__ = 'restructuredtext'
7878

@@ -603,19 +603,6 @@ def handle_message(self, message):
603603
if not from_list:
604604
from_list = message.getaddrlist('from')
605605

606-
# check for registration OTK
607-
# or fallback on the default class
608-
if self.db.config['EMAIL_REGISTRATION_CONFIRMATION']:
609-
otk_re = re.compile('-- key (?P<otk>[a-zA-Z0-9]{32})')
610-
otk = otk_re.search(m.group('title'))
611-
if otk:
612-
self.db.confirm_registration(otk.group('otk'))
613-
subject = 'Your registration to %s is complete' % \
614-
config['TRACKER_NAME']
615-
sendto = [from_list[0][1]]
616-
self.mailer.standard_message(sendto, subject, '')
617-
return
618-
619606
# XXX Don't enable. This doesn't work yet.
620607
# "[^A-z.]tracker\+(?P<classname>[^\d\s]+)(?P<nodeid>\d+)\@some.dom.ain[^A-z.]"
621608
# handle delivery to addresses like:[email protected]
@@ -656,6 +643,18 @@ def handle_message(self, message):
656643
# check for well-formed subject line
657644
m = subject_re.match(subject)
658645
if m:
646+
# check for registration OTK
647+
# or fallback on the default class
648+
if self.db.config['EMAIL_REGISTRATION_CONFIRMATION']:
649+
otk_re = re.compile('-- key (?P<otk>[a-zA-Z0-9]{32})')
650+
otk = otk_re.search(m.group('title'))
651+
if otk:
652+
self.db.confirm_registration(otk.group('otk'))
653+
subject = 'Your registration to %s is complete' % \
654+
config['TRACKER_NAME']
655+
sendto = [from_list[0][1]]
656+
self.mailer.standard_message(sendto, subject, '')
657+
return
659658
# get the classname
660659
if pfxmode == 'none':
661660
classname = None

0 commit comments

Comments
 (0)