This repository has been archived on 2020-08-21. You can view files and clone it, but cannot push or open issues or pull requests.
paste-manager/apimail.sh
Némunaire 0838f1c15b Add a simple email API that use Subject as title, From as author.
If a file is linked in the email, the last one will be added to the service, otherwise, the e-mail body will be used
2012-02-29 14:42:01 +01:00

14 lines
348 B
Bash
Executable File

#!/bin/sh
DIR="/var/www/p0m.fr/paste/"
tmpfile=`mktemp`
cat <&0 > $tmpfile
from=`cat "$tmpfile" | formail -x From | tail -n 1 | $DIR/conv2047-0.1.pl -d`
subject=`cat "$tmpfile" | formail -x subject | $DIR/conv2047-0.1.pl -d`
cat "$tmpfile" | $DIR/apimail.php "$from" "$subject"
#chmod +r `cat "$tmpfile" | $DIR/apimail.php "$from" "$subject"`