Remove useless code from email_account considering the change of
configuration for the mail system on adagio:
* No need to twiddle cyrus and restart it to connect to cyradm, just
stop using --auth
* No default domain anymore (thus no special casing for it)
* No file listing current valid emails
echo "Fist form adds an email account named emailaccount if it doesn't already exist"
echo "First form adds an email account named emailaccount if it doesn't already exist"
echo "and creates an alias named emailalias for this email account if specified."
echo
echo "Second form prints this help."
@ -145,21 +145,6 @@ try_sudo ()
exit $ret
}
# Warn user that cyrus will need to restart twice and postfix will have
# to reload its configuration once and ask him if he is ok for that
test_ready_for_restarts ()
{
local - first_ask next_ask
first_ask="Be aware that you'll need to restart cyrus twice and to make postfix reload its configuration once. Are you ready?"
next_ask="Incorrect answer. Are you ready to restart cyrus and make postfix reload its configuration?"
ask_user_default_no "$first_ask" "$next_ask"
if [ $? -eq 1 ]
then
echo "Ok, exiting…"
exit 1
fi
}
# Test cyrus password is OK.
test_cyrus_admin ()
{
@ -169,25 +154,6 @@ test_cyrus_admin ()
testsaslauthd -u $cyruser -p $cyrpwd > /dev/null || { echo "Error! Password for main cyrus admin has changed but has not been modified in /root/" >&2 && exit 1 ; }
}
# Save cyrus state and make it cyradm ready, that is save and change
# allowplaintext and virtdomain and make it listen on localhost:imap
# instead of *:imap
save_cyrus_state_and_become_cyradm_ready ()
{
local -
sed -r -i "s/^(.*cmd=\"imapd.* listen=\")(imap\".*)$/\1localhost:\2/" /etc/cyrus.conf
sed -r -i "s/^([[:blank:]]*allowplaintext:.*)$/#\1\nallowplaintext: 1/" /etc/imapd.conf
sed -r -i "s/^([[:blank:]]*virtdomains:.*)$/#\1\nvirtdomains: userid/" /etc/imapd.conf
invoke-rc.d --quiet cyrus2.2 restart
if [ ! $? -eq 0 ]
then
echo "Error! Restarting cyrus failed. The requested action coudn't be performed." >&2
echo "Look at the logs and restart Cyrus manually." >&2
return 1
fi
return 0
}
# Ask a password to the user and create the entry in sasldb database.