Web Hosting Talk







View Full Version : dynamically create e-mail accounts with perl script


ladless
01-25-2009, 04:54 PM
I am running Plesk CP.
$name returns domain.com
The following command has a problem with "@" being in front of "$" (or at least that's what I think).
/usr/local/psa/bin/mail.sh --create mailaccount@$name -mailbox true -passwd password
The above is in a script.pl file and executed as a cron job.
I don't know a code alternative for the above so any suggestions would be highly appreciated. Thanks in advance.

UNIXy
01-25-2009, 05:18 PM
I am running Plesk CP.
$name returns domain.com
The following command has a problem with "@" being in front of "$" (or at least that's what I think).
The above is in a script.pl file and executed as a cron job.
I don't know a code alternative for the above so any suggestions would be highly appreciated. Thanks in advance.
Perhaps you need to escape the @ in your command to avoid it being misinterpreted by the shell. So, it would look like this (notice the backslash):
/usr/local/psa/bin/mail.sh --create mailaccount\@$name -mailbox true -passwd password

ladless
01-25-2009, 05:24 PM
Of course ! To solve the conflict between those two I just needed to escape the "@". Thank you for enlightening me !

UNIXy
01-25-2009, 05:39 PM
Of course ! To solve the conflict between those two I just needed to escape the "@". Thank you for enlightening me !
Glad it's working now :)
Best