Accounts
An account is one mailbox: its IMAP settings, optional SMTP settings, and a name you choose. You can add as many as you like.
Commands#
fob-email config accounts add work --imap-host … --imap-user … --imap-pass … --smtp-host …
fob-email config accounts list # * marks the current account
fob-email config accounts use work # make "work" the current account
fob-email config accounts refresh work # sign in again and update saved details (--all for every account)
fob-email config accounts remove work # alias: rm
config accounts and config profiles are the same command.
addwith an existing name replaces that account. Use it to change a password or add SMTP.listnever shows passwords. After an account has signed in once, it also shows the mailbox address and the provider fob-email detected.removedeletes the account from your config file only. To cut off access, also revoke the app password at your provider.
Choosing an account per command#
Commands that reach a mailbox take --account <name>:
fob-email emails list --account work
fob-email emails list --account personal --unseen
Without --account, fob-email uses the current account.
Accounts from the environment#
For workers, CI and containers, set FOB_EMAIL_ACCOUNTS to a JSON map of account names to settings. Nothing is read from or written to the config file for these accounts.
export FOB_EMAIL_ACCOUNTS='{
"billing": {
"imap": { "host": "imap.gmail.com", "port": 993, "user": "[email protected]", "pass": "<app password>", "tls": true },
"smtp": { "host": "smtp.gmail.com", "port": 465, "secure": true }
}
}'
fob-email emails list --account billing
imap.host,imap.userandimap.passare required. Ports default to 993 and 465, and TLS to on.smtpis optional. Itsuserandpassdefault to the IMAP ones.- Keep the value out of shell history and logs. Use your platform's secret store to set it.
Which account a command uses#
| You pass | fob-email uses |
|---|---|
--account work | work from FOB_EMAIL_ACCOUNTS if it's there, otherwise work from the config file |
Nothing, and FOB_EMAIL_ACCOUNTS is set | The first account in FOB_EMAIL_ACCOUNTS |
| Nothing | The current account from the config file, otherwise the first one in it |
So when FOB_EMAIL_ACCOUNTS is set, it wins over your config file's current account. Unset it, or pass --account, to use a config-file account.
The config file#
# ~/.fob/fob-email/config.yml (mode 0600)
current: personal
accounts:
personal:
imap: { host: imap.gmail.com, port: 993, user: [email protected], pass: <app password>, tls: true }
smtp: { host: smtp.gmail.com, port: 465, user: [email protected], pass: <app password>, secure: true }
address: [email protected] # filled in when the account signs in
provider: gmail
threadStrategy: thread-id
Edit it with the config accounts commands rather than by hand. fob-email re-applies mode 0600 every time it writes the file. To keep it somewhere else, set FOB_EMAIL_CONFIG_DIR to a folder; the local mirror (sync.db) moves with it.
provider and threadStrategy describe your server, worked out when the account signs in. threadStrategy decides how threads are grouped: thread-id when the server provides conversation IDs (Gmail does), otherwise reconstruct, which follows reply headers. Run config accounts refresh if your provider changes.