Documentation
¶
Index ¶
- Constants
- func DefaultConfigPath() string
- func Save(path string, cfg *Config) error
- func SlugifyID(s string) string
- func SlugifyProfileID(firstName, lastName string, existing []NamedProfile) string
- type Config
- func (c *Config) ConfiguredInboxes() []InboxConfig
- func (c *Config) EmailForProfile(p NamedProfile) EmailConfig
- func (c *Config) GetProfile(id string) (NamedProfile, error)
- func (c *Config) GetProfiles() []NamedProfile
- func (c *Config) InboxForProfile(p NamedProfile) InboxConfig
- func (c *Config) IsManualSend() bool
- func (c *Config) Validate() error
- func (c *Config) ValidateInbox() error
- type Email
- type EmailConfig
- type InboxConfig
- type MailConfig
- type NamedProfile
- type Options
- type Pipeline
- type Profile
- type SMTPConfig
Constants ¶
const DefaultProfileID = "default"
DefaultProfileID is the synthetic ID used for the legacy single Profile block when no profiles: list is configured, and is what pre-multi-profile history rows are attributed to after the profile_id migration.
Variables ¶
This section is empty.
Functions ¶
func DefaultConfigPath ¶
func DefaultConfigPath() string
func SlugifyID ¶
SlugifyID lowercases and hyphenates s, keeping only [a-z0-9]. Every profile ID must go through it: net/http silently drops non-ASCII bytes from Set-Cookie, so an ID with diacritics breaks the web UI's profile cookie.
func SlugifyProfileID ¶
func SlugifyProfileID(firstName, lastName string, existing []NamedProfile) string
SlugifyProfileID derives an ID from first/last name (see SlugifyID), appending -2, -3, ... when taken.
Types ¶
type Config ¶
type Config struct {
// Profile is the legacy single-profile block, wrapped by GetProfiles as
// "default". Ignored once Profiles is non-empty.
Profile Profile `yaml:"profile"`
// Profiles tracks removal requests for several people against the same
// brokers, mail account and options; history is kept per profile
// (profile_id). Takes precedence over Profile.
Profiles []NamedProfile `yaml:"profiles,omitempty"`
Email EmailConfig `yaml:"email"`
Options Options `yaml:"options"`
Inbox InboxConfig `yaml:"inbox,omitempty"`
Pipeline Pipeline `yaml:"pipeline,omitempty"`
}
func (*Config) ConfiguredInboxes ¶ added in v0.8.0
func (c *Config) ConfiguredInboxes() []InboxConfig
ConfiguredInboxes returns every enabled IMAP inbox across profiles (overrides or the shared one), deduplicated by address, so `monitor` covers everyone.
func (*Config) EmailForProfile ¶ added in v0.8.0
func (c *Config) EmailForProfile(p NamedProfile) EmailConfig
EmailForProfile returns the SMTP config to use for sends made under this profile: its Mail.Email override if set, otherwise the shared top-level Email block.
func (*Config) GetProfile ¶
func (c *Config) GetProfile(id string) (NamedProfile, error)
GetProfile resolves a profile by ID. Empty id works only when exactly one profile exists; otherwise it errors with the available IDs.
func (*Config) GetProfiles ¶
func (c *Config) GetProfiles() []NamedProfile
GetProfiles returns every profile; with no profiles: list, the legacy profile: block as a single "default" profile.
func (*Config) InboxForProfile ¶ added in v0.8.0
func (c *Config) InboxForProfile(p NamedProfile) InboxConfig
InboxForProfile returns the IMAP config to use when monitoring replies for this profile: its Mail.Inbox override if set, otherwise the shared top-level Inbox block.
func (*Config) IsManualSend ¶
IsManualSend reports whether the user opted out of automated sending - Eraser renders the emails but never transmits them.
func (*Config) ValidateInbox ¶
ValidateInbox validates inbox configuration (only called when inbox monitoring is used)
type Email ¶
type Email = EmailConfig
type EmailConfig ¶
type EmailConfig struct {
Provider string `yaml:"provider"`
From string `yaml:"from"`
SMTP SMTPConfig `yaml:"smtp,omitempty"`
}
type InboxConfig ¶
type InboxConfig struct {
Enabled bool `yaml:"enabled"`
Provider string `yaml:"provider"` // "gmail", "outlook", "imap"
Server string `yaml:"server"` // e.g., "imap.gmail.com"
Port int `yaml:"port"` // e.g., 993
Email string `yaml:"email"` // Email address to monitor
Password string `yaml:"password"` // App password (not main password)
Folder string `yaml:"folder"` // Folder to monitor (default: "INBOX")
AutoArchive bool `yaml:"auto_archive"` // Automatically move processed emails to archive folder
ArchiveFolder string `yaml:"archive_folder"` // Folder to archive emails to (default: "Eraser")
}
InboxConfig holds IMAP settings for monitoring broker responses
type MailConfig ¶ added in v0.8.0
type MailConfig struct {
Email *EmailConfig `yaml:"email,omitempty"`
Inbox *InboxConfig `yaml:"inbox,omitempty"`
}
MailConfig holds one profile's email/inbox overrides. Either field may be set independently - e.g. a profile can send from its own SMTP account while still sharing the default inbox for reply monitoring.
type NamedProfile ¶
type NamedProfile struct {
// ID: short, lowercase, hyphenated. Stored verbatim in history.db, so
// renaming it orphans the profile's existing history.
ID string `yaml:"id"`
Profile `yaml:",inline"`
// Mail overrides the shared email:/inbox: blocks for this profile only
// (see EmailForProfile/InboxForProfile). nil = use the shared blocks.
Mail *MailConfig `yaml:"mail,omitempty"`
}
NamedProfile is a person's identity plus the stable ID used by --profile, history rows and the web UI's switcher.
type Options ¶
type Options struct {
Template string `yaml:"template"`
// SendMode:
// "" / "smtp" - Eraser sends over the configured SMTP account.
// "manual" - Eraser renders the emails for you to send yourself and
// record with `eraser mark-sent` / "Mark sent". No email:
// block needed; for users who won't share mailbox credentials.
SendMode string `yaml:"send_mode,omitempty"`
DryRun bool `yaml:"dry_run"`
RateLimitMs int `yaml:"rate_limit_ms"`
// DailySendLimit caps sends per rolling 24h to stay under provider limits
// (Gmail ~500/day). 0 = 450. Bypass with --ignore-daily-limit.
DailySendLimit int `yaml:"daily_send_limit,omitempty"`
// BrokerList: "" / "full" (~750 entries, default) or "verified"
// (data/brokers-verified.yaml). Overridden by `send --list`; ignored when
// BrokerFile or --brokers is set.
BrokerList string `yaml:"broker_list,omitempty"`
// BrokerFile points the send-family commands at your own broker list,
// the config equivalent of the global --brokers flag (which still wins).
// Takes precedence over BrokerList.
BrokerFile string `yaml:"broker_file,omitempty"`
Regions []string `yaml:"regions"`
ExcludedBrokers []string `yaml:"excluded_brokers,omitempty"`
// ExcludedCategories skips brokers by category (case-insensitive), e.g.
// "requires-id" for brokers that demand an ID document.
ExcludedCategories []string `yaml:"excluded_categories,omitempty"`
}
type Pipeline ¶
type Pipeline struct {
AutoConfirm bool `yaml:"auto_confirm"` // Auto-click confirmation links
AutoFillForms bool `yaml:"auto_fill_forms"` // Enable browser automation for forms
// BrowserHeadless is a pointer so an explicit false survives loading (a
// plain bool was forced back to true). Read it via Headless().
BrowserHeadless *bool `yaml:"browser_headless,omitempty"`
BrowserTimeoutSec int `yaml:"browser_timeout_sec"` // Browser operation timeout
}
Pipeline holds settings for the automation pipeline
type Profile ¶
type Profile struct {
FirstName string `yaml:"first_name"`
// MiddleName: some brokers (background-check, financial-b2b) match on
// full legal name.
MiddleName string `yaml:"middle_name,omitempty"`
LastName string `yaml:"last_name"`
Email string `yaml:"email"`
// AdditionalEmails: older addresses a broker may have indexed you under.
AdditionalEmails []string `yaml:"additional_emails,omitempty"`
// NameVariants covers other spellings brokers may have indexed you under -
// e.g. a diacritic-free version of your name ("Maris" for "Māris"), a
// maiden name, or a nickname you've used to sign up for things.
NameVariants []string `yaml:"name_variants,omitempty"`
// PreviousAddresses: partial ones still help, since matching keys off
// street/city/postal code.
PreviousAddresses []string `yaml:"previous_addresses,omitempty"`
Address string `yaml:"address,omitempty"`
City string `yaml:"city,omitempty"`
State string `yaml:"state,omitempty"`
ZipCode string `yaml:"zip_code,omitempty"`
Country string `yaml:"country,omitempty"`
Phone string `yaml:"phone,omitempty"`
// AdditionalPhones covers other numbers you've used to sign up for
// things (an old number, a work line) that a broker might have on file
// instead of your current one.
AdditionalPhones []string `yaml:"additional_phones,omitempty"`
DateOfBirth string `yaml:"date_of_birth,omitempty"`
}