fix bash version of sieve-filter

This commit is contained in:
Élie Bouttier 2016-07-08 01:07:55 +02:00
parent 486c1ece58
commit c5abcf078a
3 changed files with 10 additions and 6 deletions

View File

@ -22,7 +22,7 @@ def email_recv(request):
or not hasattr(settings, 'REPLY_KEY'):
return HttpResponse(status=501) # Not Implemented
key = request.POST.get('key')
key = request.POST.get('key').strip()
if key != settings.REPLY_KEY:
raise PermissionDenied

9
conversations/post-mail.sh Executable file
View File

@ -0,0 +1,9 @@
#! /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.
url="$1"
key="$2"
curl ${url} -F 'key=<${key}' -F 'file=@-;filename="email"'

View File

@ -1,5 +0,0 @@
#! /bin/bash
url=${@#*\@}
key=${@%\@*}
curl ${url} -d key=${key} -d -