[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[minion-cvs] Force server-contact to be an email address
Update of /home/minion/cvsroot/src/minion/lib/mixminion
In directory moria.mit.edu:/tmp/cvs-serv31562/lib/mixminion
Modified Files:
Config.py
Log Message:
Force server-contact to be an email address
Index: Config.py
===================================================================
RCS file: /home/minion/cvsroot/src/minion/lib/mixminion/Config.py,v
retrieving revision 1.75
retrieving revision 1.76
diff -u -d -r1.75 -r1.76
--- Config.py 8 Jan 2004 23:07:31 -0000 1.75
+++ Config.py 27 Jan 2004 05:30:23 -0000 1.76
@@ -303,6 +303,12 @@
def _parseAddressSet_deny(s):
return _parseAddressSet_allow(s,0)
+def _parseEmail(s):
+ s = s.strip()
+ if not mixminion.Common.isSMTPMailbox(s):
+ raise ConfigError("%r is not a valid email address."%s)
+ return s
+
def _parseCommand(command):
"""Validation function. Converts a config value to a shell command of
the form (fname, optionslist). Raises ConfigError on failure."""
@@ -717,6 +723,7 @@
"nickname" : (_parseNickname, str),
"filename" : (_parseFilename, str),
"user" : (_parseUser, str),
+ "email" : (_parseEmail, str),
}
_syntax = None