SW_DevArchive - fablab-wue/piTelex GitHub Wiki

Device Module "Archive"

Description

The archive module saves a prettyprint(able) copy of each incoming and outgoing message in the specified directory. The filenames contain date an time of the message as well as the direction (from/to) and the answerback of the remote machine for easier distinction.

Helper script

prettify-archive-file, which is merely a symbolic link to the Archive module file, can print a single archive file at the console in a human friendly form.

Command line example:
  $ prettify-archive-file <archive-file-to-print>

Sending an e-mail notification every time a telex arrives

You can advise piTelex to send all incoming messages by e-mail to a configurable e-mail-account. This is a handy feature if you want to read your telexes from elsewhere. Therefore, the archive device must be enabled and sending mails must be configured. The code snippet below shows the necessary entries in the configuration file.

    "archive": {
      "type": "archive",
      "enable": true,
      "path": "./archive/",                             # where to store archived messages
      "send_email": true,    							# notify via email when a telex has arrived
      "recipient": "[email protected]"      # E-Mail address of recipient
      # now some data of mailaccount to use
      "email_sender": "[email protected]",     # E-Mail address of sender
      "smtp_server": "smtp.mailserver.org",             # FQDN or IP of mailserver
      "smtp_port": 587,									# TCP port at mailserver (often 25, 465, 587)
      "smtp_user": "username",		               		# username at mail server
      "smtp_password": "VeryVerySecret"	                # password for username
    }

System

System Comments
RPi OK
PC Linux OK
PC Windows OK
Mac OK

Dependencies

none

Command Line Arguments

-A  | --Archive

Example: telex.py -A

Config File Parameter

Param Default Type or range Description
path "archive" string path to archive directory
send_email false false / true notify via email when a telex has arrived
recipient none string E-Mail address of recipient
email_sender none string E-Mail address of sender
smtp_server none string FQDN or IP of mailserver
smtp_port 587 pos. integer TCP port at mailserver (often 25, 465, 587)
smtp_user none string username at mail server
smtp_password none string password for username