Fix email fix
This commit is contained in:
parent
b19334d0b9
commit
ec0a88980c
|
@ -55,13 +55,15 @@ function mediagoblin_fix_email {
|
|||
# does not have mail access
|
||||
read_config_param 'MEDIAGOBLIN_DOMAIN_NAME'
|
||||
MEDIAGOBLIN_BASE_DIR=/var/www/$MEDIAGOBLIN_DOMAIN_NAME/htdocs
|
||||
mgfile=$MEDIAGOBLIN_BASE_DIR/mediagoblin/tools/mail.py
|
||||
mgfile=$MEDIAGOBLIN_BASE_DIR/mediagoblin/mediagoblin/tools/mail.py
|
||||
if [ ! -f $mgfile ]; then
|
||||
echo $'Unable to fix email sending'
|
||||
exit 792532
|
||||
fi
|
||||
if ! grep 'import os' $mgfile; then
|
||||
sed -i '/import sys/a import os' $mgfile
|
||||
fi
|
||||
replacestr='return mhost.sendmail(from_addr, to_addrs, message.as_string())'
|
||||
newstr="return os.system(\"echo '\" + message_body + \"' | mail -s '\" + message['Subject'] + \"' \" + message['To'])"
|
||||
sed -i "s|${replacestr}|${newstr}|g" $mgfile
|
||||
sed -i "s|return mhost.sendmail(from_addr, to_addrs, message.as_string())|return os.system(\"echo '\" + message_body + \"' \| mail -s '\" + message['Subject'] + \"' \" + message['To'])|g" $mgfile
|
||||
}
|
||||
|
||||
function install_interactive_mediagoblin {
|
||||
|
|
Loading…
Reference in New Issue