Update post-mail.sh

This commit is contained in:
Aymeric / APLU 2016-07-08 18:03:46 +02:00
parent 2201441c2f
commit c555859896
1 changed files with 6 additions and 5 deletions

View File

@ -1,9 +1,10 @@
#! /bin/bash
# Usage: cat email.txt | post-mail.sh https://example.org/conversations/recv/ /etc/ponyconf/key.txt
# The file /etc/ponyconf/key.txt should contain the value of the django setting REPLY_KEY.
# Usage: cat email.txt | post-mail.sh REPLY_KEY@https://example.org/conversations/recv/
# Get the value of REPLY_KEY from the django setting.
url="$1"
key="$2"
# Postfix users can set up an alias file with this content:
# reply: "|/path/to/post-mail.sh mykey@https://example.org/conversations/recv/
# don't forget to run postalias and to add the alias file to main.cf under alias_map.
curl "${url}" -F "key=<${key}" -F 'email=@-'
curl ${@#*\@} -F key=${@%\@*} -F "email=@-"