diff --git a/src/freedombone-addxmpp b/src/freedombone-addxmpp index aebc13cc..f23db9cf 100755 --- a/src/freedombone-addxmpp +++ b/src/freedombone-addxmpp @@ -77,10 +77,10 @@ if [ ! $EMAIL_ADDRESS ]; then exit 1 fi +USERNAME=$(echo $EMAIL_ADDRESS | awk -F '@' '{print $1}') if [ ! $NEW_USER_PASSWORD ]; then prosodyctl adduser $EMAIL_ADDRESS else - USERNAME=$(echo $EMAIL_ADDRESS | awk -F '@' '{print $1}') DOMAIN_NAME=$(echo $EMAIL_ADDRESS | awk -F '@' '{print $2}') prosodyctl register $USERNAME $DOMAIN_NAME "$NEW_USER_PASSWORD" if [ ! "$?" = "0" ]; then @@ -91,7 +91,7 @@ fi # add the xmpp address to email headers if [ -f /home/$USERNAME/.muttrc ]; then if ! grep -q "Jabber-ID" /home/$USERNAME/.muttrc; then - echo "my_hdr Jabber-ID: ${USERNAME}@${HOSTNAME}" >> /home/$USERNAME/.muttrc + echo "my_hdr Jabber-ID: $EMAIL_ADDRESS" >> /home/$USERNAME/.muttrc fi fi