diff options
author | Stas Rudakou <stas@garage22.net> | 2022-07-30 22:42:49 +0200 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2022-07-31 19:53:13 +0200 |
commit | ca90343850290c256430ad64daa3d809a7016299 (patch) | |
tree | 5e5f8aed3c7b77f18764103875c67cff061c384f /commands/compose | |
parent | e73e5065b0f81e566f8383d30ad25950b127e96b (diff) | |
download | aerc-ca90343850290c256430ad64daa3d809a7016299.tar.gz |
outgoing-cred-cmd: delay execution until an email needs to be sent
This can be useful in cases when:
1. outgoing-cred-cmd requires a user action or confirmation (e.g. when
using pass with a Yubikey or similar smart card that requires a user
to enter a pin or touch the device when decrypting the password)
2. A user starts aerc frequently, but not all the sessions end up with
sending emails
3. So the user only wants to execute outgoing-cred-cmd when the password
is really used, so the user doesn't have to enter pin or touch their
Yubikey each time aerc starts
Signed-off-by: Stas Rudakou <stas@garage22.net>
Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'commands/compose')
-rw-r--r-- | commands/compose/send.go | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/commands/compose/send.go b/commands/compose/send.go index cca1540f..5448b728 100644 --- a/commands/compose/send.go +++ b/commands/compose/send.go @@ -51,7 +51,11 @@ func (Send) Execute(aerc *widgets.Aerc, args []string) error { tabName := tab.Name config := composer.Config() - if config.Outgoing == "" { + outgoing, err := config.Outgoing.ConnectionString() + if err != nil { + return errors.Wrap(err, "ReadCredentials(outgoing)") + } + if outgoing == "" { return errors.New( "No outgoing mail transport configured for this account") } @@ -74,7 +78,7 @@ func (Send) Execute(aerc *widgets.Aerc, args []string) error { return errors.Wrap(err, "ParseAddress(config.From)") } - uri, err := url.Parse(config.Outgoing) + uri, err := url.Parse(outgoing) if err != nil { return errors.Wrap(err, "url.Parse(outgoing)") } |