1

Topic: Use server on a primary domain name, instead of virtual host.

==== Required information ====
- iRedMail version: 0.9.0
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): LDAP
- Linux/BSD distribution name and version: Debian 7
- Related log if you're reporting an issue:
- Nginx
====

Hello,

i am trying to have iRedMail to use primary domain instead of virtual host, but i can't figure out how.

Here is the example:

For example I have domain myserver.com. iRedMail installer asks me to define a virtual host to be used as email domain.
I am entering 'mail' and have following as result: mail.myserver.com.
And all emails have addresses like postmaster@mail.myserver.com.

So my question is - how to make iredmail work on the primary domain and have email like postmaster@myserver.com
instead of postmaster@mail.myserver.com?

Also i'd like to know, how to make mail.myserver.com address for roundcube accessing.


Thanks!

----

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

2 (edited by 7t3chguy 2015-01-26 03:00:25)

Re: Use server on a primary domain name, instead of virtual host.

Set your server hostname fqdn to "mail.myserver.com" and your hostname to "mail"

Then in iRed installer use "myserver.com"

Later in nginx or Apache you can set up a vhost with server name of "mail.myserver.com" to access roundcube.

Reply to me directly with any questions , I have types exact configuration, currently in nginx on one server and again on one Apache based stack.

For best practices make sure that the ptr rDNS record points towards "mail.myserver.com" and that "mail.myserver.com" points at your external IP
This will mitigate your outgoing mail getting marked as spam.

3

Re: Use server on a primary domain name, instead of virtual host.

7t3chguy wrote:

Set your server hostname fqdn to "mail.myserver.com" and your hostname to "mail"

Then in iRed installer use "myserver.com"

Later in nginx or Apache you can set up a vhost with server name of "mail.myserver.com" to access roundcube.

Reply to me directly with any questions , I have types exact configuration, currently in nginx on one server and again on one Apache based stack.

For best practices make sure that the ptr rDNS record points towards "mail.myserver.com" and that "mail.myserver.com" points at your external IP
This will mitigate your outgoing mail getting marked as spam.


Thanks for help! Currently trying this solution.

What exactly iredmail needs fqdn for? Can i change it back after server installation?

4

Re: Use server on a primary domain name, instead of virtual host.

pro100sanya wrote:
7t3chguy wrote:

Set your server hostname fqdn to "mail.myserver.com" and your hostname to "mail"

Then in iRed installer use "myserver.com"

Later in nginx or Apache you can set up a vhost with server name of "mail.myserver.com" to access roundcube.

Reply to me directly with any questions , I have types exact configuration, currently in nginx on one server and again on one Apache based stack.

For best practices make sure that the ptr rDNS record points towards "mail.myserver.com" and that "mail.myserver.com" points at your external IP
This will mitigate your outgoing mail getting marked as spam.


Thanks for help! Currently trying this solution.

What exactly iredmail needs fqdn for? Can i change it back after server installation?

It uses it in the various config files, packages like postfix need it. You should be able to change it back afterwards in theory, in my opinion its silly leaving a server at the root of a domain FQDN wise, I'm curious what makes you want to change it back.

5

Re: Use server on a primary domain name, instead of virtual host.

Just finished installation. Currently i have postmaster@myserver.com, but for some reason root email address looks like root@mail.myserver.com. I am misunderstanding something. Why root has such address?
May be i should update /etc/hosts and provide host name not related to my domain in any case?
Like 127.0.0.1    mysuperhostname localhost ?

Let me describe the main idea of what i am doing: i want a private vps with all services i need.
Email, file hosting, docs, messaging etc. I live in russia and tired of sanctions, censorship etc...
So i've decided to move to my own server. And final goal is to have set of services, that will be accessible like this:
mail.myserver.com - for roundcube
ldap.myserver.com
cloud.myserver.com - for files
docs... etc.

I've started with email as supposed it is most complicated in installation.

If you could suggest me a scenario, how to correctly setup iredmail for my purposes, i will be really thankful!
I am going to use nginx and ldap.

6 (edited by 7t3chguy 2015-01-26 03:36:56)

