[GH-ISSUE #791] aliases not working #707

Closed
opened 2026-02-27 11:13:08 +03:00 by kerem · 7 comments
Owner

Originally created by @daks on GitHub (Nov 23, 2015).
Original GitHub issue: https://github.com/modoboa/modoboa/issues/791

Hello,

I'm using Modoboa 1.3.5 with Postfix and Dovecot on Debian 8.
I just switch my main domain my-domain.tld from relay to destination using Modoboa.
I created an identity user@my-domain.tld and an alias *@my-domain.tld pointing to user@my-domain.tld

Sending e-mail to user@my-domain.tld works well but not sending to another-user@my-domain.tld.

When I look at syslog messages, I see the following:

Nov 23 20:57:47 host postfix/smtp[24929]: 9C08C1432D8: to=<another-user@my-domain.tld>, relay=none, delay=0.17, delays=0.11/0.04/0.03/0, dsn=4.4.1, status=deferred (connect to mx2.mydomain.tld[95.142.166.104]:25: Connection refused)

(connection refused is normal because i stopped postfix on the old server)

If I look at MySQL tables it seems ok:

mysql> select * from admin_domain;
+----+----------------------+-------+---------+----------+--------+
| id | name                 | quota | enabled | dates_id | type   |
+----+----------------------+-------+---------+----------+--------+
|  7 | my-domain.tld        |     0 |       1 |       17 | domain |
+----+----------------------+-------+---------+----------+--------+

I don't understand what is wrong. Do you have any idea and what I can't do to come back quickly to a functional setting?

Originally created by @daks on GitHub (Nov 23, 2015). Original GitHub issue: https://github.com/modoboa/modoboa/issues/791 Hello, I'm using Modoboa 1.3.5 with Postfix and Dovecot on Debian 8. I just switch my main domain my-domain.tld from relay to destination using Modoboa. I created an identity user@my-domain.tld and an alias *@my-domain.tld pointing to user@my-domain.tld Sending e-mail to user@my-domain.tld works well but not sending to another-user@my-domain.tld. When I look at syslog messages, I see the following: ``` Nov 23 20:57:47 host postfix/smtp[24929]: 9C08C1432D8: to=<another-user@my-domain.tld>, relay=none, delay=0.17, delays=0.11/0.04/0.03/0, dsn=4.4.1, status=deferred (connect to mx2.mydomain.tld[95.142.166.104]:25: Connection refused) ``` (connection refused is normal because i stopped postfix on the old server) If I look at MySQL tables it seems ok: ``` mysql> select * from admin_domain; +----+----------------------+-------+---------+----------+--------+ | id | name | quota | enabled | dates_id | type | +----+----------------------+-------+---------+----------+--------+ | 7 | my-domain.tld | 0 | 1 | 17 | domain | +----+----------------------+-------+---------+----------+--------+ ``` I don't understand what is wrong. Do you have any idea and what I can't do to come back quickly to a functional setting?
kerem closed this issue 2026-02-27 11:13:08 +03:00
Author
Owner

@daks commented on GitHub (Nov 23, 2015):

I looked at postfix_relay_domains_relaydomain:

mysql> select * from postfix_relay_domains_relaydomain;
+----+----------------------+-------------------+----------+------------+-----------+
| id | target_host          | verify_recipients | dates_id | service_id | domain_id |
+----+----------------------+-------------------+----------+------------+-----------+
|  2 | mx2.my-domain.tld    |                 0 |       18 |          1 |         7 |
+----+----------------------+-------------------+----------+------------+-----------+

the domain_id is the same as my-domain.tld so I removed this line. (and others like this)

This solved my 'relay' problem.

I now have a 'user doesn't exist' error which seems strange because I don't think I have configured this restriction, but it may have nothing to do with this issue.

edit i think I have another problem with my *@ aliases: until I found what is going wrong, I explicitely created user1@, user2@...

<!-- gh-comment-id:159052528 --> @daks commented on GitHub (Nov 23, 2015): I looked at postfix_relay_domains_relaydomain: ``` mysql> select * from postfix_relay_domains_relaydomain; +----+----------------------+-------------------+----------+------------+-----------+ | id | target_host | verify_recipients | dates_id | service_id | domain_id | +----+----------------------+-------------------+----------+------------+-----------+ | 2 | mx2.my-domain.tld | 0 | 18 | 1 | 7 | +----+----------------------+-------------------+----------+------------+-----------+ ``` the domain_id is the same as my-domain.tld so I removed this line. (and others like this) This solved my 'relay' problem. I now have a 'user doesn't exist' error which seems strange because I don't think I have configured this restriction, but it may have nothing to do with this issue. **edit** i think I have another problem with my *@ aliases: until I found what is going wrong, I explicitely created user1@, user2@...
Author
Owner

@daks commented on GitHub (Nov 23, 2015):

I looked at the sql-aliases.cf map file generated by Modoboa, it looks like

user = mysql-user
password = password
dbname = dbname
hosts = 127.0.0.1
query = SELECT alr.address FROM modoboa_admin_aliasrecipient AS alr INNER JOIN admin_alias AS al ON alr.alias_id=al.id WHERE al.enabled=1 AND al.address='%s'

when I try this mysql query for user1@my-domain.tld it returns nothing.
It works if I query with *@sietch-tabr.com but not with user1@ -> could it be the reason for my problem?

<!-- gh-comment-id:159073029 --> @daks commented on GitHub (Nov 23, 2015): I looked at the sql-aliases.cf map file generated by Modoboa, it looks like ``` user = mysql-user password = password dbname = dbname hosts = 127.0.0.1 query = SELECT alr.address FROM modoboa_admin_aliasrecipient AS alr INNER JOIN admin_alias AS al ON alr.alias_id=al.id WHERE al.enabled=1 AND al.address='%s' ``` when I try this mysql query for user1@my-domain.tld it returns nothing. It works if I query with *@sietch-tabr.com but not with user1@ -> could it be the reason for my problem?
Author
Owner

@daks commented on GitHub (Nov 23, 2015):

I think I have found my problem: I changed all my wildcard aliases from *@my-domain.tld to @my-domain.tld

<!-- gh-comment-id:159074767 --> @daks commented on GitHub (Nov 23, 2015): I think I have found my problem: I changed all my wildcard aliases from *@my-domain.tld to @my-domain.tld
Author
Owner

@tonioo commented on GitHub (Nov 24, 2015):

Indeed, the format to define a catchall alias does not include the * character anymore. So, do you have still have an issue ?

<!-- gh-comment-id:159212281 --> @tonioo commented on GitHub (Nov 24, 2015): Indeed, the format to define a catchall alias does not include the \* character anymore. So, do you have still have an issue ?
Author
Owner

@daks commented on GitHub (Nov 24, 2015):

No, it's ok now. Sorry for not closing the issue after my long fight with this issue last night :)

Is it normal that the 'postfix_relay_domains_relaydomain' still had the entries for the domains i switched from relay to destination?

<!-- gh-comment-id:159370795 --> @daks commented on GitHub (Nov 24, 2015): No, it's ok now. Sorry for not closing the issue after my long fight with this issue last night :) Is it normal that the 'postfix_relay_domains_relaydomain' still had the entries for the domains i switched from relay to destination?
Author
Owner

@tonioo commented on GitHub (Nov 25, 2015):

Yes... I don't clean old records when a "relay domain" becomes a "domain". Could you please create a dedicated issue about this ?

<!-- gh-comment-id:159530999 --> @tonioo commented on GitHub (Nov 25, 2015): Yes... I don't clean old records when a "relay domain" becomes a "domain". Could you please create a dedicated issue about this ?
Author
Owner

@daks commented on GitHub (Nov 25, 2015):

done.

<!-- gh-comment-id:159632741 --> @daks commented on GitHub (Nov 25, 2015): done.
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#707
No description provided.