#!/usr/bin/env python # -*- coding: utf-8 -*- ''' html_footer.py This script looks for special formated plain messages and convert them into html. It is intended to use this script as a postfix message filter. It can be used as a pipe or as a standalone stmp daemon application. Usage: html_footer.py [OPTION...] -h, --help show this help message -V, --version shows version information -u, --uid=USERNAME run as uid if in daemon mode -p, --pipemode read/write message from/to stdin/stdout -d, --debuglevel=LEVEL default level = info valid levels: critical, error, warning, info, debug -l, --listen=HOST:IP port to listen on (default: 127.0.0.1:10025) -r, --remote=HOST:IP relayhost to deliver to (default: 127.0.0.1:25) -i, --imagepath=PATH path for attachments (default: /var/lib/html_footer) -f, --logfile=FILENAME -k, --kill kills daemon -p, --pidfile=FILENAME pidfile for daemon (default: /var/run/html_footer.pid) The decision if a mail has to be converted is taken by a line with the tags in the signature of the plain mail. Example: -----8<----- Dear .. best regards -- Text signature
Html signature
-----8<----- If image tags a refered in html attachment text, the should be placed in the directory IMG_PATH on the machine the script is running on. The use of inline encoded data is also possible. The img tag is only recognized if it doesn't span over a linebreak. The src-attributes content should be prefixed with file: or without any protocol directive. eg. @copyright: 2012 dass IT GmbH @author: Holger Mueller