prepare for new laptop
[dotfiles.git] / email / .config / offlineimap / offlineimap.py
1 import subprocess
2 import datetime
3 import re
4
5
6 def mailpasswdnet():
7 return subprocess.check_output('pass mail/mart@martlubbers.net',
8 shell='/bin/bash').strip()
9 def mailpasswdru():
10 return subprocess.check_output('pass science.ru.nl/mlubbers',
11 shell='/bin/bash').strip()
12
13 def folderfilter(x):
14 match = re.match('archive\.(\d\d\d\d).(\d\d)', x)
15 if match:
16 return abs(datetime.date.today() -
17 datetime.date(int(match.group(1)), int(match.group(2)), 1)
18 ).days <= 31*6
19 else:
20 return not x.startswith('archive') and not (x == "INBOX.Junk")