Hi Robin, Nilesh, Aloïs,
I tried to integrate aerc as an option into a new Debian bts(1)
command-line workflow I'm working on.
I could find no direct equivalent for mutt's -H ("edit draft") option which
allows starting a mail composer with email headers and body pre-filled from
a raw email message file.
I experimented with the aerc cmdline a bit but couldn't find a simple way
to bridge the gap without extra logic that doesn't belong in bts(1).
Things I tried:
- aerc mailto:whatever@bugs.debian.org
- Supports a body template, but no custom headers. Needed for X-Debbugs-CC.
- aerc :compose
- Has support for custom headers with -H in theory -- didn't work when
I tried it.
- Passing <body> didn't work for me either.
- Templates with -T looked promising, but those seems to be the wrong
concept. It's expecting something in (eg) ~/.config/aerc/templates,
not an arbitrary tempfile.
In any case looking at what the :compose command can do in principle I
recon a simple script could cover all of what I need -- if only :compose
worked at documented which is a separate issue :-).
Would you be interested in having an "aerc-muttwrapper" script be part of
your aerc package? I can try to develop one.
Thanks,
--Daniel
Hi Robin, all,
Does aerc have any equivalent option of mutt's edit draft as reported in the issue below?
If not -- @Daniel, patches welcome.
Hi Robin, Nilesh, Aloïs,
I tried to integrate aerc as an option into a new Debian bts(1)
command-line workflow I'm working on.
I could find no direct equivalent for mutt's -H ("edit draft") option which
allows starting a mail composer with email headers and body pre-filled from
a raw email message file.
I experimented with the aerc cmdline a bit but couldn't find a simple way
to bridge the gap without extra logic that doesn't belong in bts(1).
Things I tried:
- aerc mailto:whatever@bugs.debian.org
- Supports a body template, but no custom headers. Needed for X-Debbugs-CC.
- aerc :compose
- Has support for custom headers with -H in theory -- didn't work when
I tried it.
- Passing <body> didn't work for me either.
- Templates with -T looked promising, but those seems to be the wrong
concept. It's expecting something in (eg) ~/.config/aerc/templates,
not an arbitrary tempfile.
In any case looking at what the :compose command can do in principle I
recon a simple script could cover all of what I need -- if only :compose
worked at documented which is a separate issue :-).
Would you be interested in having an "aerc-muttwrapper" script be part of
your aerc package? I can try to develop one.
Thanks,
--Daniel
Hi folks, Nilesh Patra, Dec 12, 2025 at 18:33: No but that's an interesting feature. See my comments below. I don't think a wrapper would be a good idea. aerc isn't meant to be a 1:1 replacement for mutt. I would prefer extra work for :compose in order for it to support an extra argument that does what you ask. Basically, it would be an extension of the -T <template> flag but allowing to pass an arbitrary filepath instead of just a template name. We could also extend `aerc mailto:...` to accept extra arguments. It depends on what you expect from aerc exactly. Do you want to start it as part of a script so that it pops an editor open and then allows you to send the message? You can also use the IPC socket to control aerc from another terminal. But you will loose the interactive part. If you describe precisely what is the need, I can implement it. I shouldn't be complicated. Let me know what you think.
Dear all, there is a possible workaround described in that thread: https://lists.sr.ht/~rjarry/aerc-discuss/%3CDC5LD25VN3IK.3UF8IIG4QCXXV@mdosch.de%3E?__goaway_challenge=meta-refresh&__goaway_id=1d341e783e87eb7caa158658f5a83522&__goaway_referer=https%3A%2F%2Flists.sr.ht%2F~rjarry%2Faerc-discuss%3Fpage%3D4 For the time being I just continue to use neomutt for such tasks (and for forwarding emails). Best regards, Martin
Hi Robin, It doesn't have to be TBH. The context I'm using this in (our 'bts' workflow cli tool) just needs away to open MBOXes and compose replies. I've actually decided to move this idea to Debian sensible-utils as "sensible-mua"[1] so this part of the request is moot. [1]: Which was already requested all the way back in 2006 :D https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=353587 Sounds good! hname. BTW: In Debian we have at least one webservice that makes use of this to provide a pre-filled template but I can't find it now. Yup. That's how (neo)mutt behaves. A script starts $mutt -H /tmp/whatever. That opens a composer/editor and allows sending the message. Importantly $mutt blocks until the message is sent. support from within aerc, not another terminal. Both for (templated) message composition and opening MBOXes. The workflow I'm working on goes like this: I run my $MUA to browse Debian Bug emails, then - Inside $MUA I select a $message and :pipe it to our bts(1) program. - bts(1) detects it's running inside $MUA (via arcane unix magic aka. $_) and reads the message from stdin. This tells it which bug I want to work on. - If $MUA = mutt: bts(1) will spawn a nested mutt to (finish) composing the reply template bts(1) generated. (downside of nesting: eg. 'replied' flag doesn't get set) - If $MUA = aerc: we could do better here by asking the enclosing aerc (via IPC) to do the message composition after :pipe returns I would imagine the aerc IPC command would simply create a new message composition tab, but I haven't spend enough time with aerc to know what might be reasonable or expected here. For opening MBOXes at least this already seems to work how I'd expect (though I haven't spent much time exhaustively testing it yet). The relevant code is at https://salsa.debian.org/debian/devscripts/-/blob/main/scripts/bts.pl#L1101 Notice the $aerc_I logic. That would be awesome. I would love to be able to teach new people a less old and cranky MUA :-). The :import-mbox :recall hack looks plausible, I'm not sure it can be made smooth enough for the UX I have in mind tho :-). Would need to experiment more. Thanks for pointing that out Martin!