diff options
-rw-r--r-- | commands/msg/reply.go | 13 | ||||
-rw-r--r-- | config/aerc.conf.in | 6 | ||||
-rw-r--r-- | config/config.go | 2 | ||||
-rw-r--r-- | doc/aerc-config.5.scd | 7 |
4 files changed, 28 insertions, 0 deletions
diff --git a/commands/msg/reply.go b/commands/msg/reply.go index a7768372..dac9f7a6 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 9f45883f..87f7e563 100644 --- a/config/aerc.conf.in +++ b/config/aerc.conf.in @@ -194,6 +194,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 e2acbaf3..8d818c26 100644 --- a/config/config.go +++ b/config/config.go @@ -123,6 +123,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 { @@ -595,6 +596,7 @@ func LoadConfigFromFile(root *string, sharedir string, logger *log.Logger) (*Aer {"To", "From"}, {"Subject"}, }, + ReplyToSelf: true, }, Templates: TemplateConfig{ diff --git a/doc/aerc-config.5.scd b/doc/aerc-config.5.scd index f40c9cb0..a5af0d21 100644 --- a/doc/aerc-config.5.scd +++ b/doc/aerc-config.5.scd @@ -340,6 +340,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 |