[GH-ISSUE #1164] "Extra adresses" not working as expected with smtpd_sender_login_maps #956

Closed
opened 2026-02-27 11:14:27 +03:00 by kerem · 3 comments
Owner

Originally created by @mundschenk-at on GitHub (Jun 30, 2017).
Original GitHub issue: https://github.com/modoboa/modoboa/issues/1164

Originally assigned to: @tonioo on GitHub.

Impacted versions

  • Modoboa: 1.7.4
  • installer used: No
  • Webserver: Nginx

Steps to reproduce

Add the recommended settings to main.cf:

smtpd_sender_login_maps = mysql:$config_directory/modoboa/sql-sender-login-mailboxes.cf,
        mysql:$config_directory/modoboa/sql-sender-login-aliases.cf,
        mysql:$config_directory/modoboa/sql-sender-login-mailboxes-extra.cf

Create two users, add the address of the first user to the second as an "extra address" and try to send mail for it.

Current behavior

The mail is rejected.

Expected behavior

The second user can send mail using the first users address as sender.

Solution

smtpd_sender_login_maps = unionmap:{
        mysql:$config_directory/modoboa/sql-sender-login-mailboxes.cf,
        mysql:$config_directory/modoboa/sql-sender-login-aliases.cf,
        mysql:$config_directory/modoboa/sql-sender-login-mailboxes-extra.cf }

While this solution needs Postfix 3.x, it provides the expected behavior (otherwise, Postfix stops a the first returned result of a query and smtpd_sender_login_maps lookups are resolved using the sender address).

Originally created by @mundschenk-at on GitHub (Jun 30, 2017). Original GitHub issue: https://github.com/modoboa/modoboa/issues/1164 Originally assigned to: @tonioo on GitHub. # Impacted versions * Modoboa: 1.7.4 * installer used: No * Webserver: Nginx # Steps to reproduce Add the recommended settings to `main.cf`: ``` smtpd_sender_login_maps = mysql:$config_directory/modoboa/sql-sender-login-mailboxes.cf, mysql:$config_directory/modoboa/sql-sender-login-aliases.cf, mysql:$config_directory/modoboa/sql-sender-login-mailboxes-extra.cf ``` Create two users, add the address of the first user to the second as an "extra address" and try to send mail for it. # Current behavior The mail is rejected. # Expected behavior The second user can send mail using the first users address as sender. # Solution ``` smtpd_sender_login_maps = unionmap:{ mysql:$config_directory/modoboa/sql-sender-login-mailboxes.cf, mysql:$config_directory/modoboa/sql-sender-login-aliases.cf, mysql:$config_directory/modoboa/sql-sender-login-mailboxes-extra.cf } ``` While this solution needs Postfix 3.x, it provides the expected behavior (otherwise, Postfix stops a the first returned result of a query and `smtpd_sender_login_maps` lookups are resolved using the _sender address_).
kerem 2026-02-27 11:14:27 +03:00
Author
Owner

@tonioo commented on GitHub (Dec 7, 2017):

@mundschenk-at Sorry about the lack of response.
Indeed, this use case won't be possible without a unionmap. Do you know a solution for postfix < 3 ?

<!-- gh-comment-id:349961025 --> @tonioo commented on GitHub (Dec 7, 2017): @mundschenk-at Sorry about the lack of response. Indeed, this use case won't be possible without a unionmap. Do you know a solution for postfix < 3 ?
Author
Owner

@mundschenk-at commented on GitHub (Dec 7, 2017):

You could merge the three queries into one? But that would probably be messy SQL wise. Mainly I think this is a documentation issue.

<!-- gh-comment-id:349962147 --> @mundschenk-at commented on GitHub (Dec 7, 2017): You could merge the three queries into one? But that would probably be messy SQL wise. Mainly I think this is a documentation issue.
Author
Owner

@tonioo commented on GitHub (Dec 7, 2017):

Indeed a SQL query using UNION statements could do the trick.

<!-- gh-comment-id:349962880 --> @tonioo commented on GitHub (Dec 7, 2017): Indeed a SQL query using ``UNION`` statements could do the trick.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/modoboa-modoboa#956
No description provided.