Skip to content

mbsync

Vendor

https://isync.sourceforge.io/mbsync.html https://git.code.sf.net/p/isync/isync

mbsync 1.5.0 - don't have UTF-8 issue !!

Build

apt --no-install-recommends install -y ca-certificates 
debhelper dh-autoreconf libdb-dev libsasl2-dev libssl-dev \
pkg-config zlib1g-dev git autoconf automake libtimedate-perl 

git clone https://git.code.sf.net/p/isync/isync /tmp/isync
cd /tmp/isync 
./autogen.sh 
./configure 
make 
make install 

config file for sync local MailDir to remote IMAP server

#
CopyArrivalDate yes  # Don't mess up message timestamps when moving them between folders.
Sync Pull            # Download changes only, don't sync local changes up to the server.
Create Near          # Automatically create new folders in the local copy.
Remove None         # Automatically remove deleted folders from the local copy.
Expunge None         # Expunge deleted messages from the local copy.

MaildirStore source
  Inbox /data/mail/domain.com/foo.bar/
  SubFolders Maildir++

IMAPAccount target-account
  Host localhost
  Port 143
  User [email protected]
  Pass password
  TLSType None
  AuthMechs PLAIN
  Timeout 10
  PipelineDepth 1

IMAPStore target
  Account target-account

Channel local2imap
  Far :source:
  Near :target:
  CopyArrivalDate yes
  Create Near
  Sync Pull New
  Patterns *
  Remove None
  SyncState ~/.mail/localdir-localimap-foo.bar

Some example: https://gist.github.com/vincentbernat/532ce51f278146a30e11