Re: Use server on a primary domain name, instead of virtual host.

pro100sanya wrote:

Just finished installation. Currently i have postmaster@myserver.com, but for some reason root email address looks like root@mail.myserver.com. I am misunderstanding something. Why root has such address?
May be i should update /etc/hosts and provide host name not related to my domain in any case?
Like 127.0.0.1    mysuperhostname localhost ?

Let me describe the main idea of what i am doing: i want a private vps with all services i need.
Email, file hosting, docs, messaging etc. I live in russia and tired of sanctions, censorship etc...
So i've decided to move to my own server. And final goal is to have set of services, that will be accessible like this:
mail.myserver.com - for roundcube
ldap.myserver.com
cloud.myserver.com - for files
docs... etc.

I've started with email as supposed it is most complicated in installation.

If you could suggest me a scenario, how to correctly setup iredmail for my purposes, i will be really thankful!
I am going to use nginx and ldap.

I'm not using LDAP but that portion of the configuration is irrelevant to this. Alright, well then your best bet is to think up of a creative name for your server, like "cobra.myserver.com" this would also in the future allow you to spread services across multiple VPSes. I have 3 VPSes set up like this, "%name%.webdevguru.co.uk", then DNS manages what is on each server, most things are on one so most records point to "raven.webdevguru.co.uk", feel free to run DIG on my domain to see how all of my records are placed.
Once you decide on a name, and have had your server reset [best option], set your FQDN [or mysuperhostname] to "%name%.myserver.com" and your local hostname to "%name%".


-----
Just as a random thrown in tip, if you're wanting Data as well

pro100sanya wrote:

cloud.myserver.com - for files

then I recommend ownCloud, it'll provide you with CalDAV, CardDAV and WebDAV [Cloud//Files] with a nice WebUI and apps for several devices, along with proper compatibility with the WebDAV protocol. Works very nicely and authenticates directly against SASL IMAP. [Replacing Ugly SOGo] I can help you configure this too.
-----


After you set your hostname and hosts, reboot to make the changes apply. Then begin the iRedMail Installation, use "myserver.com" as your primary domain and configure everything how you want. If this works for you then I will help you with the NGinx setup for Roundcube Mail, I'll give you my conf to use as a template but lets get this first part working first.

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Just to clear up, your DNS Records later would look like [@ being root domain === "myserver.com"]
@          => A        :IP.AD.DR.00
cloud.@ => CNAME:@
mail.@  => CNAME:@
etc...
@          => TXT *2 for DKIM and SPF
@          => MX,Priority10:mail.@

7

Re: Use server on a primary domain name, instead of virtual host.

Done. I have correct domain name in email, roundcube and iredadmin is accessible and seems to be working fine.
I've added mail.@ cname record. Other records will add later, by example.
(offtopic: by the way, why i can't just add few A records pointing to the same ip address, why it is better to use cname record? thx)

Seems to be i am ready for next step! smile

8 (edited by 7t3chguy 2015-01-26 04:40:46)

Re: Use server on a primary domain name, instead of virtual host.

pro100sanya wrote:

Done. I have correct domain name in email, roundcube and iredadmin is accessible and seems to be working fine.
I've added mail.@ cname record. Other records will add later, by example.
(offtopic: by the way, why i can't just add few A records pointing to the same ip address, why it is better to use cname record? thx)

Seems to be i am ready for next step! smile

Its only better for management, if you ever change your IP Address then all the records will get automatically updates to the new one, feel free to use A/AAAA Records instead, I just assumed my own habit there sorry hah.
I'll most likely be writing an ownCloud Integration guide eventually but for now its best if you add me on something like Skype? Is that a good option for you?

9

Re: Use server on a primary domain name, instead of virtual host.

Thanks for info, will use it.

Sure, drop me your skype name, i will add you. For some reason my username is not unique ).

We could also continue here, to help somebody who has similar issue.

10

Re: Use server on a primary domain name, instead of virtual host.

pro100sanya wrote:

Thanks for info, will use it.

Sure, drop me your skype name, i will add you. For some reason my username is not unique ).

