# Overview

The first step is to install Posterity-TG. If you have already done so: congratulations, read on to set it up. If you have not, please read INSTALL.txt and follow the directions there. Then read this file.

## Initial Setup

For all the follow steps, we will assume that you have a shell in the install directory. This directory should contain this README.txt file, as well as many subdirectories, such as 'bin', 'log', 'conf', etc. If you want to save some typing, you can also run

$source bin/activate And thereafter, you do not need to prefix the commands with bin, as well as being able to run the commands from any directory (except with the serve command, which must be able to find the ini file). Before the site is very useful, you need to log in. For that, you need to create a user account. Currently, only the admin can do so from the command line. To set up a user account with a password, please do the following:$ bin/posterity-admin account -c USERNAME -p PASSWORD

To change the password of an existing user, try the following (no -c):

$bin/posterity-admin account USERNAME -p PASSWORD To view all accounts currently on the server, run the following command:$ bin/posterity-admin account -l

To start the server, run the following command:

$bin/paster serve conf/server.ini One of the first output lines should read something like this (with the port you specified): serving on http://127.0.0.1:8080 Simply point your browser to that location and log in with the account you created above. ## Using Your Account The general experience should be similar to Gmail, for those who have used it. Mails are grouped together in conversations, so all replies appear together in one cluster. Furthermore, mails do not belong in one folder, but instead can accept multiple tags. You can use these tags like folders, but a message can be in more than one place. For example, a message may have the 'Important' tag while it is still in the Inbox, or after it has been archived. The first thing you must do, before you can send a mail is to set up an identity. An identity is a mail address you send from, along with a name and a signature. When you compose a mail, you can select which account you wish to send from. Click on 'Settings' on the left-hand menu, then on 'Identities' on the top menu. Fill out the form with a valid email that belongs to you, and hit save. Now, you can send your first mail. Click on 'New Mail' on the left hand menu and send a mail to another account that belongs to you. After you send it, you will see it in the 'Sent Mail' folder. You can also check the Inbox of the account you sent it to, to make sure the SMTP server was set up correctly. (If there is an error here, you probably set the SMTP server incorrectly. Look at conf/server.ini, section [DEFAULTS] and make sure the values for mail.smtp are all correct. Maybe you need a password to authentication. Maybe the SMTP server only accepts mails with a 'From' address of the same domain.) The second thing you may want to do is to receive mail from an existing email account (such as gmail, gmx, or one provided by your hosting company). This is relatively straight-forward in Posterity-TG, assuming the mail host provides a POP3 interface. Go to 'Settings', then 'Pop3 Accounts'. Look up the information from your provider, and fill out the form. TODO: non-standard ports not accepted?!? One nice feature here is to tag the mail, so you can easily sort out mail that comes from your gmail account and your gmx account. To do you, you must first create a Tag (on the top menu), and then select that tag name in the bottom 'Add tag'. When you create or edit the Pop Account, it may take a little while. That is because it verifies that the connection works and the username and password are valid. This is as much as the user needs to worry about. In order for these mails to actually arrive in the inbox, the administrator needs to start a long-running process (daemon) that will periodically check all the mailboxes that all the users defined. To do so, run:$ bin/posterity-admin fetch

Please note that this process should run continuously (or at least whenever the webserver is running), so please install it as a system service, not just a one-off script. The other approach is to set it up as a cronjob. Add the following line to your crontab file:

*/5 * * * * POST_USER \$INST_DIR/bin/posterity-admin fetch -o

This will run fetch every 5 minues as POST_USER (set this to the same user who runs the webserver). The -o flag tells it to only run one time, not to loop continuously looking for new mails. We can let crontab take care of the looping.

If you are really running a mail server, you don't want to simply aggregate mails from other accounts, you want to receive them directly. Now, setting up your own SMTP server is beyond the scope of this document, but I will assume that you have already done it.

TODO: figure this out. NOTE: the key is the command 'posterity-admin inject', which can receive a

mail piped to it from .forward