reply -A added, makes sure From: is not in To: v1 PROPOSED

JD: 1
 reply -A added, makes sure From: is not in To:

 2 files changed, 26 insertions(+), 5 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~sircmpwn/aerc/patches/13056/mbox | git am -3
Learn more about email & git
View this thread in the archives

[PATCH] reply -A added, makes sure From: is not in To: Export this patch

When applying reply -a to an email sent from ourselves,
our From: address will also be included in the To: field.
Some people use this (by mailing themselves a copy),
some people don't. This is a patch for those, who
don't: it introduces an additional -A parameter, which
replicates -a but also makes sure our From: address is
not included.

DISCLAIMER: I know nothing about Go, and I'm not even a 
developer / programmer.

 commands/msg/reply.go | 29 ++++++++++++++++++++++++-----
 doc/aerc.1.scd        |  3 +++
 2 files changed, 27 insertions(+), 5 deletions(-)

diff --git a/commands/msg/reply.go b/commands/msg/reply.go
index 3c8016e..c2e1be5 100644
--- a/commands/msg/reply.go
+++ b/commands/msg/reply.go
@@ -4,6 +4,7 @@ import (

@@ -30,22 +31,26 @@ func (reply) Complete(aerc *widgets.Aerc, args []string) []string {

func (reply) Execute(aerc *widgets.Aerc, args []string) error {
	opts, optind, err := getopt.Getopts(args, "aqT:")
	opts, optind, err := getopt.Getopts(args, "aAqT:")
	if err != nil {
		return err
	if optind != len(args) {
		return errors.New("Usage: reply [-aq -T <template>]")
		return errors.New("Usage: reply [-aAq -T <template>]")
	var (
		quote    bool
		replyAll bool
		template string
		quote         bool
		replyAll      bool
		replyAllClean bool
		template      string
	for _, opt := range opts {
		switch opt.Option {
		case 'a':
			replyAll = true
		case 'A':
			replyAll = true
			replyAllClean = true
		case 'q':
			quote = true
		case 'T':
@@ -98,6 +103,7 @@ func (reply) Execute(aerc *widgets.Aerc, args []string) error {

	var (
		to []*models.Address
		tm []*models.Address
		cc []*models.Address

@@ -137,6 +143,19 @@ func (reply) Execute(aerc *widgets.Aerc, args []string) error {

	if replyAllClean {
		// now, if requested, clean to header
		for _, addr := range to {
			// remove from header from to header
			// (with replyAllClean, we do not email ourlseves)
			if reflect.DeepEqual(from, addr) {
			tm = append(tm, addr)
		to = tm

	var subject string
	if !strings.HasPrefix(strings.ToLower(msg.Envelope.Subject), "re: ") {
		subject = "Re: " + msg.Envelope.Subject
diff --git a/doc/aerc.1.scd b/doc/aerc.1.scd
index c2f813a..efb0750 100644
--- a/doc/aerc.1.scd
+++ b/doc/aerc.1.scd
@@ -139,6 +139,8 @@ message list, the message in the message viewer, etc).

	*-a*: Reply all

	*-A*: Reply all and make sure no From: address is present in To:

	*-q*: Insert a quoted version of the selected message into the reply editor

	*-T*: Use the specified template file for creating the initial message body