Programs called autoresponders receive and reply to email automatically. In the SMTP world, this is done either by using the forward-to-program option on the mail server, or by having the program connect to POP, IMAP, and SMTP ports on the server.

It is possible to write Confidant Mail autoresponders, and the source release has three examples: an echo program, a mailing list, and a file server. These are based on the approach of an automatic client. The automatic client is a Python program which runs a Client Agent and drives its message-passing interface to send and receive emails. These programs are modified versions of code from gui.py and message_list_window.py, which is why they contain some unused code.

To run an automatic client, first configure a user normally, creating a client directory and a key pair, and uploading the key pair to the server. Then close the Confidant Mail client, configure the autoclient, and run the autoclient python program. The autoclient polls the server periodically and processes mail. You can run the autoclient from screen on a Linux machine so you do not have to stay logged in.

Each of these autoclients has some configuration at the top of the file, right after the imports. You should copy and configure the program before running it. The autoclient also maintains the inbox database of its user, so you can periodically shut down the autoclient and open the mailbox with Confidant Mail. This is useful to review the messages passing through the program, and to occasionally clear out old ones. The programs do not delete processed messages, although they could easily be modified to do so.

autoclient_echo.py is a simple demo that will send any message it receives back to the sender. Configuration options:


To run the autoresponder:
python autoclient_echo.py -homedir /path/to/client/directory
The homedir path is the same one shown in the Directory column of the Confidant Mail chooser.

autoclient_listserv.py is a mailing list service. It accepts incoming messages and sends them on to everyone in its mailing list. The mailing list is "recipients.txt" under the homedir, and should contain 40-character keyids one per line. You can have just the keyid, or the username and keyid in its normal form. The mailing list can be updated live, and the program will read it before sending each message. If the file is momentarily missing for replacement, the program will pause and retry.

The outgoing messages use the forwarded original mechanism. Recipients will get a message from the autoresponder, signed by the autoresponder's key, and containing an identifying header. The message will have the autoresponder in the To line, and the recipients are sent as Bcc entries.

Any attachments in the original message will also be listed in the header. The recipient can click Show Original to view the original message as sent, to check the signature, and to access the attachments. Replies go to the list by default. To reply to the sender, use Show Original. Entangled users will not receive the original message if the attachment size is larger than a user-defined size.

To be accepted and retransmitted, a message must come from a key that is a member of the mailing list (found in recipients.txt) and must have a valid signature from the sender. Messages will be discarded if the autoresponder cannot check the sender's signature.

Any recipient can, with some investigation, see the addresses and keyids of a few other list members, because several people are Bcc'd on each copy of the message. The number of Bccs is an adjustable parameter, and could be changed to 1 to send to each recipient individually, at some cost in performance and storage.

Configuration options:


To run the autoresponder:
python autoclient_listserv.py -homedir /path/to/client/directory

autoclient_fileserv.py is a file-serving autoresponder. You can request a file from the autoresponder, and it will arrive as an attachment. You can email a file, and the autoresponder will save it to a specified directory. You can also get a directory listing, make and remove directories, and delete files. Access is confined to a specified directory, and is restricted by sender key ID.

Configuration options:

The access file contains one key per line followed by the user's permissions:


Commands you can send to the fileserver in the body of the email:

To run the autoresponder:
python autoclient_listserv.py -homedir /path/to/client/directory