use base64 for autoresponder body data
This commit is contained in:
parent
b263a75471
commit
800ffbff8a
|
@ -23,8 +23,7 @@ help()
|
||||||
echo " -o <mode> Mode - either Autoresponder or Vacation. Default is Vacation."
|
echo " -o <mode> Mode - either Autoresponder or Vacation. Default is Vacation."
|
||||||
echo " -s <0|1> Status. 0 = disabled/off, 1 = enabled/on. Default is 1."
|
echo " -s <0|1> Status. 0 = disabled/off, 1 = enabled/on. Default is 1."
|
||||||
echo ""
|
echo ""
|
||||||
echo " The body must be single quoted and escaped. All single quotes in the body must"
|
echo " The body must be base64 encoded, this is to handle special characters and html entities."
|
||||||
echo " have double back slash like this \\\' and all newlines should be encoded as \n."
|
|
||||||
echo " In Vacaion mode only the first email from a specific address is replied to,"
|
echo " In Vacaion mode only the first email from a specific address is replied to,"
|
||||||
echo " in Autoresponder mode every incoming email, including repeats, get a response."
|
echo " in Autoresponder mode every incoming email, including repeats, get a response."
|
||||||
exit
|
exit
|
||||||
|
@ -68,7 +67,7 @@ elif [ "$mbox_id" -gt '0' ]; then
|
||||||
autoresponder_id=`eval $dbcmd $dbcmdopts \"$dbquery\"`
|
autoresponder_id=`eval $dbcmd $dbcmdopts \"$dbquery\"`
|
||||||
if [[ -z $autoresponder_id ]]; then
|
if [[ -z $autoresponder_id ]]; then
|
||||||
# no autoresponder, add new one now
|
# no autoresponder, add new one now
|
||||||
dbquery="INSERT INTO vm_autoresponders SET mbox='$mbox', domain='$domain', subject='$subject', body='$body'"
|
dbquery="INSERT INTO vm_autoresponders SET mbox='$mbox', domain='$domain', subject='$subject', body=FROM_BASE64('$body')"
|
||||||
if [ ! -z $mode ]; then
|
if [ ! -z $mode ]; then
|
||||||
dbquery="$dbquery, mode='$mode'"
|
dbquery="$dbquery, mode='$mode'"
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -25,6 +25,7 @@ help()
|
||||||
echo " Search term is optional. If nothing specified all forwards for all email acccounts for all domains will be returned."
|
echo " Search term is optional. If nothing specified all forwards for all email acccounts for all domains will be returned."
|
||||||
echo " Enter email address to get autoresponder info for that email address."
|
echo " Enter email address to get autoresponder info for that email address."
|
||||||
echo " Enter domain name to get all autoresponders for all email addresses under that domain."
|
echo " Enter domain name to get all autoresponders for all email addresses under that domain."
|
||||||
|
echo " Body is returned in base64 encoding, for handling special characters and html entities."
|
||||||
exit
|
exit
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -39,7 +40,7 @@ if [[ -n $tab ]]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# build query
|
# build query
|
||||||
dbquery="SELECT mbox, domain, QUOTE(subject) AS subject, QUOTE(REPLACE(REPLACE(body,'\r\n','\n'),'\n','\\n')) AS body, mode, status FROM vm_autoresponders"
|
dbquery="SELECT mbox, domain, QUOTE(subject) AS subject, TO_BASE64(body) AS body, mode, status FROM vm_autoresponders"
|
||||||
|
|
||||||
# set search options
|
# set search options
|
||||||
if [[ -n $email ]]; then
|
if [[ -n $email ]]; then
|
||||||
|
|
|
@ -23,8 +23,7 @@ help()
|
||||||
echo " -o <mode> Mode - either Autoresponder or Vacation."
|
echo " -o <mode> Mode - either Autoresponder or Vacation."
|
||||||
echo " -s <0|1> Status. 0 = disabled/off, 1 = enabled/on. Default is 1."
|
echo " -s <0|1> Status. 0 = disabled/off, 1 = enabled/on. Default is 1."
|
||||||
echo ""
|
echo ""
|
||||||
echo " The body must be single quoted and escaped. All single quotes in the body must"
|
echo " The body must be base64 encoded, this is to handle special characters and html entities."
|
||||||
echo " have double back slash like this \\\' and all newlines should be encoded as \n."
|
|
||||||
echo " In Vacaion mode only the first email from a specific address is replied to,"
|
echo " In Vacaion mode only the first email from a specific address is replied to,"
|
||||||
echo " in Autoresponder mode every incoming email, including repeats, get a response."
|
echo " in Autoresponder mode every incoming email, including repeats, get a response."
|
||||||
exit
|
exit
|
||||||
|
@ -63,7 +62,7 @@ else
|
||||||
dbquery="$dbquery, subject='$subject'"
|
dbquery="$dbquery, subject='$subject'"
|
||||||
fi
|
fi
|
||||||
if [ ! -z "$body" ]; then
|
if [ ! -z "$body" ]; then
|
||||||
dbquery="$dbquery, body='$body'"
|
dbquery="$dbquery, body=FROM_BASE64('$body')"
|
||||||
fi
|
fi
|
||||||
if [ ! -z $mode ]; then
|
if [ ! -z $mode ]; then
|
||||||
dbquery="$dbquery, mode='$mode'"
|
dbquery="$dbquery, mode='$mode'"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user