Not all variants have email
This commit is contained in:
parent
81a550cfaa
commit
ff32771e61
|
@ -88,20 +88,16 @@ if [ "$SSH_PUBLIC_KEY" ]; then
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -d /home/$MY_USERNAME/Maildir ]; then
|
if [ -d /home/$MY_USERNAME/Maildir ]; then
|
||||||
echo $'Email directory was not created'
|
if grep -q "set from=" /home/$MY_USERNAME/.muttrc; then
|
||||||
userdel -r $MY_USERNAME
|
|
||||||
exit 6
|
|
||||||
fi
|
|
||||||
|
|
||||||
if grep -q "set from=" /home/$MY_USERNAME/.muttrc; then
|
|
||||||
sed -i "s|set from=.*|set from='$MY_USERNAME <$MY_USERNAME@$HOSTNAME>'|g" /home/$MY_USERNAME/.muttrc
|
sed -i "s|set from=.*|set from='$MY_USERNAME <$MY_USERNAME@$HOSTNAME>'|g" /home/$MY_USERNAME/.muttrc
|
||||||
else
|
else
|
||||||
echo "set from='$MY_USERNAME <$MY_USERNAME@$HOSTNAME>'" >> /home/$MY_USERNAME/.muttrc
|
echo "set from='$MY_USERNAME <$MY_USERNAME@$HOSTNAME>'" >> /home/$MY_USERNAME/.muttrc
|
||||||
fi
|
fi
|
||||||
|
|
||||||
USERN='$USER@'
|
USERN='$USER@'
|
||||||
sed -i "s|$USERN|$MY_USERNAME@|g" /home/$MY_USERNAME/.procmailrc
|
sed -i "s|$USERN|$MY_USERNAME@|g" /home/$MY_USERNAME/.procmailrc
|
||||||
|
fi
|
||||||
|
|
||||||
# generate a gpg key
|
# generate a gpg key
|
||||||
echo "Making a GPG key for $MY_USERNAME@$HOSTNAME"
|
echo "Making a GPG key for $MY_USERNAME@$HOSTNAME"
|
||||||
|
@ -139,19 +135,21 @@ if [ ! -f $MY_GPG_PUBLIC_KEY ]; then
|
||||||
exit 7
|
exit 7
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# encrypt outgoing mail to the "sent" folder
|
if [ -f /home/$MY_USERNAME/.muttrc ]; then
|
||||||
if ! grep -q "pgp_encrypt_only_command" /home/$MY_USERNAME/.muttrc; then
|
# encrypt outgoing mail to the "sent" folder
|
||||||
|
if ! grep -q "pgp_encrypt_only_command" /home/$MY_USERNAME/.muttrc; then
|
||||||
echo '' >> /home/$MY_USERNAME/.muttrc
|
echo '' >> /home/$MY_USERNAME/.muttrc
|
||||||
echo $'# Encrypt items in the Sent folder' >> /home/$MY_USERNAME/.muttrc
|
echo $'# Encrypt items in the Sent folder' >> /home/$MY_USERNAME/.muttrc
|
||||||
echo "set pgp_encrypt_only_command=\"/usr/lib/mutt/pgpewrap gpg --batch --quiet --no-verbose --output - --encrypt --textmode --armor --always-trust --encrypt-to 0x$MY_GPG_PUBLIC_KEY_ID -- -r %r -- %f\"" >> /home/$MY_USERNAME/.muttrc
|
echo "set pgp_encrypt_only_command=\"/usr/lib/mutt/pgpewrap gpg --batch --quiet --no-verbose --output - --encrypt --textmode --armor --always-trust --encrypt-to 0x$MY_GPG_PUBLIC_KEY_ID -- -r %r -- %f\"" >> /home/$MY_USERNAME/.muttrc
|
||||||
else
|
else
|
||||||
sed -i "s|set pgp_encrypt_only_command.*|set pgp_encrypt_only_command=\"/usr/lib/mutt/pgpewrap gpg --batch --quiet --no-verbose --output - --encrypt --textmode --armor --always-trust --encrypt-to 0x$MY_GPG_PUBLIC_KEY_ID -- -r %r -- %f\"|g" /home/$MY_USERNAME/.muttrc
|
sed -i "s|set pgp_encrypt_only_command.*|set pgp_encrypt_only_command=\"/usr/lib/mutt/pgpewrap gpg --batch --quiet --no-verbose --output - --encrypt --textmode --armor --always-trust --encrypt-to 0x$MY_GPG_PUBLIC_KEY_ID -- -r %r -- %f\"|g" /home/$MY_USERNAME/.muttrc
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! grep -q "pgp_encrypt_sign_command" /home/$MY_USERNAME/.muttrc; then
|
if ! grep -q "pgp_encrypt_sign_command" /home/$MY_USERNAME/.muttrc; then
|
||||||
echo "set pgp_encrypt_sign_command=\"/usr/lib/mutt/pgpewrap gpg %?p?--passphrase-fd 0? --batch --quiet --no-verbose --textmode --output - --encrypt --sign %?a?-u %a? --armor --always-trust --encrypt-to 0x$MY_GPG_PUBLIC_KEY_ID -- -r %r -- %f\"" >> /home/$MY_USERNAME/.muttrc
|
echo "set pgp_encrypt_sign_command=\"/usr/lib/mutt/pgpewrap gpg %?p?--passphrase-fd 0? --batch --quiet --no-verbose --textmode --output - --encrypt --sign %?a?-u %a? --armor --always-trust --encrypt-to 0x$MY_GPG_PUBLIC_KEY_ID -- -r %r -- %f\"" >> /home/$MY_USERNAME/.muttrc
|
||||||
else
|
else
|
||||||
sed -i "s|set pgp_encrypt_sign_command.*|set pgp_encrypt_sign_command=\"/usr/lib/mutt/pgpewrap gpg %?p?--passphrase-fd 0? --batch --quiet --no-verbose --textmode --output - --encrypt --sign %?a?-u %a? --armor --always-trust --encrypt-to 0x$MY_GPG_PUBLIC_KEY_ID -- -r %r -- %f\"|g" /home/$MY_USERNAME/.muttrc
|
sed -i "s|set pgp_encrypt_sign_command.*|set pgp_encrypt_sign_command=\"/usr/lib/mutt/pgpewrap gpg %?p?--passphrase-fd 0? --batch --quiet --no-verbose --textmode --output - --encrypt --sign %?a?-u %a? --armor --always-trust --encrypt-to 0x$MY_GPG_PUBLIC_KEY_ID -- -r %r -- %f\"|g" /home/$MY_USERNAME/.muttrc
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! grep -q "Change your GPG password" /home/$MY_USERNAME/README; then
|
if ! grep -q "Change your GPG password" /home/$MY_USERNAME/README; then
|
||||||
|
|
Loading…
Reference in New Issue