Created
October 14, 2017 23:23
-
-
Save zarza/04c395eb9c46faee8913719f3885315a to your computer and use it in GitHub Desktop.
Create multiple email addresses in Plesk from a text file easily
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo '[Create multiple email addresses in Plesk from a text file easily]' | |
echo | |
# ZARZA | A HEAD OF OUR TIME | |
# https://zarza.com | |
FILE='mails.txt' | |
if [ -f $FILE ]; then | |
while read p; do | |
randompw=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 8 | head -n 1) | |
plesk bin mail --create $p -passwd_type plain -passwd $randompw -mailbox true -mbox_quota 1G | |
echo $p '/' $randompw | |
echo | |
done <$FILE | |
else | |
echo "File $FILE does not exist." | |
fi | |
echo | |
echo '===========================================' | |
echo 'Brought to you thanks to https://zarza.com' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment