FRE-681: Fix code review findings - body flag, PGP encryption, passphrase handling

- cmd/mail.go: Fix duplicate --body/--body-file flag binding (both used bodyFile)
- internal/mail/client.go: Add PGP encryption to Send via EncryptBody, add passphrase to MoveToTrash and SendDraft
- internal/mail/pgp.go: Store armored private key, add getUnlockedKeyRing helper,
  fix Decrypt/SignData/EncryptAndSign/DecryptAttachment to use passphrase via key.Unlock
- internal/mail/pgp.go: Add EncryptBody method for Send encryption with sender key
- cmd/draft.go: Update SendDraft call to include passphrase parameter
This commit is contained in:
Senior Engineer
2026-04-28 10:08:33 -04:00
committed by Michael Freno
parent af25fd5575
commit e499d16b7c
4 changed files with 112 additions and 37 deletions

View File

@@ -260,7 +260,7 @@ func draftSendCmd() *cobra.Command {
client.SetAuthHeader(session.AccessToken)
mailClient := mail.NewClient(client)
if err := mailClient.SendDraft(messageID); err != nil {
if err := mailClient.SendDraft(messageID, session.AccessToken); err != nil {
return fmt.Errorf("failed to send draft: %w", err)
}