Navigation auf uzh.ch

Suche

Department of Informatics - Communication Systems Group

AutoMailTool

Example configuration files show the printing feature with lpr. Note that these examples will only work with linux.

The script is written in PHP, but no Apache is required. PHP can be used as a scripting language like bash on the command line.

The script requires php_imap. It can be installed with apt-get or yum, depending on your Linux distribution.

Sample Configuration Files

This example just prints out the filenames of all mails that contains a PDF document

#!/bin/bash

UEB_DIR=mail/teaching
USER=test
 
./AutoMailTool.php \
mailserver:993/ssl/readonly/novalidate-cert \
$UEB_DIR \
$USER \
-f '/.*[.](pdf)$/i' \
-p "echo \"File recognized! File: %f\"" \
-v all

The following example shows all mails that do not contain any PDF document

#!/bin/bash

UEB_DIR=mail/teaching
USER=test
 
./AutoMailTool.php \
mailserver:993/ssl/readonly/novalidate-cert \
$UEB_DIR \
$USER \
-f '/.*[^p][^d][^f]$/i' \
-p "echo \"File not recognized! File: %f\"" \
-v all

And this example will print all PDFs in an IMAP folder.

 #!/bin/bash
 
UEB_DIR=mail/teaching
USER=test

./AutoMailTool.php \
mailserver:993/ssl/readonly/novalidate-cert \
$UEB_DIR \
$USER \
-s SORTFROM \
-sorder desc \
-d file \
-f '/.*[.](pdf)$/i' \
-p "acroread -toPostScript -pairs \"%f\" \"%f.ps\";lpr \
-o sides=two-sided-long-edge \"%f.ps\";rm \"%f.ps\""

Change Log

The change log is located in the file AutoMailTool.php. Please feel free to send us any comments or feedback.

Warning: Do not rely on this script. This script might contain errors which will result in unexpected behavior! This script will not run with certain kinds of mails. Please refer to the change log in the file AutoMailTool.php.

Download

Latest version 1.8.1: AutoMailTool.php (TXT, 15 KB)

License

AutoMailTool - A tool for handling automated mail replay and printing of attachments

Copyright (C) 2005 University of Zurich, Thomas Bocek

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

Weiterführende Informationen

Title

Teaser text