Let postfix poll the drupal database to check if the email address exists or not
Last updated on
30 April 2025
It is possible having postfix check with each incoming mail if the email address exists in the drupal database or not.
I did this with some custom code, have a look at http://drupal.org/node/1980098#comment-7358614
Here is how:
(This is on our ubuntu setup, paths may differ for your setup)
Add this at the bottom of /etc/postfix/main.cf
# added for our drupal setup.
# load mysql aliases
alias_maps = mysql:/etc/postfix/mysql-aliases.cf
Create a new file at /etc/postfix/mysql-aliases.cf
with this content:
#
# mysql config file for local(8) aliases(5) lookups
#
# The user name and password to log into the mysql server.
user = YOUR_MYSQL_USERNAME
password = YOUR_MYSQL_PASSWORD
hosts = 127.0.0.1
# The database name on the servers.
dbname = YOUR_MYSQL_DBNAME
# For Postfix 2.2 and later The SQL query template.
# See mysql_table(5) for details.
query = SELECT forw_addr FROM workgroup_postfix_aliases WHERE alias='%s'
Help improve this page
Page status: Not set
You can:
You can:
- Log in, click Edit, and edit this page
- Log in, click Discuss, update the Page status value, and suggest an improvement
- Log in and create a Documentation issue with your suggestion