Howto make a simple mail server

Note

This guide is fairly old. For a more complete and up-to-date guide, see the wiki at:
https://wiki.nethserver.org/doku.php?id=email_protection_resources

Target

I would like to create a step by step howto for basic configuration of a public mail server.
It might be useful for users who configure a mail server for first time

then…
I have an ADSL and Nethserver, how can I create a mail server?


What do you need to start:

  • Nethserver: :slight_smile:
  • ADSL with static IP. Any other solution (dyndns, noip or similar) not works
  • Domain for mail: you have to buy a domain (mydomain.com) from a provider

Nethserver:

  • Perform basic installation: For simplicity set Nethserver domain as purchased domain (mydomain.com)
    Fom NethServer web interface
  • Software Center: install E-mail, Groupware SOGo and perform upgrades
  • Users: create users, automatically will be created email user@domain (name@mydomain.com)
  • Email Address: If necessary, create aliases and assign them to users.
    This creates the address alias@domain, additional email address for user@domain
  • Group: If required create new group and assign users. Will be created automatically the address group@domain (assistence@mydomain.com).
    the recipients will be all group members
  • Email: If Nethserver domain is different than purchased domain, you have to add the purchased domain (mydomain.com)

Server is ready!
Try to open sogo (https://IPNethserver/SOGo) and send / receive LOCAL email .


ADSL router:

  • Check your public ip
  • Set port forwarding (NAT) for TCP Port 25 (SMTP), 443 (https), 465 (SMTPS), 587, 993 (IMAPS) to NethServer IP.
  • If required by firewall allow traffic on these ports

The router is ok !!
From an external network try to access via telnet (putty) to your public IP on port 25


DNS:

This should be done through the tools provided by DNS provider

  • Create a HOST with nethserver name (eg. Nethserver.mydomain.com) and your public IP
  • Set the HOST just created as MX record
  • Optional. If you want to increase security, you can set the TXT record to limit sending servers for your domain. (es. v = spf1 mx ip4:X.Y.Z.K ~all)

This must be requested at adsl provider

  • Set PRT record (reverse DNS) for your public IP to nethserver public name (the one entered in the records MX)

DNS changes take several hours to be active.

DNS is configured !!
Try to connect, from external connection, to SOGO (https://nethserver.mydomain.com/SOGo)
Try sending email to your new address.

Have fun

13 Likes

I love this howto, it is going to be a good reference for everyone that tries to setup a mail server. Nice job man happy to have you here. :wink:

5 Likes

what about setting upt receiving server. it seems able to send emails, but receiving emails is the hard task

Sorry my ignorance but, where must I create the users?, Must I use a different server with LDAP installed or is possible creare users directly in Nethserver?

You can create users on NethServer through “Users and groups”.
If you don’t have yet configured an Account provider, NS will ask to configure and you will chose LDAP to run on NS.
Or, first you will create an Account provider through Configuration -> Accounts provider and then create users through Management -> Users and groups.

Seems to me the content in the OP should be deprecated in favor of https://wiki.nethserver.org/doku.php?id=email_protection_resources. The latter is both more up-to-date and more comprehensive, and it can be updated by anyone with a wiki account (for some reason, despite being in the Howto category, the OP in this topic isn’t a wiki post). Thoughts?

Just converted into a wiki. It’s a old howto

1 Like

Thanks. Edited the OP to start with a link to the wiki–I’ll leave it to others to decide whether to remove this text. I’d favor that, as it leaves only one resource to keep updated rather than two.

1 Like

Thanks! now is working

1 Like