Linux

Where Is the OfflineIMAP Config File?

OfflineIMAP keeps account config in .offlineimaprc with sync state beside it. Config paths, metadata, and flags.

Last updated

OfflineIMAP syncs IMAP to local Maildirs driven by one config file: ~/.offlineimaprc by default, or $XDG_CONFIG_HOME/offlineimap/config on modern setups. Sync state and SQLite caches live in ~/.offlineimap beside it, and starter templates ship in /usr/share/offlineimap for new setups.

The config uses INI sections per account with local and remote repositories, and comments must sit on their own lines or parsing fails. Passwords belong in GPG-encrypted helpers referenced from the file, never plaintext beside it. The -c flag overrides the config path for multi-account or service setups. Pair it with NeoMutt pointing at the same Maildir tree. Linux-only tooling.

Where OfflineIMAP stores this, by platform

Linux
~/.offlineimaprc

~/.offlineimaprc is the classic path; $XDG_CONFIG_HOME/offlineimap/config is the modern alternate. Sync state and SQLite caches in ~/.offlineimap. Starter templates in /usr/share/offlineimap. Comments need their own lines. Override with -c; limit accounts with -a. Pair with a Maildir reader like NeoMutt.

Frequently asked questions

how do i move offlineimap to a new computer

Copy ~/.offlineimaprc plus the mail store to the new machine. Password helpers referenced by the config (GPG files, keyring scripts) must move too or sync fails on auth. The metadata cache rebuilds itself; the config does not. Keep folderfilter lines intact to preserve selective syncing.

how do i fix offlineimap uid conflicts

The old cache format was retired. Delete the stale Account-*/LocalStatus folders and let the current version rebuild LocalStatus-sqlite on next run. Back up the Maildir first; UID conflicts during migration can duplicate or drop flags. The --dry-run flag previews fixes safely.

can i use a custom offlineimap config file

Pass -c with your chosen file on the command line. Scheduled systemd units and cron jobs commonly use this to separate accounts or test configs. The -a flag further limits a run to named accounts without editing the file. Debug with -d for protocol traces.

Notice an outdated path? Let us know.