forked from jasongraham/mail_conf_example
-
Notifications
You must be signed in to change notification settings - Fork 0
/
offlineimaprc
97 lines (79 loc) · 3.11 KB
/
offlineimaprc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
[general]
# General information. See the fully annotated example more information
# https://github.com/jgoerzen/offlineimap/blob/master/offlineimap.conf
metadata = ~/.offlineimap
accounts = school, gmail
maxsyncaccounts = 2
socktimeout = 60
ui = Basic
# This helper file lets you use gnome-keyring to store usernames / passwords
pythonfile = ~/.mail_config/lib/offlineimap-helper.py
[mbnames]
# Create a list of available mailboxes for mutt
enabled = yes
filename = ~/.mail_config/mutt/muttmailboxes
header = "mailboxes "
# Exclude these mailboxes from the above mailbox list
folderfilter = lambda accountname, foldername: not re.search('(^bak.*|.*drafts$|.*spam$|.*sent$|.*trash$)', foldername)
peritem = "+%(accountname)s/%(foldername)s"
sep = " "
footer = "\n"
[Account school]
localrepository = local-school
remoterepository = remote-school
# Call imapfilter before syncing
presynchook = /usr/bin/imapfilter -vc ~/.mail_config/imapfilter/school.lua
[Account gmail]
localrepository = local-gmail
remoterepository = remote-gmail
[Repository local-school]
type = Maildir
localfolders = ~/.mail/school
# Translate names from local names to remote names:
# This one does:
# 1. Capitalizes all the folder names
# 2. Changes any underscores to spaces
# 3. Changes Inbox -> INBOX
nametrans = lambda foldername: re.sub('Inbox', 'INBOX',
re.sub ('_', ' ', foldername.capitalize()))
[Repository remote-school]
type = IMAP
maxconnections = 2
remotehost = mail.school.edu
remoteusereval = get_username("mail.school.edu")
remotepasseval = get_password("mail.school.edu")
# If using ssl, you will need to specify certificates to use with them
ssl = yes
sslcacertfile = /path/to/cacertfile.crt
realdelete = yes
# Translate remote names to local names:
# This one does:
# 1. Transforms names to lowercase
# 2. Replaces spaces with underscores
nametrans = lambda foldername: re.sub (' ', '_', foldername.lower())
[Repository local-gmail]
type = Maildir
localfolders = ~/.mail/gmail
# Note the nametrans below in remote-gmail: it undoes this one
nametrans = lambda foldername: re.sub ('Inbox', 'INBOX',
re.sub ('Drafts', '[Gmail].Drafts',
re.sub ('Sent', '[Gmail].Sent Mail',
re.sub ('Flagged', 'Starred',
re.sub ('_', ' ', foldername.capitalize())))))
[Repository remote-gmail]
type = Gmail
maxconnections = 2
remotehost = imap.gmail.com
remoteusereval = get_username("imap.gmail.com")
remotepasseval = get_password("imap.gmail.com")
# If using ssl, you will need to specify certificates to use with them
ssl = yes
sslcacertfile = /path/to/cacertfile.crt
realdelete = no
# Note the nametrans above in local-gmail: it undoes this one
nametrans = lambda foldername: re.sub ('^\[gmail\]\/', '',
re.sub ('sent_mail', 'sent',
re.sub ('starred', 'flagged',
re.sub (' ', '_', foldername.lower()))))
# We don't want to sync all mail, it would pull everything again
folderfilter = lambda foldername: foldername not in ['[Gmail]/All Mail']