Index: trunk/wmfmailadmin/mbcleanup.py |
— | — | @@ -27,9 +27,10 @@ |
28 | 28 | mailboxes = set() |
29 | 29 | for domain in os.listdir(mbroot): |
30 | 30 | domaindir = os.path.join(mbroot, domain) |
31 | | - if os.path.isdir(domaindir): |
| 31 | + if not domain.startswith('.') and os.path.isdir(domaindir): |
32 | 32 | for localpart in os.listdir(domaindir): |
33 | | - if os.path.isdir(os.path.join(domaindir, localpart)): |
| 33 | + if not localpart.startswith('.') and not localpart.find('@') and \ |
| 34 | + os.path.isdir(os.path.join(domaindir, localpart)): |
34 | 35 | mailboxes.add((unicode(domain), unicode(localpart))) |
35 | 36 | |
36 | 37 | return mailboxes |
— | — | @@ -42,7 +43,7 @@ |
43 | 44 | for mb in mailboxes: |
44 | 45 | date = time.strftime('%Y%m%d%H%M') |
45 | 46 | oldpath = os.path.join(mbroot, mb[0], mb[1]) |
46 | | - newpath = os.path.join(mbbackuproot, mb[0], mb[1]) + '.' + date |
| 47 | + newpath = os.path.join(mbbackuproot, mb[0], mb[1]) + '@' + date |
47 | 48 | print 'Moving', oldpath, '=>', newpath |
48 | 49 | os.makedirs(newpath) |
49 | 50 | os.rename(oldpath, newpath) |