Bob Mottram 8 年前
父节点
当前提交
9bcd603d71
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2
    2
      src/freedombone-addxmpp

+ 2
- 2
src/freedombone-addxmpp 查看文件

@@ -77,10 +77,10 @@ if [ ! $EMAIL_ADDRESS ]; then
77 77
     exit 1
78 78
 fi
79 79
 
80
+USERNAME=$(echo $EMAIL_ADDRESS | awk -F '@' '{print $1}')
80 81
 if [ ! $NEW_USER_PASSWORD ]; then
81 82
     prosodyctl adduser $EMAIL_ADDRESS
82 83
 else
83
-    USERNAME=$(echo $EMAIL_ADDRESS | awk -F '@' '{print $1}')
84 84
     DOMAIN_NAME=$(echo $EMAIL_ADDRESS | awk -F '@' '{print $2}')
85 85
     prosodyctl register $USERNAME $DOMAIN_NAME "$NEW_USER_PASSWORD"
86 86
     if [ ! "$?" = "0" ]; then
@@ -91,7 +91,7 @@ fi
91 91
 # add the xmpp address to email headers
92 92
 if [ -f /home/$USERNAME/.muttrc ]; then
93 93
     if ! grep -q "Jabber-ID" /home/$USERNAME/.muttrc; then
94
-        echo "my_hdr Jabber-ID: ${USERNAME}@${HOSTNAME}" >> /home/$USERNAME/.muttrc
94
+        echo "my_hdr Jabber-ID: $EMAIL_ADDRESS" >> /home/$USERNAME/.muttrc
95 95
     fi
96 96
 fi
97 97