Sending messages from the outer space
email on Plan 9
Store your account’s password to factotum. You can follow my guide about secstore. For now, we can use an encrypted file that will feed factotum. Spin up a temporary directory and add your passwords in a file.
Encrypt the file and move it elsewhere because
/tmp will be wiped when this window will be closed. Then, decrypt the file as a test.
If it prints your password, you can add the following command to
$home/lib/profile. This will decrypt your passwords and transfer them to
factotum do not persistently keep secrets in memory. Adding the following command to your profile will feed
factotum with your passwords when your session begins.
Opening One Inbox
It’s the most painless way to check your emails and get notified by faces.
The first fetching run will get you the following error:
Import the certificate hash to fix this error.
Now, you can open your inbox.
Add the first line to your profile to have your inbox loaded during your next startup. You can also check another mailbox for the current window’s lifespan.
Opening multiple maiboxes
Add mailboxes to the mail file server.
Replace “maildir” with one of your account’s folder or “label”, such as “Inbox”. You have to open your mailboxes every time you launch a new filesystem, so add these commands to your profile or in a script for convenience.
Notification with faces
Use faces(1) to read your mailboxes. The following command will look for new emails only. Emails are displayed with a right click and individual faces can be discarded with a left click.
The mail command will take care of opening mailboxes and sending emails. acme also have its own mail client and you can read its man page at acmemail(1).
nedmail is invoked by mail without arguments or by upas/nedmail. It will assume that your mailbox is located in /mail/fs/mbox. To read another mailbox run the following:
A clone of nedmail, mother was created by sl. It also comes with a script to open messages plumbed from faces.
Nail is the new acme mail client by orib that replace the previous Mail. It was since merged into 9front and Nail was renamed Mail. Old documentation about Mail may not apply to the new Mail.
Just like upas/nedmail, middle-clicking Mail in acme will launch it assuming that your mailbox is in /mail/fs/mbox. To open another mailbox, execute one of the following:
To make things easier, create dump of your acme session with your mailbox oppened. You may also want to create an acme window dedicated to email. ptrap(4) can prevent acme to get plumbed anything but email. I created two scripts for this setup.
First thing first, you have to copy
/mail/lib/rewrite and change YOURDOMAIN.COM with the default domain name that you will use. Things gets tricky here. I host all my email domains and alias under the same account, making my setup very simple. I documented it in a blog post. Basically, I just have to change the headers file to select the right sending identity.
Once the account problem is fixed, sending an email can be done like this:
The window will be on hold, type the body of your message. Once you are done, you can unhold the window by pressing escape. Message will be sent by a final
Ctrl+D. Your first email wont get through. Check the smtp logs under
/sys/log/smtp.fail: you have to save the smtp certificate hash just like we did when we dealt with IMAP.
Sending email with acme Mail or nedmail is simpler, but the mail command is practical.