In previous articles I got into how to setup Postfix and Dovecot using MySQL for management. Well this time round a question rose about creating a blackhole. Which is basically a catch all e-mail address that dumps all mail coming in.
Doing this in the MySql setup created before should be relatively easy. First of modify the ‘/etc/aliasses‘ file and add ‘devnull: /dev/null‘. This will add a virtual debian user called devnull to the system. Keep in mind this alias is not yet active. To activate it run: newaliases. This will compile the file and load it into the memory.
Now open either PostfixAdmin or MySql and add an alias from ‘@domain.com’ to ‘devnull’. Which will catch all e-mail sent to domain.com and store it into the file belonging to user devnull, which in our case is the blackhole :).
Please be carefull, as all mail sent to the domain will be dropped unless either an alias or a mailbox is defined for the domain.