Discourse-setup fallisce con nome utente SMTP con un /

Ecco una patch:

Correggere i comandi sed per consentire indirizzi email conformi a RFC3696

discourse-setup.fix-272514.patch.gz (601 Byte)

diff --git a/discourse-setup b/discourse-setup
index 0daafcb..121982e 100755
--- a/discourse-setup
+++ b/discourse-setup
@@ -586,7 +586,7 @@ ask_user_for_config() {
     fi
 
     # set smtp_domain default value here rather than use Rails default of localhost
-    smtp_domain=$(echo $notification_email | sed -e "s/.*@//")
+    smtp_domain=$(echo $notification_email | sed -e "s].*@]]")
 
     if [ ! -z $letsencrypt_account_email ]
     then
@@ -645,7 +645,7 @@ ask_user_for_config() {
     update_ok="n"
   fi
 
-  sed -i -e "s/^  DISCOURSE_DEVELOPER_EMAILS:.*/  DISCOURSE_DEVELOPER_EMAILS: '$developer_emails'/w $changelog" $web_file
+  sed -i -e "s]^  DISCOURSE_DEVELOPER_EMAILS:.*]  DISCOURSE_DEVELOPER_EMAILS: '$developer_emails']w $changelog" $web_file
   if [ -s $changelog ]
   then
     rm $changelog
@@ -672,7 +672,7 @@ ask_user_for_config() {
     update_ok="n"
   fi
 
-  sed -i -e "s/^  #?DISCOURSE_SMTP_USER_NAME:.*/  DISCOURSE_SMTP_USER_NAME: $smtp_user_name/w $changelog" $web_file
+  sed -i -e "s]^  #?DISCOURSE_SMTP_USER_NAME:.*]  DISCOURSE_SMTP_USER_NAME: $smtp_user_name]w $changelog" $web_file
   if [ -s $changelog ]
   then
     rm $changelog
@@ -681,7 +681,7 @@ ask_user_for_config() {
     update_ok="n"
   fi
 
-  sed -i -e "s/^  #?DISCOURSE_NOTIFICATION_EMAIL:.*/  DISCOURSE_NOTIFICATION_EMAIL: $notification_email/w $changelog" $web_file
+  sed -i -e "s]^  #?DISCOURSE_NOTIFICATION_EMAIL:.*]  DISCOURSE_NOTIFICATION_EMAIL: $notification_email]w $changelog" $web_file
   if [ -s $changelog ]
   then
     rm $changelog
@@ -745,7 +745,7 @@
   then
     echo "Enabling Let's Encrypt"
   fi
-  sed -i -e "s/^  #?LETSENCRYPT_ACCOUNT_EMAIL:.*/  LETSENCRYPT_ACCOUNT_EMAIL: $letsencrypt_account_email/w $changelog" $web_file
+  sed -i -e "s]^  #?LETSENCRYPT_ACCOUNT_EMAIL:.*]  LETSENCRYPT_ACCOUNT_EMAIL: $letsencrypt_account_email]w $changelog" $web_file
   if [ -s $changelog ]
   then
     rm $changelog
3 Mi Piace