-
Notifications
You must be signed in to change notification settings - Fork 23
[App] reading emails
HouzuoGuo edited this page Dec 31, 2019
·
3 revisions
List mailbox content and read emails.
laitos uses IMAP to communicate with your Email accounts, and it enforces usage of secure communication via TLS.
Under JSON object Features
, construct a JSON object called IMAPAccounts
that has an object Accounts
.
Give each of your accounts a nick name (such as "personal", "work"), then create an object for each account in
Accounts
. The object must have the following properties:
Property | Type | Meaning | Default value |
---|---|---|---|
Host | string | IMAP(TLS) server's host name, such as "imap.gmail.com". | (This is a mandatory property without a default value) |
AuthUsername | string | Email account name, depending on your mail service provider, it usually does not include the @domain.com suffix. | (This is a mandatory property without a default value) |
AuthPassword | string | Email account password. | (This is a mandatory proeprty without a default value) |
MailboxName | string | Name of mailbox to read from, such as "INBOX". | "INBOX" - the default inbox name of most Email service providers. |
Port | integer | Port number of IMAP(TLS) service. | 993 - the well-known port designated for IMAP. |
InsecureSkipVerify | true/false | Set it to "false" for maximum security. If your mail server host does not have a valid TLS certificate, then set it to less-secure "true". | false - the secure choice |
Here is an example:
{ ... "Features": { ... "IMAPAccounts": { "Accounts": { "personal-mail": { "AuthPassword": "my-gmail-password", "AuthUsername": "guohouzuo", "Host": "imap.gmail.com" }, "work-mail": { "AuthPassword": "my-work-mail-password", "AuthUsername": "hguo", "Host": "gwmail.nue.novell.com" } } }, ... }, ... }
Use any capable laitos daemon to invoke the app:
- List latest emails:
.il account-nick skip count
, whereaccount-nick
is the account nick name from configuration (e.g. personal-mail),skip
is the number of latest emails to discard (can be 0), andcount
is the number of emails to list after discarding. - To read email content:
.ir account-nick message-number
, whereaccount-nick
is the account nick name from configuration,message-number
is the email message number from email list response.
- Popular email services such as Gmail and Hotmail (Outlook) call the primary mail box
INBOX
(in upper case) for incoming emails. - Gmail has a mail box called
[Gmail]/All Mail
that corresponds to the mail box of all emails, which includes sent, junk, and incoming mails. - The junk mail box of Hotmail (Outlook) is called
Junk
(in mixed case). - To discover more mail box names, sign in to your email accounts via an email client such as Mozilla Thunderbird and inspect settings of each mail box.
Table of Contents
- Home
- Get started
- Component list
- Tips for running on public cloud
- Tips for using apps over satellite
- laitos terminal
Daemon Components
- DNS server
- Mail server
- Web server
- Web proxy server
- Telnet server
- Telegram chat-bot
- Simple IP services server
- SNMP server
- System maintenance
- Phone home telemetry
Web Service Components
- Twilio telephone/SMS hook
- Microsoft chat bot hook
- The Things Network LORA tracker integration
- Recurring commands
- App command form
- Simple app command execution API
- GitLab browser
- Temporary file storage
- Simple web proxy
- Desktop on a page (virtual machine)
- Read telemetry records
- Program health report
- System process explorer
- Prometheus metrics exporter
- HTTP request inspector
- HTTP request logger
Apps