list mails in IMAP folder and print data on console.
Configuration for mail server can be done in ~/.config/mailp/config.json:
{
"host": "imap.example.com",
"port": 993,
"username": "<>",
"password": "<>"
}
The environment variable MAILP_CONFIG can be used to set a path to the configuration file. Alternatively the path can be set with command line flags.
| Flag | Environment variable | Description | Default |
|---|---|---|---|
| -output | MAILP_OUTPUT | json or text, json will print a valid json document, text tab separated lines | json |
| -folder | IMAP folder to list, default is INBOX | INBOX | |
| -config | MAILP_CONFIG | path to config file, default is ~/.config/mailp/config.json | |
| -debug | MAILP_DEBUG | print debug information | false |
| print mail content for message with uid |
mailp folder
Will print a list of all folders in imap account.
mailp list -folder INBOX
If folder is empty an error will be returned.
mailp -mail 1234 -folder INBOX
Print mail.