Throughout the configuration, <mailuser>
is a placeholder for an
actual username.
APE may live in the <mailuser>
home directory
/home/<mailuser>/ape
and has the following directory structure
/composer/
- Mail parser Library/docs/
- Documentation and License information/history/
- Copy of already printed PDFs, sorted by days/html/
- Web interface, accessed by Apache/log/
- Logfiles/queue/
- PDFs awaiting to be printed with next cronjob/tmp/
- Incoming emails as HTML files
and important files
cronMagazinDruck.php
- executed by cronjobcronScanauftrag.php
- executed by cronjobinit.php
- startup serviceprint.conf
- configuration file (directories & printers)printJob.class.php
- called by init.php
- Debian 11 (Bullseye) Installation with PHP 7.4
- Open incoming port 25
Create a dedicated user <mailuser>
sudo useradd -d <mailuser>
Inside /home/<mailuser>/
run
git clone https://github.com/UB-Mannheim/ape.git
Rename print.conf.example
to print.conf
and adapt the paths to your system.
- exim4
- cups
- apache2
- libapache2-mod-php
- weasyprint
- git
- php-mime-mail-parser
Assuming composer is already
installed change to
directory /home/<mailuser>/ape/composer
and run
composer install
to install php-mime-mail-parser.
It is possible to access files remotely that are generated for printing.
Example Apache configuration snippet:
Alias "/ape" "/home/mailuser/ape/html"
<Location /ape>
Options Indexes MultiViews FollowSymLinks
AllowOverride All
# require local network
Require ip 192.168.0.0/24
</Location>
- exim4 retrieves emails on incoming port 25 (!firewall restrictions)
and redirects them all to the
<mailuser>
as specified in/etc/aliases
*: <mailuser>
- the
<mailuser>
forwards incoming email to the ape script as specified in/home/<mailuser>/.forward
<mailuser>@servername.de,"|php -q /home/<mailuser>/ape/init.php"
- the named script parses the email and gathers the required information before printing via CUPS print server
See crontab example