1 (edited by cmotdibbler 2016-05-18 22:16:12)

Topic: Cannot get aliases to work

==== Required information ====
- iRedMail version: 0.9.5-1
- Linux: CentOS 6
- Store: MySQL
- Web server: Apache
- iRedAdmin-Pro? No
====

I've been trying to get my mail working for a couple of days and I'm ready to give up, so this post is my last resort. Anyway, I have installed iRedMail on clean server, set up SSL certificates and added a new user account using SQL script in the tools folder.

My server is hosted on something.com. During installation, I had to pick my first mail domain and it said I cannot use something.com so I have used mail.something.com.

I have set my DNS records as well:
CNAME/A: mail.something.com    something.com
MX: something.com                      mail.something.com
SPF: something.com                     v=spf1 ip4:xxxx -all

If I send mail to user@mail.something.com it works. If I send mail to user@something.com I get the following:
Recipient address rejected: User unknown in local recipient table

However, if I send mail to postmaster@something.com it works (postmaster was automatically created during installation).

I have tried to create alias in MySQL using the following command (found on iRedMail page):

INSERT INTO alias (address, goto, created, active) VALUES ('user@mail.something.com', 'user@something.com', NOW(), 1);

This gave me an error because user@mail.something.com already exists (I have created it with the SQL script). I have then updated the goto field to user@mail.something.com,user@something.com. This didn't work.

I have then tried adding a new entry as follows:

INSERT INTO alias (address, goto, created, active) VALUES ('user@something.com', 'user@mail.something.com', NOW(), 1);

This didn't work either and I was still getting User unknown in local recipient table errors.

I saw that the alias table has is_alias and alias_to columns. I have updated those as well with values 1 and user@mail.something.com and it didn't work either.

I really don't know what else to try. I haven't listed everything above, but I've tried a lot of different combinations of aliases, goto addresses, domain names etc. Nothing has worked that would allow me to send mail to user@something.com.

Please let me know if you have any suggestions at what I might be doing wrong. I can provide logs, config files as well.

Thanks for taking the time to help me out.

Edit:
My postfix/main.cf settings:

myhostname = something.com
myorigin = something.com
mydomain = something.com

----

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

2

Re: Cannot get aliases to work

cmotdibbler wrote:

My server is hosted on something.com. During installation, I had to pick my first mail domain and it said I cannot use something.com so I have used mail.something.com.

This is the mistake.

Why not set your server hostname to 'mail.something.com', or 'mx.something.com', or 'whatever.something.com', then you can use 'something.com' as first mail domain name?

3

Re: Cannot get aliases to work

Besides having a mail server, I also have a web server/page on something.com, so I'm not sure I can change it to whatever.something.com, because that would break the web server.

I think I have managed to solve my problem, but I'm not sure if there are any risks behind it. I have created a new entry in the vmail.alias_domain table (mail.something.com -> something.com). After doing this, I am able to send mail to user@something.com and it gets through without any errors in the log. Do you think this is a good solution to my problem?

4

Re: Cannot get aliases to work

cmotdibbler wrote:

Besides having a mail server, I also have a web server/page on something.com, so I'm not sure I can change it to whatever.something.com, because that would break the web server.

Sure you can. The web domain name is controlled by web server (Apache/Nginx), it's ok to use any valid domain name in web server.

The server hostname is used when your local application sends email to system user, e.g. root. so it cannot be the same as VIRTUAL mail domain name (which is stored in SQL/LDAP).

cmotdibbler wrote:

I think I have managed to solve my problem, but I'm not sure if there are any risks behind it. I have created a new entry in the vmail.alias_domain table (mail.something.com -> something.com). After doing this, I am able to send mail to user@something.com and it gets through without any errors in the log. Do you think this is a good solution to my problem?

WRONG.

5

Re: Cannot get aliases to work

Hi Zhang, thanks for your reply.

If I understand correctly, your suggestion is that I rename my hostname to mail.something.com and when installing RedMail use something.com as my domain?

6

Re: Cannot get aliases to work

cmotdibbler wrote:

If I understand correctly, your suggestion is that I rename my hostname to mail.something.com and when installing RedMail use something.com as my domain?

exactly.