Autoresponder via CLI
Hi, am interested into how one might manage autoresponders via the command line, as opposed the GUI.
When one is set up, the relevant domain alias file references /usr/local/cpanel/bin/autorespond with two additional arguments: the email address in question to which the responder is attached; and, the folder containing a file having the same name as the email address which contains the verbiage of the responder.
That takes care of the verbiage itself. One can manually manipulate that file via scripting to update its contents (say, changing a return date in the message, if the regular body usually stays the same).
But how does one view and manipulate the "on" and "off" dates without using the GUI?
Manually running /usr/local/cpanel/bin/autorespond - even with --help or --version - produces two errors:
Use of uninitialized value $dir in substitution (s///) at bin/autorespond.pl line 29.
Use of uninitialized value $dir in concatenation (.) or string at bin/autorespond.pl line 31.
As autorespond.pl does not appear to exist anywhere in the filesystem, am imagining the compiled autorespond executable in the bin folder is that same file, but it has no provision for sending anything but that email address and folder as arguments.
If anyone has info on how to view and adjust the dates for these user autoresponders via the command line, I'd be most appreciative.
Thanks!
-
Hey there! We do have several APIs related to the Autoresponder system:
Create: https://api.docs.cpanel.net/openapi/cpanel/operation/add_auto_responder/
Delete: https://api.docs.cpanel.net/openapi/cpanel/operation/delete_auto_responder/
View: https://api.docs.cpanel.net/openapi/cpanel/operation/get_auto_responder/
View entire domain: https://api.docs.cpanel.net/openapi/cpanel/operation/list_auto_responders/
However, we don't seem to have a specific API to let you edit the Autoresponder like we allow in the cPanel interface through the "Edit" function.
I've created case CPANEL-46479 with our development team to see if they'd be able to add that API call, as that would allow for complete control over the autoresponder system through the API.
0 -
Thanks for that info, will check it out!. Honestly haven't used the API much. Should really get with this century one of these days. ;)
Seems like between the view, delete and create methods, you've already got the functionality covered. It is an extra step deleting an old one first before creating anew, rather than just being to update an existing one, but that's no big deal. Still, having an update method in the API would be helpful as well.
0 -
Yes, if you're okay with delete and recreate, that's an option!
-1
Please sign in to leave a comment.
Comments
3 comments