Skip to content

Instantly share code, notes, and snippets.

@zarza
Created October 14, 2017 23:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zarza/04c395eb9c46faee8913719f3885315a to your computer and use it in GitHub Desktop.
Save zarza/04c395eb9c46faee8913719f3885315a to your computer and use it in GitHub Desktop.
Create multiple email addresses in Plesk from a text file easily
#!/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