We could also continue here, to help somebody who has similar issue.


xxt3chguyxx

Well I'm planning to write a guide for ownCloud Integration and similar tweaks in a week or so, rather not have someone confused by bits of comments and then blaming me for system catastrophy :')

11

Re: Use server on a primary domain name, instead of virtual host.

Got it. Ok, i've sent you and invitation in the skype

12

Re: Use server on a primary domain name, instead of virtual host.

pro100sanya wrote:

Got it. Ok, i've sent you and invitation in the skype

I hope that now everything is working as you would like it to so far, feel free to message me in the future if you have any issues!!

13

Re: Use server on a primary domain name, instead of virtual host.

7t3chguy wrote:

Set your server hostname fqdn to "mail.myserver.com" and your hostname to "mail"

Then in iRed installer use "myserver.com"

Later in nginx or Apache you can set up a vhost with server name of "mail.myserver.com" to access roundcube.

Reply to me directly with any questions , I have types exact configuration, currently in nginx on one server and again on one Apache based stack.

For best practices make sure that the ptr rDNS record points towards "mail.myserver.com" and that "mail.myserver.com" points at your external IP
This will mitigate your outgoing mail getting marked as spam.

HI... Just installed iRedMail.  Here's my question(s).  I want to use my box as a specific Mail Server only.

1.  Following some guidance i found somewhere, I set my fqdn to mx.myserver.com and my hostname to mx.  What should i have these set at?
2.  I want to be able to send and receive mail from this server to/from emails outside my internatl network.  I currently have my own domain name that I registered through GoDaddy.  Do you know what values I would need to enter there?
3.  Would i need to open any specific ports on my router using port forwarding?
4.  Once I get my SSL Certificate do I need to do anything to get that information in iRedMail?

Sorry for all the questions but I'm a total newbie at this mailserver thing.

Thanks for any information.

14

Re: Use server on a primary domain name, instead of virtual host.

BigC55 wrote:
7t3chguy wrote:

Set your server hostname fqdn to "mail.myserver.com" and your hostname to "mail"

Then in iRed installer use "myserver.com"

Later in nginx or Apache you can set up a vhost with server name of "mail.myserver.com" to access roundcube.

Reply to me directly with any questions , I have types exact configuration, currently in nginx on one server and again on one Apache based stack.

For best practices make sure that the ptr rDNS record points towards "mail.myserver.com" and that "mail.myserver.com" points at your external IP
This will mitigate your outgoing mail getting marked as spam.

HI... Just installed iRedMail.  Here's my question(s).  I want to use my box as a specific Mail Server only.

1.  Following some guidance i found somewhere, I set my fqdn to mx.myserver.com and my hostname to mx.  What should i have these set at?
2.  I want to be able to send and receive mail from this server to/from emails outside my internatl network.  I currently have my own domain name that I registered through GoDaddy.  Do you know what values I would need to enter there?
3.  Would i need to open any specific ports on my router using port forwarding?
4.  Once I get my SSL Certificate do I need to do anything to get that information in iRedMail?

Sorry for all the questions but I'm a total newbie at this mailserver thing.

Thanks for any information.

1. Set your FQDN to something like mail.mydomain.com or mx.mydomain.com, and your local hostname to the first part of that [mail/mx]

2. Use the following:
%please substitute mx and mydomain.com accordingly, #assumingLogic%

A Record: mx.mydomain.com -> IP.AD.DR.00 [Your External IP Address]
MX Record: @ [root of your domain] -> mx.mydomain.com


3. http://www.iredmail.org/forum/topic209- … ports.html

4. http://www.iredmail.org/docs/use.a.boug … icate.html

15

Re: Use server on a primary domain name, instead of virtual host.

BigC55 wrote:

1.  Following some guidance i found somewhere, I set my fqdn to mx.myserver.com and my hostname to mx.  What should i have these set at?

This is mentioned in iRedMail installation guide. For example, if you're running RHEL/CentOS, check our installation guide here:
http://www.iredmail.org/docs/install.ir … our-server
Installation guides for other Linux/BSD distributions are available here:
http://www.iredmail.org/docs/