Fixing the claws mail attachment queuing problem

Hello all,

Some time ago, claws mail stopped being able to upload large attachments. I traced this issue to a bug in libetpan referenced here: https://github.com/dinhvh/libetpan/issues/468

By rebuilding the libetpan package with this patch https://github.com/dinhvh/libetpan/commit/23fd6ae612fb25a512f8e8379a89dfc228edcb59 I was able to create a replacement libetpan package. Once installed, claws mail picked it up and was able to send large attachments once again. No changes were needed to claws mail.

Hope this helps someone else!
 
Thanks for posting. I came here looking for a solution, (which I assumed was a regression in claws-mail}, as I used an updated clawsmail when I installed 15.1

Can anyone point towards the procedure for applying such a patch for someone which, up till now, has only used packages?
 
Hi -

Sure thing. You will need to be somewhat familiar to FreeBSD administration, and some software development. Mostly you just need to let the tools do the work. Below, for the build step, you may need to install some tools:

pkg install gmake pkgconf autoconf automake libtool libiconv



1. As root, install the ports collection. If your ports collection is up to date, you probably don't need this step.
pkg install git
git clone --depth 1 -b 2026Q4 https://git.freebsd.org/ports.git /usr/ports

2. Download the upstream fix from github
fetch -o /tmp/libetpan-23fd6ae.patch https://github.com/dinhvh/libetpan/commit/23fd6ae.patch

3. Extract the patch. This sed command throws away unneeded patches to the developer test framework, but keeps the essential patches we need.
sed -n \
'/^diff --git a\/src\/data-types\/mailstream.c/,/^diff --git a\/unittest\/Makefile/p' \
/tmp/libetpan-23fd6ae.patch | sed '$d' \
> /tmp/libetpan-mailstream.patch

4. Get ready to patch libetpan. This step applies FreeBSD specific patches
cd /usr/ports/mail/libetpan
make -V PORTVERSION
make BATCH=yes USE_PACKAGE_DEPENDS_ONLY=yes patch

5. Apply the patch to the extracted source
cd "$(make -V WRKSRC)" <--- This step just puts you in the work/libetpan source directory.

patch -p1 --dry-run < /tmp/libetpan-mailstream.patch <--- This step is a dry run for the patch. It should complete successfully.
patch -p1 < /tmp/libetpan-mailstream.patch

6. You can verify that it succeeded:
patch -p1 -R --dry-run < /tmp/libetpan-mailstream.patch <--- All four hunks should succeed.

7. Build using binary package dependencies, then create a package of the newly patched code.
cd /usr/ports/mail/libetpan
make BATCH=yes USE_PACKAGE_DEPENDS_ONLY=yes build
make BATCH=yes USE_PACKAGE_DEPENDS_ONLY=yes package

The resulting package should be in /usr/ports/mail/libetpan/work/pkg/libetpan-1.10.1.pkg

8. Before installing the newly patched package, back up the existing non-patched package
mkdir -p /root/libetpan-backup
pkg create -o /root/libetpan-backup libetpan <--- Verify this package exists


Exit claws-mail before installing the newly patched package.

9. Install the newly patched package
pkg add -f /usr/ports/mail/libetpan/work/pkg/libetpan-1.10.1.pkg

10. Test the fix. Restart claws-mail and send an email with a 5 MB attachment. It should now work correctly.


Let me know if you have trouble.

1. Full disclosure: ChatGPT was helpful in solving this problem.

2. NedLudd on claws IRC pointed me to the patch on github.

Edit: typo
Edit2: credit NedLudd
 
Back
Top