3

I want to send the mail from one server to an external domain (xxx@yyy.com).

How can I implement this?

Rui F Ribeiro
  • 56,709
  • 26
  • 150
  • 232
  • Email makes use of MX records from DNS. Take a peek at this FAQ from Google: http://www.google.com/support/enterprise/static/postini/docs/admin/en/activate/mx_faq.html. – slm Jun 20 '15 at 20:54
  • Does it needs any relay server? – KALAI SELVAN Jun 20 '15 at 21:16
  • 1
    You need a server that will accept your mail for delivery. That server will in turn lookup what mx handles the domain your attempting to send mail to. – slm Jun 20 '15 at 21:20
  • 1
    https://en.wikipedia.org/wiki/Open_mail_relay. Setting up a servers is too broad. List what distros you have what mail clients anscsevers you have. – slm Jun 20 '15 at 21:27
  • Is it possible to relay without the relay server. – KALAI SELVAN Jun 20 '15 at 21:57

1 Answers1

3

If you are configuring a mail server, it should be able to send mail just about anywhere on its own. It may be a relay server for your own netwwork, but should not relay from the Internet to the Internet.

For a properly configured mail server you will need:

  • A domain to configure the mail server within. While you can call the host the mail server runs on, it is good practice to use a subdomain like mail, smtp or mta.
  • A static IP address. Have its PTR record configured to return the FQDN (Fully Qualified Domain Name) you have chosen for your mail server. Configure an A record for the mail server with this IP. (You can also configure an A record with this IP for the host the mail server is running on.)
  • Mail server software. (I prefer Exim, but other use postfix, sendmail or orther software.) Configure the server to identify itself using the FQDN you have chosen for the mail server.
  • Configure the postmaster and abuse addresses on the mail server to forward mail to you.

You should now have a working mail server. There is some additional work you will want to do.

  • Configure a spam filter. You will soon be getting spam.
  • Configure any domains you want the mail server to accept mail for with an MX record.
  • Configure an SPF record for the mail servers FQDN. Create a TXT record containing v=spf1 a mx -all.
  • Configure SPF records for all domains that don't send email (i.e. www.example.com). Create a TXT record containing v=spf1 -all.
  • Configure SPF records for domains you will be receiving mail for. A TXT record containing v=spf1 mx ~all would be a starting point. Research and implement a better policy.
  • Research DKIM and start signing outgoing email.
  • Research DMARC and configure DNS accordingly.
  • Configure the Submission port with authentication to allow authorized remote and local users to authenticate and send email from your server,

As you work run tests to ensure you are properly configured.

Most of the above is not required if you are sending within your own network, or to a co-operating network which will relay for you. I would still recommend setting up SPF, especially for your servers.

While SPF was originally intended to protect envelope sender (MAIL FROM) addresses, it is much more reliable in protecting the server address (HELO, and/or rDNS). Almost anything return other than pass or none is a strong indication of a spoofed host address.

BillThor
  • 8,965
  • Is it possible to send or receive mails without mx record set for my domain. – KALAI SELVAN Jun 22 '15 at 00:29
  • @KALAISELVAN You can send mail without an MX record. Large organizations often use dedicated servers for outbound mail that are not listed as an MX. You can only receive mail without an MX record if the A record resolves to the IP address of your mail server. However, I would recommend using an MX pointing to a mail server's A record. – BillThor Jun 22 '15 at 01:38