Confused with cli option -f
Esther Carillo
ecarillo1000 at gmail.com
Fri Jul 4 10:37:22 BST 2014
Hello group,
I'm new to the command line and tools like offlineimap. I am using it to
sync multiple accounts from cron. I would like it to only sync Inbox(es)
every 10mins and a full sync (sent, draft, trash, etc.) every hour.
The two commands I have are:
offlineimap -o -u quiet
offlineimap -o -f mygmail,myyahoo -u quiet
>From my .offlineimaprc:
[general]
accounts = mygmail,myyahoo
maxsyncaccounts = 20
ui = ttyui
pythonfile=/home/john/bin/offlineimap-helpers.py
socktimeout = 120
[Account mygmail]
localrepository = mygmail_local
remoterepository = mygmail_remote
autorefresh = 4
quick=2
[Account myyahoo]
localrepository = myyahoo_local
remoterepository = myyahoo_remote
autorefresh = 4
quick=2
[Repository mygmail_local]
type = Maildir
localfolders = /home/john/Mail/mygmail
nametrans = localtransfolder_mygmail
[Repository myyahoo_local]
type = Maildir
localfolders = /home/john/Mail/myyahoo
nametrans = localtransfolder_myyahoo
[Repository mygmail_remote]
type = IMAP
remotehost = imap.googlemail.com
remoteuser = mygmail at gmail.com
remotepass = password
nametrans = oimaptransfolder_mygmail
ssl = yes
[Repository myyahoo_remote]
type = IMAP
remotehost = imap.mail.yahoo.com
remoteuser = myyahoo at yahoo.com
remotepass = password
nametrans = oimaptransfolder_myyahoo
My pythonfile does this, I copied most of this from an online guide so
not sure what it all does:
def oimaptransfolder_mygmail(foldername):
if(foldername == "INBOX"):
retval = "mygmail"
else:
retval = "mygmail." + foldername
retval = re.sub("/", ".", retval)
return retval
def localtransfolder_mygmail(foldername):
if(foldername == "mygmail"):
retval = "INBOX"
else:
# remove leading 'acc1.'
retval = re.sub("mygmail\.", "", foldername)
retval = re.sub("\.", "/", retval)
return retval
def oimaptransfolder_myyahoo(foldername):
if(foldername == "INBOX"):
retval = "myyahoo"
else:
retval = "myyahoo." + foldername
retval = re.sub("/", ".", retval)
return retval
def localtransfolder_myyahoo(foldername):
if(foldername == "myyahoo"):
retval = "INBOX"
else:
# remove leading 'acc1.'
retval = re.sub("myyahoo\.", "", foldername)
retval = re.sub("\.", "/", retval)
return retval
>From the documentation for -f option it says:
Only sync the specified folders. The foldernames are the untranslated
foldernames. This command-line option overrides any folderfilter and
folderincludes options in the configuration file.
But I don't know what 'untranslated foldernames' are, the combinations I
have used all don't seem to sync only the Inbox and only the account I
want. Say I try to sync only gmail I try:
offlineimap -o -f mygmail
But the output still seems to suggest both are sync'd:
OfflineIMAP 6.3.4
Copyright 2002-2011 John Goerzen & contributors.
Licensed under the GNU GPL v2+ (v2 or any later version).
Account sync myyahoo:
***** Processing account myyahoo
Copying folder structure from IMAP to Maildir
Establishing connection to imap.mail.yahoo.com:993.
Account sync mygmail:
***** Processing account mygmail
Copying folder structure from IMAP to Maildir
Establishing connection to imap.googlemail.com:993.
Account sync myyahoo:
***** Finished processing account myyahoo
Account sync mygmail:
***** Finished processing account mygmail
Apologies for the long post, I wanted to make sure you have everything
required to help me out.
Esther.
More information about the OfflineIMAP-project
mailing list