aboutsummaryrefslogtreecommitdiff
path: root/main.py
diff options
context:
space:
mode:
authorTom <tom@ritter.vg>2016-09-14 11:59:16 -0500
committerTom <tom@ritter.vg>2016-09-14 11:59:16 -0500
commit4426633a8120926f05ee8818c22d962f76f99a69 (patch)
treea442c837ad2689ef1e53f9bffc23095256704fb0 /main.py
parent407bcc112e1a0eabe8c35076210519eed9607804 (diff)
Add a new nomail commandline option for debugging
Diffstat (limited to 'main.py')
-rwxr-xr-xmain.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/main.py b/main.py
index aee4264..30c285f 100755
--- a/main.py
+++ b/main.py
@@ -24,6 +24,7 @@ if __name__ == "__main__":
parser.add_argument('-m', '--mode', choices=['daemon', 'cron'], required=True, help='The mode the application will run it.')
parser.add_argument('-c', '--crontime', choices=['minute', 'hour', 'day', 'day_noon'], help='When in cron mode, the increment of cron.')
parser.add_argument('-v', action="store_true", help="Print verbose debugging information to stderr")
+ parser.add_argument('--nomail', action="store_true", help="Do everything except sending email")
args = parser.parse_args()
@@ -32,11 +33,15 @@ if __name__ == "__main__":
if args.v:
print "[Pre-Logging] Reading config from", configfile
config.read(configfile)
- if not config.get('email', 'user') or \
+ if args.nomail:
+ config.set('email', 'nomail', "True")
+
+ if not config.getboolean('email', 'nomail') and (\
+ not config.get('email', 'user') or \
not config.get('email', 'pass') or \
not config.get('email', 'smtpserver') or \
not config.get('email', 'smtpport') or \
- not config.get('email', 'imapserver'):
+ not config.get('email', 'imapserver')):
print "Sending email address is not configured"
sys.exit(1)
if not config.get('general', 'servername') or \