Add xmpp address to email headers

This commit is contained in:
Bob Mottram 2016-08-28 09:55:47 +01:00
parent 71abe7cb5b
commit 0df2c9ca7a
3 changed files with 463 additions and 442 deletions

View File

@ -88,4 +88,11 @@ else
fi
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
fi
fi
exit 0

View File

@ -226,6 +226,19 @@ function remove_xmpp {
sed '/XMPP /d' $COMPLETION_FILE
}
function xmpp_email_headers {
for d in /home/*/ ; do
USERNAME=$(echo "$d" | awk -F '/' '{print $3}')
if [[ $USERNAME != "git" && $USERNAME != "mirrors" && $USERNAME != "sync" ]]; then
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
fi
fi
fi
done
}
function install_xmpp_main {
update_prosody_modules
@ -398,6 +411,7 @@ function install_xmpp_main {
function_check configure_firewall_for_xmpp
configure_firewall_for_xmpp
xmpp_email_headers
echo 'install_xmpp_main' >> $COMPLETION_FILE
}