aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--commands/compose/send.go5
-rw-r--r--config/accounts.go1
-rw-r--r--doc/aerc-accounts.5.scd6
3 files changed, 12 insertions, 0 deletions
diff --git a/commands/compose/send.go b/commands/compose/send.go
index 73672fed..aefeaa3c 100644
--- a/commands/compose/send.go
+++ b/commands/compose/send.go
@@ -110,6 +110,11 @@ func (s Send) Execute(args []string) error {
domain = domain_
}
from := config.From
+ if config.UseEnvelopeFrom {
+ if fl, _ := header.AddressList("from"); len(fl) != 0 {
+ from = fl[0]
+ }
+ }
log.Debugf("send config uri: %s", uri.Redacted())
log.Debugf("send config from: %s", from)
diff --git a/config/accounts.go b/config/accounts.go
index 35046f67..6748f8a4 100644
--- a/config/accounts.go
+++ b/config/accounts.go
@@ -102,6 +102,7 @@ type AccountConfig struct {
Default string `ini:"default" default:"INBOX"`
Postpone string `ini:"postpone" default:"Drafts"`
From *mail.Address `ini:"from"`
+ UseEnvelopeFrom bool `ini:"use-envelope-from" default:"false"`
Aliases []*mail.Address `ini:"aliases"`
Source string `ini:"source" parse:"ParseSource"`
Folders []string `ini:"folders" delim:","`
diff --git a/doc/aerc-accounts.5.scd b/doc/aerc-accounts.5.scd
index 399da629..b6aeb290 100644
--- a/doc/aerc-accounts.5.scd
+++ b/doc/aerc-accounts.5.scd
@@ -143,6 +143,12 @@ Note that many of these configuration options are written for you, such as
_hi@you.com_ and _contact@you.com_, respectively. The name from the alias,
not from the matching address, is used.
+*use-envelope-from* = _true_|_false_
+ Use the email envelope From header address instead of the *from*
+ configuration option when submitting messages.
+
+ Default: _false_
+
*headers* = _<header1,header2,header3...>_
Specifies the comma separated list of headers to fetch with the message.