1 (edited by hifall 2020-02-09 08:56:29)

Topic: Implementing account-based mail redirecting with Postfix.

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 1.0
- Deployed with iRedMail Easy or the downloadable installer? downloadable installer
- Linux/BSD distribution name and version: Ubuntu 18.04LTS
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Web server (Apache or Nginx): Apache
- Manage mail accounts with iRedAdmin-Pro? No
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

Hello!

I wonder how I can implement account-based mail redirecting with Postfix.

It works like this:

1 the system creates an inbox for every sender who just signed up (e.g., some registration page);
2 a sender authenticates himself with Postfix (e.g., through Dovecot SASL);
3 he then connects to Postfix to send an email (e.g., through PHP);
4 Postfix redirects this email to a local inbox dedicated to that particular sender, for inspection later.

This system would allow multiple sender accounts, with each account having a separate inbox.

Many posts on the internet tell you how to redirect all emails to a specified user with a virtual alias table, but my need is different in that the redirecting is based on the sender's account.

Thank you so much.

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: Implementing account-based mail redirecting with Postfix.

Sounds like you need sender bcc:
https://docs.iredmail.org/monitor.incom … h.bcc.html

3

Re: Implementing account-based mail redirecting with Postfix.

Thanks for the helpful reply!

However, the username in the solution refers to a username in the mailbox table. Is it possible to use a username from Dovecot SASL (or Cyrus SASL)?

This way, the email would be redirected to a mailbox associated with an account in SASL, rather one in mailbox.

Thanks!

4

Re: Implementing account-based mail redirecting with Postfix.

It’s same thing in iRedMail. Both postfix and Dovecot query same SQL table to get/verify login username.

5

Re: Implementing account-based mail redirecting with Postfix.

ZhangHuangbin wrote:

It’s same thing in iRedMail. Both postfix and Dovecot query same SQL table to get/verify login username.

Awesome! Many thanks!