diff roundup/mailgw.py @ 1792:2cd528577108

mailgw now accepts registration confirmation mail that uses otk For example, the following could be in the subject line: .-- key <32-char otk, such as Aj4euk4LZSAdwePohj90SME5SpopLETL>.
author Johannes Gijsbers <jlgijsbers@users.sourceforge.net>
date Sat, 06 Sep 2003 10:21:18 +0000
parents e5a17d4dd2c2
children dbe541c1aa39
line wrap: on
line diff
--- a/roundup/mailgw.py	Sat Sep 06 09:45:30 2003 +0000
+++ b/roundup/mailgw.py	Sat Sep 06 10:21:18 2003 +0000
@@ -73,7 +73,7 @@
 an exception, the original message is bounced back to the sender with the
 explanatory message given in the exception. 
 
-$Id: mailgw.py,v 1.127 2003-09-05 20:56:39 jlgijsbers Exp $
+$Id: mailgw.py,v 1.128 2003-09-06 10:21:18 jlgijsbers Exp $
 """
 
 import string, re, os, mimetools, cStringIO, smtplib, socket, binascii, quopri
@@ -514,9 +514,15 @@
             # get the classname
             classname = m.group('classname')
             if classname is None:
-                # no classname, fallback on the default
-                if hasattr(self.instance.config, 'MAIL_DEFAULT_CLASS') and \
-                        self.instance.config.MAIL_DEFAULT_CLASS:
+                # no classname, check if this a registration confirmation email
+                # or fallback on the default class
+                otk_re = re.compile('-- key (?P<otk>[a-zA-Z0-9]{32})')
+                otk = otk_re.search(m.group('title')).group('otk')
+                if otk:
+                    self.db.confirm_registration(otk)
+                    return
+                elif hasattr(self.instance.config, 'MAIL_DEFAULT_CLASS') and \
+                         self.instance.config.MAIL_DEFAULT_CLASS:
                     classname = self.instance.config.MAIL_DEFAULT_CLASS
                 else:
                     # fail

Roundup Issue Tracker: http://roundup-tracker.org/