README.md: Renaming file so that github renders it nicely.
This commit is contained in:
parent
a73b4b3465
commit
84857f9430
@ -1,5 +1,5 @@
|
|||||||
OfflineImap README
|
OfflineImap
|
||||||
==================
|
===========
|
||||||
|
|
||||||
Description
|
Description
|
||||||
-----------
|
-----------
|
||||||
@ -26,7 +26,7 @@ Documentation
|
|||||||
|
|
||||||
The documentation is included (in .rst format) in the `docs` directory.
|
The documentation is included (in .rst format) in the `docs` directory.
|
||||||
Read it directly or generate nice html docs (python-sphinx needed) and/or
|
Read it directly or generate nice html docs (python-sphinx needed) and/or
|
||||||
the man page (python-docutils needed) while being in the `docs` dir via::
|
the man page (python-docutils needed) while being in the `docs` dir via:
|
||||||
|
|
||||||
'make doc' (user docs), 'make man' (man page only) or 'make' (both)
|
'make doc' (user docs), 'make man' (man page only) or 'make' (both)
|
||||||
|
|
||||||
@ -50,23 +50,23 @@ provides you with the bare minimum of setting up OfflineIMAP. You can
|
|||||||
simply copy this file into your home directory and name it
|
simply copy this file into your home directory and name it
|
||||||
``.offlineimaprc``. A command such as ``cp offlineimap.conf.minimal
|
``.offlineimaprc``. A command such as ``cp offlineimap.conf.minimal
|
||||||
~/.offlineimaprc`` will do it. Or, if you prefer, you can just copy
|
~/.offlineimaprc`` will do it. Or, if you prefer, you can just copy
|
||||||
this text to ``~/.offlineimaprc``::
|
this text to ``~/.offlineimaprc``:
|
||||||
|
|
||||||
[general]
|
[general]
|
||||||
accounts = Test
|
accounts = Test
|
||||||
|
|
||||||
[Account Test]
|
[Account Test]
|
||||||
localrepository = Local
|
localrepository = Local
|
||||||
remoterepository = Remote
|
remoterepository = Remote
|
||||||
|
|
||||||
[Repository Local]
|
[Repository Local]
|
||||||
type = Maildir
|
type = Maildir
|
||||||
localfolders = ~/Test
|
localfolders = ~/Test
|
||||||
|
|
||||||
[Repository Remote]
|
[Repository Remote]
|
||||||
type = IMAP
|
type = IMAP
|
||||||
remotehost = examplehost
|
remotehost = examplehost
|
||||||
remoteuser = jgoerzen
|
remoteuser = jgoerzen
|
||||||
|
|
||||||
|
|
||||||
Now, edit the ``~/.offlineimaprc`` file with your favorite editor. All you have
|
Now, edit the ``~/.offlineimaprc`` file with your favorite editor. All you have
|
||||||
@ -111,28 +111,28 @@ This example shows you how to set up OfflineIMAP to synchronize multiple
|
|||||||
accounts with the mutt mail reader.
|
accounts with the mutt mail reader.
|
||||||
|
|
||||||
Start by creating a directory to hold your folders by running ``mkdir ~/Mail``.
|
Start by creating a directory to hold your folders by running ``mkdir ~/Mail``.
|
||||||
Then, in your ``~/.offlineimaprc``, specify::
|
Then, in your ``~/.offlineimaprc``, specify:
|
||||||
|
|
||||||
accounts = Personal, Work
|
accounts = Personal, Work
|
||||||
|
|
||||||
|
|
||||||
Make sure that you have both an [Account Personal] and an [Account Work]
|
Make sure that you have both an [Account Personal] and an [Account Work]
|
||||||
section. The local repository for each account must have different localfolder
|
section. The local repository for each account must have different localfolder
|
||||||
path names. Also, make sure to enable [mbnames].
|
path names. Also, make sure to enable [mbnames].
|
||||||
|
|
||||||
In each local repository section, write something like this::
|
In each local repository section, write something like this:
|
||||||
|
|
||||||
localfolders = ~/Mail/Personal
|
localfolders = ~/Mail/Personal
|
||||||
|
|
||||||
|
|
||||||
Finally, add these lines to your ``~/.muttrc``::
|
Finally, add these lines to your ``~/.muttrc``:
|
||||||
|
|
||||||
source ~/path-to-mbnames-muttrc-mailboxes
|
source ~/path-to-mbnames-muttrc-mailboxes
|
||||||
folder-hook Personal set from="youremail@personal.com"
|
folder-hook Personal set from="youremail@personal.com"
|
||||||
folder-hook Work set from="youremail@work.com"
|
folder-hook Work set from="youremail@work.com"
|
||||||
set mbox_type=Maildir
|
set mbox_type=Maildir
|
||||||
set folder=$HOME/Mail
|
set folder=$HOME/Mail
|
||||||
spoolfile=+Personal/INBOX
|
spoolfile=+Personal/INBOX
|
||||||
|
|
||||||
|
|
||||||
That's it!
|
That's it!
|
||||||
@ -146,34 +146,34 @@ to get at their mailboxes, specifying a reference of ``~/Mail`` or ``#mh/``
|
|||||||
depending on the configuration. The below configuration from (originally from
|
depending on the configuration. The below configuration from (originally from
|
||||||
docwhat@gerf.org) shows using a reference of Mail, a nametrans that strips the
|
docwhat@gerf.org) shows using a reference of Mail, a nametrans that strips the
|
||||||
leading Mail/ off incoming folder names, and a folderfilter that limits the
|
leading Mail/ off incoming folder names, and a folderfilter that limits the
|
||||||
folders synced to just three::
|
folders synced to just three:
|
||||||
|
|
||||||
[Account Gerf]
|
[Account Gerf]
|
||||||
localrepository = GerfLocal
|
localrepository = GerfLocal
|
||||||
remoterepository = GerfRemote
|
remoterepository = GerfRemote
|
||||||
|
|
||||||
[Repository GerfLocal]
|
[Repository GerfLocal]
|
||||||
type = Maildir
|
type = Maildir
|
||||||
localfolders = ~/Mail
|
localfolders = ~/Mail
|
||||||
|
|
||||||
[Repository GerfRemote]
|
[Repository GerfRemote]
|
||||||
type = IMAP
|
type = IMAP
|
||||||
remotehost = gerf.org
|
remotehost = gerf.org
|
||||||
ssl = yes
|
ssl = yes
|
||||||
remoteuser = docwhat
|
remoteuser = docwhat
|
||||||
reference = Mail
|
reference = Mail
|
||||||
# Trims off the preceeding Mail on all the folder names.
|
# Trims off the preceeding Mail on all the folder names.
|
||||||
nametrans = lambda foldername: \
|
nametrans = lambda foldername: \
|
||||||
re.sub('^Mail/', '', foldername)
|
re.sub('^Mail/', '', foldername)
|
||||||
# Yeah, you have to mention the Mail dir, even though it
|
# Yeah, you have to mention the Mail dir, even though it
|
||||||
# would seem intuitive that reference would trim it.
|
# would seem intuitive that reference would trim it.
|
||||||
folderfilter = lambda foldername: foldername in [
|
folderfilter = lambda foldername: foldername in [
|
||||||
'Mail/INBOX',
|
'Mail/INBOX',
|
||||||
'Mail/list/zaurus-general',
|
'Mail/list/zaurus-general',
|
||||||
'Mail/list/zaurus-dev',
|
'Mail/list/zaurus-dev',
|
||||||
]
|
]
|
||||||
maxconnections = 1
|
maxconnections = 1
|
||||||
holdconnectionopen = no
|
holdconnectionopen = no
|
||||||
|
|
||||||
|
|
||||||
pythonfile Configuration File Option
|
pythonfile Configuration File Option
|
||||||
@ -184,34 +184,34 @@ configuration file options that are Python expressions. This example is based
|
|||||||
on one supplied by Tommi Virtanen for this feature.
|
on one supplied by Tommi Virtanen for this feature.
|
||||||
|
|
||||||
|
|
||||||
In ~/.offlineimaprc, he adds these options::
|
In ~/.offlineimaprc, he adds these options:
|
||||||
|
|
||||||
[general]
|
[general]
|
||||||
pythonfile=~/.offlineimap.py
|
pythonfile=~/.offlineimap.py
|
||||||
[Repository foo]
|
[Repository foo]
|
||||||
foldersort=mycmp
|
foldersort=mycmp
|
||||||
|
|
||||||
Then, the ~/.offlineimap.py file will contain::
|
Then, the ~/.offlineimap.py file will contain:
|
||||||
|
|
||||||
prioritized = ['INBOX', 'personal', 'announce', 'list']
|
prioritized = ['INBOX', 'personal', 'announce', 'list']
|
||||||
|
|
||||||
def mycmp(x, y):
|
def mycmp(x, y):
|
||||||
for prefix in prioritized:
|
for prefix in prioritized:
|
||||||
xsw = x.startswith(prefix)
|
xsw = x.startswith(prefix)
|
||||||
ysw = y.startswith(prefix)
|
ysw = y.startswith(prefix)
|
||||||
if xsw and ysw:
|
if xsw and ysw:
|
||||||
|
return cmp(x, y)
|
||||||
|
elif xsw:
|
||||||
|
return -1
|
||||||
|
elif ysw:
|
||||||
|
return +1
|
||||||
return cmp(x, y)
|
return cmp(x, y)
|
||||||
elif xsw:
|
|
||||||
return -1
|
|
||||||
elif ysw:
|
|
||||||
return +1
|
|
||||||
return cmp(x, y)
|
|
||||||
|
|
||||||
def test_mycmp():
|
def test_mycmp():
|
||||||
import os, os.path
|
import os, os.path
|
||||||
folders=os.listdir(os.path.expanduser('~/data/mail/tv@hq.yok.utu.fi'))
|
folders=os.listdir(os.path.expanduser('~/data/mail/tv@hq.yok.utu.fi'))
|
||||||
folders.sort(mycmp)
|
folders.sort(mycmp)
|
||||||
print folders
|
print folders
|
||||||
|
|
||||||
|
|
||||||
This code snippet illustrates how the foldersort option can be customized with a
|
This code snippet illustrates how the foldersort option can be customized with a
|
Loading…
Reference in New Issue
Block a user