~sircmpwn/aerc

option never to include your own address when replying v2 PROPOSED

JD: 1
 option never to include your own address when replying

 4 files changed, 28 insertions(+), 0 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/16346/mbox | git am -3
Learn more about email & git
View this thread in the archives

[PATCH v2] option never to include your own address when replying Export this patch

Introduces an option in aerc.conf to disable the auto-including
of your own address when replying to your own emails (replies
are addressed to the original To: and Cc: instead); defaults to
true (allows the auto-including)
---
 commands/msg/reply.go | 13 +++++++++++++
 config/aerc.conf.in   |  6 ++++++
 config/config.go      |  2 ++
 doc/aerc-config.5.scd |  7 +++++++
 4 files changed, 28 insertions(+)

diff --git a/commands/msg/reply.go b/commands/msg/reply.go
index 778c0ef..c677b14 100644
--- a/commands/msg/reply.go
+++ b/commands/msg/reply.go
@@ -112,6 +112,19 @@ func (reply) Execute(aerc *widgets.Aerc, args []string) error {
	} else {
		to = msg.Envelope.From
	}

	if !aerc.Config().Compose.ReplyToSelf {
		for i, v := range to {
			if v.Address == from.Address {
				to = append(to[:i], to[i+1:]...)
				break
			}
		}
		if len(to) == 0 {
			to = append(msg.Envelope.To)
		}
	}

	recSet.AddList(to)

	if replyAll {
diff --git a/config/aerc.conf.in b/config/aerc.conf.in
index b9381a8..6e26560 100644
--- a/config/aerc.conf.in
+++ b/config/aerc.conf.in
@@ -152,6 +152,12 @@ header-layout=To|From,Subject
# ignored.
address-book-cmd=

#
# Allow to address yourself when replying
#
# Default: true
reply-to-self=true

[filters]
#
# Filters allow you to pipe an email body through a shell command to render
diff --git a/config/config.go b/config/config.go
index e646133..0e65799 100644
--- a/config/config.go
+++ b/config/config.go
@@ -104,6 +104,7 @@ type ComposeConfig struct {
	Editor         string     `ini:"editor"`
	HeaderLayout   [][]string `ini:"-"`
	AddressBookCmd string     `ini:"address-book-cmd"`
	ReplyToSelf    bool       `ini:"reply-to-self"`
}

type FilterConfig struct {
@@ -529,6 +530,7 @@ func LoadConfigFromFile(root *string, sharedir string) (*AercConfig, error) {
				{"To", "From"},
				{"Subject"},
			},
			ReplyToSelf:  true,
		},

		Templates: TemplateConfig{
diff --git a/doc/aerc-config.5.scd b/doc/aerc-config.5.scd
index d4de883..9a90ddf 100644
--- a/doc/aerc-config.5.scd
+++ b/doc/aerc-config.5.scd
@@ -297,6 +297,13 @@ These options are configured in the *[compose]* section of aerc.conf.

	Default: none

*reply-to-self*
	Allow to include your own address. Otherwise, if set to false, do not mail
	yourself when replying (e.g., if replying to emails previously sent by
	yourself, address your replies to the original To: and Cc:).

	Default: true

## FILTERS

Filters allow you to pipe an email body through a shell command to render
-- 
2.7.4