#mbsync

2025-06-13

New post on how to filter out email using GNU Mailutils sieve command. It's great for organising email so that you can focus on the important ones!

Sieve's actually a standard. I thought you had to run a full Dovecot IMAP server to use it - overkill for filtering email! Turns out that Mailutils has a command line Sieve that can run after mbsync!

futurile.net/2025/06/07/neomut

Also, a detailed page on Sieve:

futurile.net/resources/mailuti

@riff Le pire, c'est que je fetche déjà automatiquement les mails de toutes mois plusieurs fois par jours avec #mbsync, à des fins de sauvegarde.

Mais c'est que le quart du boulot, quoi.

2025-04-13

I wrote a new blog post about how to setup #neomutt #email with Office 365, using #mbsync #msmtp and #notmuch, along with how to make it work with multiple accounts:

cosroe.com/2025/04/neomutt-not

A small white on black caricature of a dog house, with a book and postal bag in front. A leash is seen leading out of the entrance, with the empty collar on the floor. Some paw tracks of a small dog can be seen suggesting the dog has left the house.
2025-03-09

Decided to take the plunge today and finally set up @nixos_org secrets management with #sopsnix, so that I could set up declarative email, calendars, and contacts in #nix home manager using #vdirsyncer, #khal, #khard, #mbsync, #notmuch, and #aerc. The documentation still isn't good enough, so I had to dive into the source nix files for the various home-manager options, but it wasn't too bad, and it was fun!

codeberg.org/jevans/nix-config

2025-02-11

@florine I just created a free trial account, and don't have much to add apart from that receiving mail works just fine, and I was able to get IMAP access to it setup and working with #mbsync and #notmuch without any trouble at all. As others have said, can't test sending mail from it as trial only allows you to send to mailbox.org accounts. I doubt that'll be an issue though.

Will explore Android clients tomorrow...

#degoogle

Yann Büchau :nixos:nobodyinperson@fosstodon.org
2025-01-12

For quite some time I have sporadically run #mbsync configured to pull several IMAP accounts and it indeed brings in emails. BUT:

