1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice
  3. Dear Pleskians, I really hope that you will share your opinion in this Special topic for chatter about Plesk in the Clouds. Thank you!
    Dismiss Notice

Batch Email Import for Plesk

Discussion in 'Plesk 9.x for Windows Suggestions and Feedback' started by AronF, Nov 13, 2009.

  1. AronF

    AronF Guest

    0
     
    I've got Plesk 9.2 installed on Windows Server 2008 using Mail Enable Enterprise as the Email server. Everything is working fine. I can go in for any domain and hand key as many email addresses as I want but I've got literally hundreds of email addresses to create.

    Does anybody know how I can automate the creation of email addresses through plesk?

    I still want Plesk to be aware of the new addresses as the owners of each email account may want to log in to Plesk and adjust SPAM/AV settings.

    I've done several searches on either a command line console or some other scripting method for getting what I need done and have not had any success.
     
  2. IgorG

    IgorG Forums Analyst Staff Member

    49
    24%
    Joined:
    Oct 27, 2009
    Messages:
    24,546
    Likes Received:
    1,240
    Location:
    Novosibirsk, Russia
    Look at this topic. I hope it will help.
     
  3. AronF

    AronF Guest

    0
     
    My Solution

    Here's the powershell script that I ended up with, for anybody else that might have this same question or might wonder what the status of my query is:

    Using the following CLI resource for Plesk 9.2, I was able to construct this PowerShell script to create the desired email accounts:

    foreach ($email in Get-Content "C:\your email list.csv") { $eml = $email.split(", ")[0]; $pass = $email.split(", ")[1]; cmd.exe /c "mail --create $eml -passwd $pass -cp-access true -mailbox true -antivirus inout"; cmd.exe /c "spamassassin.exe -u $eml -status true"; }

    The script reads in a .csv file and does some basic parsing to grab the appropriate email/password values and then enables several options including spam filtering on the inbox.

    I hope this helps somebody!

    --Aron
     
Loading...