• We value your experience with Plesk during 2024
    Plesk strives to perform even better in 2025. To help us improve further, please answer a few questions about your experience with Plesk Obsidian 2024.
    Please take this short survey:

    https://pt-research.typeform.com/to/AmZvSXkx
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Question Mailinglist recipients from SQL database

dennis_81

Basic Pleskian
Hello,

I am looking for a way to get the eMail recipients of a mailinglist from a SQL database. I know this possibility e.g. from IceWarp. There I could read out with a SELECT query from a MySQL database, to whom a mailinglist forwards the messages.
Can I implement something like this with Plesk?

Thanks for your answers
 
If I'm not mistaken list of subscribers is not stored in the Plesk database. But you can get this list with the appropriate CLI utility:
Code:
# plesk bin maillist -i maillist -domain distracted-nightingale.128-19-131-120.plesk
Mailing list members:
[email protected]
[email protected]
[email protected]
SUCCESS: operation with mailing list 'maillist' complete.
 
Hello,

thank you, but maybe I didn't explain it correctly:
I do not want to use the Plesk database but an external database. We have a MySQL DB for personnel management. In this database are also the employees with departments and mail addresses. I would like to automatically add all employees who are in department A to the distribution list [email protected].
 
You could do this aslo using the Plesk CLI. To add an email address to an mailinglist to can use:
Bash:
plesk bin maillist --update MailinglistName -members add:[email protected] -domain example.com

You'll have to write a script to export the email addresses from your database and add those email addresses to the mailinglist using the code example above. More information on the Plesk CLI can be found here: maillist: Mailing Lists
 
Thank You @Rasp
How can I make entries here? Is that only possible via the Plesk CLI? Do I have to schedule it via cronjob? Or can I for example also edit this via PHP on a website?
 
@dennis_81
unfortunately there's no ability to do that via API, so adding the script with CLI commands to the cron looks good.
 
Back
Top