How to create several mailboxes on Plesk server at once using a single command or a script?

Follow

Comments

4 comments

  • Avatar
    Martin

    The script returns: -bash: ./createmail.sh: /bin/bash^M: bad interpreter: No such file or directory when obtained from wget

    This is probably caused by MSWin line endings?

  • Avatar
    Bato Tsydenov

    @Martin

    Thank you for notice. I have updated the article and now working script is attached.

  • Avatar
    Bernardo Murillo

    Hello, 

     

    I created the file mai.txt with the format: "user@domain password"

    but after in the script i see "insertpasswordhere" means every account will be created with the same passwords.

    After research i executed this script:

    for /F "tokens=1,2 delims= " %i in (c:\mail.txt) do plesk bin mail.exe -c %i -passwd %j -mailbox true

     

    And now the scripts creates the user with the password from file mail.txt.

    if some password is not complex enought will show you the status.

  • Avatar
    Alexandr Redikultsev

    Hello @Bernardo Murillo!

    Thank you very much for the input.

    I have updated the article accordingly.

Please sign in to leave a comment.

Have more questions? Submit a request