Question
How to enable/disable autoresponder via command-line interface?
Answer
-
Go to Domains > example.com > Mail > [email protected] > Auto-Reply.
-
Enable Switch on auto-reply and set it up.
-
Once done, apply the changes.
Use the plesk bin autoresponder
utility to manage autoresponder.
-
Enabling autoresponder
-
Connect to a Plesk server via SSH (Linux) / RDP (Windows Server).
-
Enable autoresponder:
The following command creates and enables autoresponder for the mail account [email protected] with the text “Thank you for your inquiry. The application form is attached.”, with the subject line “Application form” and attached file applicationform.txt from the file system.
# plesk bin autoresponder --update -mail john_doe@example.com -status true -attach add:"/path/to/applicationform.txt" -subject "Application form" -text "Thank you for your inquiry. The application form is attached."
-
-
Disabling autoresponder
Use the following command to switch off the autoresponder for an email account:
# plesk bin autoresponder --update -mail [email protected] -status false
To disable autoresponder for multiple mailboxes:
-
Get all email accounts with enabled autoresponder:
# plesk db "SELECT mail.mail_name, mail_resp.resp_on FROM mail LEFT JOIN mail_resp ON mail.id = mail_resp.mn_id where mail_resp.resp_on='true'"
-
Create the file /root/autoreply.txt and add required email accounts:
-
Disable auto-reply for all mailboxes specified in the text file:
# cat /root/autoreply.txt | while read i; do /usr/local/psa/bin/autoresponder --update -mail $i -status false;done
-