- #maildir format is weird. What's with the cur/new/tmp structure?
- why the heck is the hostname in the filenames?
- Feels like it doesn't like to be migrated and be continued from somewhere else.
- two-way sync seems to be kinda broken (not needed anyway)
- Holy cow is the configuration unnecessarily verbose and complicated 🤯 (should be well #nix-able though)

2024-11-07
mbsync works perfectly now in #edora 41 fresh install (tested with asahi linux). gr8

#fedora #asahi #mbsync

@parleur c'est quoi #mbsync ?

Bon, et c'est parti pour une reconfiguration de #mbsync pour une bonne douzaine de boîtes mail, parce-que c'est quand-même top au moins pour l'archivage.

2024-08-05

I started my own fork of #isync (or #mbsync)

https://codeberg.org/jarkko/isync

It has now couple of commits:

❯ git log --oneline -2
8ea62c9 (HEAD -> main, origin/main) fix: compile with -fno-lto
f5782aa refactor: open code FORCEASYNC far and near parameters

The first is the fix for crash in #Fedora. The second open codes FORCEASYNC:

diff --git a/src/common.h b/src/common.h
index 940e74d..22bd827 100644
--- a/src/common.hb
+++ b/src/common.h
@@ -120,7 +120,8 @@ BIT_ENUM(
        ZERODELAY,
        KEEPJOURNAL,
        FORCEJOURNAL,
-       FORCEASYNC(2),
+       FORCEASYNC_F,
+       FORCEASYNC_N,
        FAKEEXPUNGE,
        FAKEDUMBSTORE,
 )

I plan to do this for all of those, as it allows to cut some slack out from bit_enum_get.pl. That will lead to a roadmap where eventually the whole ugly script can be rendered out replaced with BIT_UL macro from kernel (msync is GPL 2.0 licensed).

There is also a #zig branch but before build can be defined properly the C codebase first needs to be made sound in terms of the build. Then it is relatively easy task to repeal and replace main.c with main.zig.

#email

2024-08-01

Here’s my #mbsync #GCC workaround for #Fedora:

commit ebf6bcea7ebdba15553692777d292e59ec1d5e2e (HEAD -> master)
Author: Jarkko Sakkinen <jarkko@kernel.org>
Date:   Thu Aug 1 21:36:37 2024 +0300

    work around a GCC-14 optimizer issue
    
    mbsync throws SIGSEGV in sync_opened(). As it turns out for some
    reason the second entry in the local array 'boxes' is optimized
    out:
    
    (gdb) print boxes
    $1 = {0x5555556c4540, <optimized out>}
    
    Fix this by pinning the variable using a dummy inline assembly
    statement:
    
    __asm__ __volatile__("" :: "m" (boxes));
    
    This sets an invariant, which should guarantee that the compiler
    leaves 'boxes' untouched.
    
    As a comparative measure mbsync was compiled also with clang without the
    fix, and the resulting ELF binary does not have this issue.
    
    Closes: https://bugzilla.redhat.com/show_bug.cgi?id=2302132
    Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>

diff --git a/src/main_sync.c b/src/main_sync.c
index 226e324..afb23ca 100644
--- a/src/main_sync.c
+++ b/src/main_sync.c
@@ -623,6 +623,7 @@ sync_opened( main_vars_t *mvars, int t )
        if (!mvars->chanptr->boxlist && mvars->chan->patterns) {
                mvars->chanptr->boxlist = 2;
                char **boxes[2];
+               __asm__ __volatile__("" :: "m" (boxes));
                boxes[F] = filter_boxes( mvars->boxes[F], mvars->chan->boxes[F], mvars->chan->patterns );
                boxes[N] = filter_boxes( mvars->boxes[N], mvars->chan->boxes[N], mvars->chan->patterns );
                box_ent_t **mboxapp = &mvars->chanptr->boxes;

Also attached to https://bugzilla.redhat.com/show_bug.cgi?id=2302132

2024-08-01
(gdb) print boxes
$1 = {0x5555556c4540, <optimized out>}

I noticed this so I tried:

diff --git a/src/main_sync.c b/src/main_sync.c
index 226e324..afb23ca 100644
--- a/src/main_sync.c
+++ b/src/main_sync.c
@@ -623,6 +623,7 @@ sync_opened( main_vars_t *mvars, int t )
if (!mvars->chanptr->boxlist && mvars->chan->patterns) {
mvars->chanptr->boxlist = 2;
char **boxes[2];
+ __asm__ __volatile__("" :: "m" (boxes));
boxes[F] = filter_boxes( mvars->boxes[F], mvars->chan->boxes[F], mvars->chan->patterns );
boxes[N] = filter_boxes( mvars->boxes[N], mvars->chan->boxes[N], mvars->chan->patterns );
box_ent_t **mboxapp = &mvars->chanptr->boxes;

That literally fixed the bug! I.e. could this be a #GCC bug?

RT @gromit, @adamw

#mbsync #gcc #fedora #bug #isync
2024-08-01
When using #m2sync, compared to #mbsync, you need to use "maildirpp:" instead of maildir "maildir:".

Just though to mention since I was puzzling around this for few hours, and wondering why #notmuch finds everything, and aerc finds nothing.

EDIT: Had some issues with this but it seems interesting and relevant so I keep tracking this project. Now I at least got the mbsync bug fixed in Fedora.
2024-08-01

I found a modern actively updated alternative for #isync (or #mbsync): #m2sync

It is part of #vomit project: https://sr.ht/~bitfehler/vomit/

Compared to the complexity of ~/.mbsyncrc, my config is now dead simple:

cat .config/vomit/config.toml 
[kapsi]
local = "~/.cache/mail/kapsi"
remote = "mail.kapsi.fi:993"
user = "jjs"
pass-cmd = "pass show imap/mail.kapsi.fi"

I love vomit!

2024-08-01
I realized that despite #mbsync crashing in #Fedora I could use #rsync as a backup because I have also SSH shell to my Maildir.

So I give a shot for that, i.e. ssh+rsync, but over longer period of time, I still would prefer to use mbsync. Anyway, it is a workaround.
2024-07-31
#mbsync always crashes here in #Fedora (even when compiled from upstream):

Program terminated with signal SIGSEGV, Segmentation fault.
#0 0x000055d33068a967 in sync_chans (mvars=0x7ffef80ee330, ent=<optimized out>) at /usr/src/debug/isync-1.4.4-8.fc40.x86_64/src/main.c:906
906 char *sname = boxes[N] ? boxes[N][sb] : NULL;

Any ideas? I used coredumpctl to discover this location but for comparative testing I also compiled the latest upstream of mbsync, and it crashes in the exact same location.

#isync
2024-07-28

#homelab What didn't go as well:
- Needed flatpaks & appimages for more recent versions than in #leap but I'll live. I'm not ready for #tumbleweed for a daily driver.
- Using the Vorta GUI for Borg backup under sudo. Kludged it with waypipe.
- offlineimap (python2). There's a Py3 version but it was a no go even trying to use the git repo. Switched to #mbsync.
- Fighting the firewall. Default on. Pulled my hair out for a while with mDNS etc.
- atuin uses sqlite3 which behaves badly on ZFS.

2024-05-27

Spass: #mbsync synct alle Mailboxen. Beim nächsten Aufruf beschwert es sich. dasdie Foldertiefe zu hoch ist (vuiele Folder in der Hiearchie).... und will nimmer ;)

2024-04-20

After a lot of other stuff I’m back at it. TIL that php ENUMS are kind of hard to do assertions on in PHPUnit. assertSame and assertEquals both don’t work.

What I can do though is this:

$this->assertSame(SyncStatus::Pending->value, $syncStatusAfter->value);

#buildinpublic #mbsync

2024-04-20

After a lot of other stuff I’m back at it. TIL that php ENUMS are kind of hard to do assertions on in PHPUnit. assertSame and assertEquals both don’t work.

What I can do though is this:
$this->assertSame(SyncStatus::Pending->value, $syncStatusAfter->value);
#buildinpublic #mbsync

Client Info

Server: https://mastodon.social
Version: 2025.04
Repository: https://github.com/cyevgeniy/lmst