FRE-682: Add folder/label management, search, and fix PGP build

- Add pop mail search CLI command with pagination support
- Create internal/labels package with types and API client
- Add folder list/create/update/delete CLI commands
- Add label list/create/update/delete/apply/remove CLI commands
- Register folder and label commands in root.go
- Fix gopenpgp v2 API mismatches in pgp.go (NewPlainMessage, Armor,
  KeyRing.Encrypt/Decrypt, SessionKey)
- Fix NewSessionManager error handling across cmd files
- Fix variable shadowing bug in mail/client.go
This commit is contained in:
Paperclip
2026-04-28 06:37:47 -04:00
committed by Michael Freno
parent 35d47733ea
commit af25fd5575
12 changed files with 1033 additions and 84 deletions

View File

@@ -4,7 +4,6 @@ import (
"io"
"os"
"path/filepath"
"strings"
)
// ErrInvalidAttachmentID is returned when attachmentID contains unsafe characters
@@ -60,7 +59,7 @@ func (m *AttachmentManager) Download(attachmentID, name, destPath string) error
attachmentID = sanitizedID
}
if err := os.MkdirAll(m.attachmentsDir, 0755); err != nil {
if err := os.MkdirAll(m.attachmentsDir, 0700); err != nil {
return err
}
@@ -76,7 +75,7 @@ func (m *AttachmentManager) Download(attachmentID, name, destPath string) error
return err
}
return os.WriteFile(dest, data, 0644)
return os.WriteFile(dest, data, 0600)
}
func (m *AttachmentManager) Upload(attachmentID, name string, reader io.Reader) error {
@@ -87,7 +86,7 @@ func (m *AttachmentManager) Upload(attachmentID, name string, reader io.Reader)
attachmentID = sanitizedID
}
if err := os.MkdirAll(m.attachmentsDir, 0755); err != nil {
if err := os.MkdirAll(m.attachmentsDir, 0700); err != nil {
return err
}
@@ -98,7 +97,7 @@ func (m *AttachmentManager) Upload(attachmentID, name string, reader io.Reader)
return err
}
return os.WriteFile(filepath.Join(m.attachmentsDir, attachmentID), data, 0644)
return os.WriteFile(filepath.Join(m.attachmentsDir, attachmentID), data, 0600)
}
func (m *AttachmentManager) Get(attachmentID string) ([]byte, error) {