diff --git a/postfix_add_mailboxes.sh b/postfix_add_mailboxes.sh index 1c50e71..d8fcbab 100755 --- a/postfix_add_mailboxes.sh +++ b/postfix_add_mailboxes.sh @@ -181,13 +181,12 @@ while read email passwd ; do ## - if [[ -z "$passwd" ]]; then if [[ -z "$_passwd" ]]; then - passwd=`tr -cd '[:alnum:]\!@#$%' < /dev/urandom | fold -w10 | head -n1` password_accepted=false while ! $password_accepted ; do - passwd=`tr -cd '[:alnum:]\!@#$%' < /dev/urandom | fold -w10 | head -n1` - regex="[\!@#$%_]" + passwd=`tr -cd '[:alnum:]#_\!\%/=@-' < /dev/urandom | tr '0' 'O' | fold -w10 | head -n1` + regex="[#_\!\%/=@-]" [[ $passwd =~ $regex ]] || continue - regex="[0123456789].*[0123456789]" + regex="[123456789].*[123456789]" [[ $passwd =~ $regex ]] || continue password_accepted=true done