diff --git a/bin/sendsms.sh b/bin/sendsms.sh index d0e6703..f6afd3b 100755 --- a/bin/sendsms.sh +++ b/bin/sendsms.sh @@ -2,10 +2,10 @@ # only for Russia!!! COUNTRY_CODE="7" +SPOOLDIR="/srv/data/sms-outgoing/" USER="smsd" GROUP="smsd" -SPOOLDIR="/srv/data/sms/outgoing/" if [ -z "$*" ]; then echo "Usage: ./sendsms.sh \"phone number\" \"message\"" @@ -40,13 +40,14 @@ if [[ ${#DST} != 11 ]]; then exit -1 fi -SMS=$(mktemp /tmp/sms_XXXXXXX) +FILENAME="/tmp/"`date +"%Y.%m.%d-%H:%M:%S"`"_${DST}.XXXXX" +SMS=$(mktemp $FILENAME) chown :${GROUP} ${SMS} chmod 0666 ${SMS} echo "To: ${DST}" >> $SMS echo "" >> $SMS -echo $MSG >> $SMS +echo -en $MSG >> $SMS mv ${SMS} ${SPOOLDIR} diff --git a/config.inc.php.dist b/config.inc.php.dist index ccdb848..280ec0c 100644 --- a/config.inc.php.dist +++ b/config.inc.php.dist @@ -17,6 +17,9 @@ $config['pr_fields'] = [ // Admin email (this account will receive alerts when an user does not have an alternative email and phone) $config['pr_admin_email'] = 'postmaster@your.domain.com'; +// Address to be indicated as reply-to in mail notifications +$config['pr_replyto_email'] = 'postmaster@your.domain.com'; + // Use secret question/answer to confirmation password recovery $config['pr_use_question'] = false; diff --git a/lib/send.php b/lib/send.php index 86dc6ea..7fe8a69 100644 --- a/lib/send.php +++ b/lib/send.php @@ -35,7 +35,7 @@ class password_recovery_send { $sms_send_function = $this->rc->config->get('pr_sms_send_function'); if ($sms_send_function) { if (is_file($sms_send_function)) { - $ret = (int) exec("$sms_send_function $to $message"); + $ret = (int) exec("bash $sms_send_function $to $message"); } else if (is_callable($sms_send_function)) { $ret = $sms_send_function($to, $message); } @@ -126,9 +126,14 @@ class password_recovery_send { $body = strtr(file_get_contents($file), ['[LINK]' => $link, '[CODE]' => $confirm_code]); $subject = $this->pr->gettext('email_subject'); + $from = $this->rc->config->get('pr_replyto_email'); + if(!$from){ + $from = get_email_from($this->rc->config->get('pr_admin_email')); + } + $send_email = $this->send_email( $this->user['altemail'], - $this->get_email_from($this->rc->config->get('pr_admin_email')), + $from, $subject, $body );