Delete users also from distribution list - MySQL Trigger

Use this forum if you have installed hMailServer and want to ask a question related to a production release of hMailServer. Before posting, please read the troubleshooting guide. A large part of all reported issues are already described in detail here.
Post Reply
Hazark
New user
New user
Posts: 26
Joined: 2014-05-08 23:17

Delete users also from distribution list - MySQL Trigger

Post by Hazark » 2014-10-24 19:11

I'm using a MySQL trigger for automated removing from distribution lists when deleting users. If you using MySQL backend, feel free to use this:

Code: Select all

CREATE DEFINER=`YOUR_HMAIL_USER`@`localhost` TRIGGER `RemoveDistRecipients` BEFORE DELETE ON `hm_accounts` FOR EACH ROW BEGIN
  DELETE FROM `hm_distributionlistsrecipients` WHERE `distributionlistrecipientaddress`=OLD.`accountaddress`;
END

Post Reply