Index: trunk/wmfmailadmin/wmfmailadmin.py |
— | — | @@ -7,7 +7,7 @@ |
8 | 8 | |
9 | 9 | import sys, os, sqlite3 |
10 | 10 | |
11 | | -dbname = '/var/vmail/user.db' |
| 11 | +dbname = '/var/vmaildb/user.db' |
12 | 12 | conn = None |
13 | 13 | |
14 | 14 | actions = { |
— | — | @@ -84,7 +84,7 @@ |
85 | 85 | require_fields( (required_fields, ), fields) |
86 | 86 | |
87 | 87 | # Set default values for fields not given |
88 | | - value_fields = ['localpart', 'domain', 'realname', 'filter'] |
| 88 | + value_fields = ['localpart', 'domain', 'realname', 'password', 'active', 'filter'] |
89 | 89 | for fieldname in updateables: |
90 | 90 | default = longmappings[fieldname][2] |
91 | 91 | if fieldname not in fields: |
— | — | @@ -94,7 +94,7 @@ |
95 | 95 | value_fields.append(fieldname) |
96 | 96 | else: |
97 | 97 | # Field is not given on the command line, and apparently not required |
98 | | - value_fields.remote(fieldname) |
| 98 | + value_fields.remove(fieldname) |
99 | 99 | |
100 | 100 | # Input password if needed |
101 | 101 | input_password(fields) |
— | — | @@ -229,7 +229,7 @@ |
230 | 230 | |
231 | 231 | global max_filter_size |
232 | 232 | |
233 | | - if fields['filter'] == "": return |
| 233 | + if not fields.has_key('filter') or fields['filter'] == "": return |
234 | 234 | |
235 | 235 | if fields['filter'] == '-': |
236 | 236 | filterfile = sys.stdin |
— | — | @@ -389,7 +389,7 @@ |
390 | 390 | elif action == 'show': |
391 | 391 | show_field(fields) |
392 | 392 | except sqlite3.IntegrityError, e: |
393 | | - print >> sys.stderr, "SQL integrity error. Account does already exist? (%s)" % e.message |
| 393 | + print >> sys.stderr, "SQL integrity error. Maybe the account does already exist? (%s)" % e.message |
394 | 394 | sys.exit(2) |
395 | 395 | except Exception, e: |
396 | 396 | print >> sys.stderr, "Error:", e.message |