Files
sasa-maillist/postfix/mysql_virtual_alias_maps.cf
James Pattinson 35f710049a MySQL support
2025-10-12 19:24:14 +00:00

15 lines
708 B
CFEngine3

# Postfix MySQL query for virtual aliases
# This file queries the database to expand mailing list addresses to member emails
# Database connection settings
hosts = ${MYSQL_HOST}
port = ${MYSQL_PORT}
user = ${MYSQL_USER}
password = ${MYSQL_PASSWORD}
dbname = ${MYSQL_DATABASE}
# Query to get recipients for a mailing list
# Input: full email address (e.g., community@lists.sasalliance.org)
# Output: comma-separated list of recipient emails
query = SELECT GROUP_CONCAT(m.email SEPARATOR ', ') FROM lists l INNER JOIN list_members lm ON l.list_id = lm.list_id INNER JOIN members m ON lm.member_id = m.member_id WHERE l.list_email = '%s' AND l.active = 1 AND m.active = 1 AND lm.active = 1 GROUP BY l.list_id