Topic: alias and alias_domain
==== Required information ====
- iRedMail version:
- Store mail accounts in which backend (LDAP/MySQL/PGSQL):
- Web server (Apache or Nginx):
- Linux/BSD distribution name and version:
- Related log if you're reporting an issue:
======== Required information ====
- iRedMail version: iRedAdmin-Pro v1.8.2 (MySQL)
- Store mail accounts in which backend (MySQL):
- Web server (Apache):
- Linux/BSD distribution name and version: CentOS 6.6
- Related log if you're reporting an issue: N/A
====
I don't have a question so much as a request for comments/advice. I needed to enable the postfix directive 'reject_sender_login_mismatch' but retain the ability for users with aliases and alias domains to be able to send mail with the alias or alias_domain. I changed the sender_login_maps.cf file to have this query (newlines added for readability):
--------------------------------
SELECT
mailbox.username
FROM mailbox,domain
WHERE mailbox.username='%s' AND mailbox.domain='%d' AND mailbox.domain=domain.domain AND mailbox.enablesmtp=1 AND mailbox.active=1 AND domain.backupmx=0 AND domain.active=1
UNION
SELECT goto as username
FROM alias
WHERE alias.address='%s' and alias.domain='%d' and alias.active=1
UNION
SELECT alias.goto
FROM alias,alias_domain,domain
WHERE alias_domain.alias_domain='%d' AND alias.address=CONCAT('%u', '@', alias_domain.target_domain) AND alias_domain.target_domain=domain.domain AND alias.active=1 AND alias_domain.active=1 AND domain.backupmx=0
--------------------------------
This is partly based on the submission of user 'iredmail' from this thread:
http://www.iredmail.org/forum/topic4915 … iases.html
This query seems to work just fine, but does anyone have any better or more efficient methods for doing the same thing with reject_sender_login_mismatch enabled?
----
Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.