Topic: Virtual email aliases with a traditional flat-file
==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): v0.9.9
- Deployed with iRedMail Easy or the downloadable installer? Installer
- Linux/BSD distribution name and version: FreeBSD
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Web server (Apache or Nginx): Nginx
- Manage mail accounts with iRedAdmin-Pro? No
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====
Hi, alot of the threads/posts about email aliases results in using either MySQL or LDAP backend to do it. If you are like me using the free version of iRedMail, this can be tricky. Adding an email alias or a bunch of them via SQL/LDAP can be a tedious thing. Luckily there is an alternate way using the old traditional method of adding virtual aliases.
Only thing you need is to create a new virtual alias maps file and add in the virtual aliases in there. E.g:
INFO:
virtual domain = abc.com
virtual alias file = /usr/local/etc/postfix/yada_maps (/etc/postfix/ on Linux)
yada_maps:
tom@abc.com tom@xyc.com
jane@abc.com jane@someemail.com
Then 'postmap yada_maps' so it creates the hash db file called 'yada_maps.db'. You need to run the postmap command everytime you make changes in the file.
Next edit the main.cf file and look for this line:
virtual_alias_maps =
proxy:mysql:/usr/local/etc/postfix/mysql/virtual_alias_maps.cf
Change it to look like this:
virtual_alias_maps =
proxy:mysql:/usr/local/etc/postfix/mysql/virtual_alias_maps.cf,hash:/usr/local/etc/postfix/yada_maps
Then reload postfix with 'postfix reload'
Now you can test by sending an email from an external source and while doing it check the mail logs.
Good luck.
- Zod
----
Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.