How to set up smartphones and PCs. Informational portal
  • home
  • Safety
  • How to create your own smtp server on windows. Windows Azure endpoint

How to create your own smtp server on windows. Windows Azure endpoint

One of the main elements is the configuration of the SMTP server. Consider what it is and how to make desired settings for different situations.

What is SMTP?

The abbreviation SMTP comes from the English phrase, which means "simple mail sending protocol". Basically, its scope is limited to TCP / IP-based networks and the user layer.

Any mail program, often referred to as a mail client, has special settings allowing you to configure the protocol parameters. It is through him that everything emails sent to the mail server, where they expect relaying. Initially, the SMTP server uses TCP port 25. However, with the development of services Email settings can change significantly.

Do I need to configure the server when sending a letter from a mail service?

As a rule, any Post service on the Internet, offering users services for sending and receiving e-mail, is already equipped with a pre-configured SMTP server. That is, the user does not need to produce anything.

The services themselves for entering your own mailbox require the user only to enter the login and password specified during registration, and setting up, for example, the Mail.Ru SMTP server is not required just for the reason that all this was done in the service itself (without this, the service simply would not work) ... But what to do if the user does not use Internet resources for some reason, but prefers standard clients like Microsoft Outlook Express and Outlook or third-party software products, while having a registered mailbox in the Internet service?

We configure the SMTP server (Mail.Ru is the mail service where the mailbox is registered)

Let's take a look at the standard parameters that should be applied to this service... Regardless of the used mail client absolutely all settings will be identical.

So, in order to properly configure the Mail.Ru SMTP server, you should set the following parameters:

  • outgoing mail server - smtp.mail.ru;
  • username - full name of the email address registered in the service;
  • password - the current code combination of letters, numbers and symbols used to enter the box;
  • port when SSL / TLS encryption protocol is selected - 465.

After these settings take effect, mail can be received directly in the used user program... As you can see, the port of the SMTP server differs from the standard (25), but this is due to the TCP / IP protocols.

Configuring the SMTP server on Yandex

The Yandex.Ru service is no less popular. The SMTP server for it is configured in a completely similar way.

However, the smtp.yandex.ru address is used for the outgoing server, the port is set to 465, but only TLS is set in the security settings.

Installing an SMTP server for mailing

Now let's move on to more difficult situations when the user for some reason (for example, to promote his own business or website) needs to send bulk. There is no point in doing this manually using online services or email clients, if only for the reason that it takes too much time and effort. Therefore, you can do it in two ways - buy a ready-made configured SMTP server or configure it yourself.

In the first case, if a "white" server is purchased, this will require significant costs, as well as compliance with all conditions of the developer or seller. You can, of course, purchase a "gray" server, but there is no guarantee that it will not be included in the spam databases. search engines... This is fraught only with the fact that the same Yandex, upon receipt of letters from the specified sources, will simply filter them and send them to the spam section, while Mail.Ru and Google mark the correspondence with the corresponding spam index. Setting up an SMTP server manually looks both more reliable and more economical in terms of financial costs.

First you need to purchase VPS server with the operating system Centos version 6 or higher. Notice immediately if it is possible to enter a PTR record that will accurately identify the canonical domain name by the receiving server.

Next, you need to install the Vesta panel. As an example, we will use the PuTTY utility, which you need to download, install and run. In the settings, we immediately register the IP address of the server, then press the Open button and register the root login and password provided when purchasing a VPS server.

Now we sequentially enter the following commands:

curl -O http://vestacp.com/pub/vst-install.sh

bash vst-install.sh

If an error occurs, we solve it using the combination:

bash vst-install-rhel.sh —force

After that, enter a valid address e-mail and hostname. After 5-10 minutes, the panel will be installed.

https: // Server IP: 8083

A window appears where you need to enter a name root user and the provided password.

At the next stage, we register the domain and go to the DNS settings panel, where we change places and A.

We are waiting for the DNS zones to be updated and go to the WEB tab in the Vesta panel, where we add the registered domain.

After that, we register SMTP accounts in the Mail section. To check in the same section, use the Open Webmail tab. In the EXIM server window that appears, enter the parameters of the created SMTP and send a test letter. If everything is fine, you can congratulate yourself.

Please note that in some cases, bulk mailing may require a digital signature(not to be confused with the PTR record, which is only responsible for the authenticity of a domain or host). If it is absent, some receiving services may treat the mailing with suspicion, and the incoming mail itself will be marked as questionable. So you need to take care of this in advance.

Instead of an afterword

It remains to add that setting up an SMTP server for mail clients is not as difficult as it might seem at first. But for mass mailings you will have to sweat over the setting, as they say. And you can use not only the option that was presented above. Some developers already offer automated systems creating and configuring such servers for a very reasonable fee (or even free of charge).

Server room monitoring devices and remote control with power supply have the ability to send e-mail notifications about the triggering of sensors and relays, as well as send periodic reports on the status of sensors according to a pre-configured schedule on the web interface page. But in the firmware of some devices, the sending module e-mail notifications and reports is implemented only for work with mail servers that support SMTP protocol and authentication method AUTH PLAIN. Moreover, the module sending e-mail notifications and reports may not support SSL, TLS, or other encryption.

To avoid problems with sending e-mail notifications from devices via SMTP servers that work without authorization, or that support the AUTH LOGIN authentication method and TLS encryption, you can use local SMTP relay from Microsoft, which is installed on Windows server operating systems in a few minutes and requires minimum setting to implement sending e-mail notifications.

As a result using SMTP relay in server Windows OS we have a working functionality for sending e-mail notifications from devices, regardless of the capabilities of the sendmail module implemented in the device firmware.

Requirements

To implement sending e-mail notifications via SMTP relay from Microsoft, you need to:

  • device (, UniPing server solution, , );
  • installed and configured SMTP relay;
  • local data transmission network;
  • Internet access for sending e-mail notifications from SMTP relay to an external SMTP server

Configuring SMTP relay in Windows OS

This article will discuss the installation and configuration of SMTP relay on the OS Windows Server 2012 R2.

By default, SMTP relay is not installed on Windows server operating systems. To implement sending e-mail notifications, you must first install SMTP relay. To do this, you need to connect to the server console with administrator rights. Open the "Server Manager" window and select the "Add roles and features" menu item:


The Add Roles and Features Wizard settings window will open. At the "Installation Type" stage, select the "Role-based or feature-based installation" checkbox - setting up roles and additional settings for this local server... Click the "Next>" button:


At the "Server Selection" stage, select the "Select a server from the server pool" checkbox with an available pool and click the "Next>" button:


At the "Features" stage, select "SMTP Server" from the list presented by installing the appropriate check-box:


When installing this check-box, a window will appear with a list of additional components that must be installed for full-fledged work SMTP relay. You need to agree with the list of additional components and click the "Add Features" button:


The last step is to validate the components selected in the previous steps. If the preparation was carried out correctly, then it remains to click the "Install" button and wait for the installation to complete.

SMTP relay is configured in the "Internet Information Services (IIS) 6.0 Manager" console. To start the console open the “Server Manager” window. In the upper right menu select "Tools"> "Internet Information Services (IIS) 6.0 Manager":


The SMTP relay configuration process is carried out in the properties of the "SMTP Virtual Server # 1" virtual server (you can create any number of virtual servers as needed):


In the SMTP relay properties on the "General" tab, it is recommended to activate the entry of the virtual server operation event log using the "Enable logging" checkbox:

The "Properties ..." button opens a window with additional settings event log, you can immediately configure the information that will be displayed in the log, as well as select the location for storing the log files.

In the SMTP relay properties on the "Access" tab, you need to configure several parameters: "Relay ..." and "Authentication ...".

The "Relay ..." function implements setting up IP addresses to which the sending of letters will be allowed. If no additional restrictions are required, you must select " All except the list below ". This will allow sending letters to all addresses.



The "Authentication ..." function allows you to configure authentication to this virtual server:



In the window "Authentication" you can choose to use anonymous access to the server, or configure basic basic authentication with TLS encryption if necessary. Setting up anonymous access limited to check-box installation "Anonymous access". If you need to configure basic authentication, then in addition to installing the checkbox "Basic authentication" you need add users who are allowed to send mail. To do this, on the "Security" tab, click the " Add ... "And add the required users. In the example, the "smtprelay" account, which was created in the "TST" domain, was added to send e-mail notifications. This account will be specified in the device settings on the “E-MAIL” page of the web interface. Sending mail through the system administrator account may not work, so it is advisable to add another user!

In the SMTP relay properties on the Delivery tab, you can configure the connection to an external mail server for sending e-mail messages to the specified recipients. Here you need to configure the following parameters: "Outbound Security ...", "Outbound connections ..." and "Advanced ...".

Customization "Outbound Security ..." allows you to set the authentication method for connecting to an external SMTP server. Let's say you need to configure basic authentication to the connected SMTP server on the Internet. To do this, you need to install a checkbox "Basic authentication" and register a username and password. The username and password must be obtained from the administrator of this server.

Customization "Outbound connections ..."allows you to set the required TCP port for communication, for example, 2525:


Customization "Advanced ..." allows you to write a complete Domain name(the address used in MX records) or the IP address of the remote SMTP server:


To check the correctness of the entered fully qualified domain name, you need to start the check by clicking the button Check DNS. A successful result is accompanied by the following message:

Checking the functionality of SMTP relay in Windows

1. To check the functionality of SMTP relay, you need to run the command line ( Start> Run , enter the name of the executable file command line "Cmd", press " OK") and write a command that allows you to connect to the SMTP server via telnet:

If the server service is working correctly, then the following message will appear in response to the above command (that is, the connection to the SMTP relay is complete):

2. To check if SMTP relay is sending to third party SMTP server e-mail messages, you need to create a text file with the following content:


Copy the file to the folder along the path: "C: \ inetpub \ mailroot \ Pickup ". If after copying a file from the “Pickup »Disappears and the previously created message in text file arrives at the addressee, then the SMTP relay is fully operational.

Debugging SMTP relay on Windows

If, for some reason, e-mail messages do not come to recipients, you should check the following settings:

1. Is it open in firewall TCP port 25;

2. Whether the SMTP relay server service is running;

3. Does third party SMTP accept e-mail server messages;

4. Whether the server's IP address is on the spam list;

5. Is web.config spelled correctly? It should be like this:



from = "specify_e-mail">
pickupDirectoryLocation = "C: \ inetpub \ mailroot \ Pickup" />


If you have a small office and it is too expensive for you to buy Exchange and you don't have * nix- then this review is for you.

1) hMailServer

A fairly simple and convenient server. Includes IMAP / POP3 / SMTP server. There is a built-in anti-spam system. For those who like to watch mail through Web- you need to screw it on separately Web- muzzle.

2) Mail Enable

Note that there are free and paid versions of this product. Includes POP3 / SMTP but does not have IMAP server. But there is a built-in Web interface (which I never managed to get to work on IIS7)

3) XMail

A fairly simple and functional mail server ( POP3 / ESMTP, but no IMAP) with support for several types of authorization ( PLAIN LOGIN CRAM-MD5 POP3-before-SMTP and custom)

4) Office Mail Server

There is no official website as the project is not developing. But you can download it from here http://www.box.com/oms

Simple, compact but full-featured mail server for local area network with dial-up Internet connection. Works under Windows 95-98-NT-ME-2000... Can work like NT service. Powerful sorter allows you to provide every user on the local network personal address Email. The program combines POP3 and SMTP servers, POP3 and SMTP clients, sorter, session scheduler, dialer and shell for configuring the server through the menu system and dialogs.

5) shicks!

Simple POP3 / SMTP server written in python'e

6) Courier Mail Server

Almost the same Courier Mail Server 1.56 (completely free) - however, there is minor flaws... For example, a glitch with displaying the interface when working with the server through a terminal session. However, this does not affect the work of the post office. Its revised version 2.xx - www.courierms.ru Unfortunately, paid. Only up to 3 mailboxes work for free in it.

7) UserGate Mail Server

UserGate Mail Server Is a solution for organizing secure email messages in a company with built-in antispam modules and antivirus protection... The product possesses modular structure, which increases fault tolerance and makes it possible to run the server on a distributed system.
Among the main functions UserGate Mail Server- domain and user management, web client, mailing list support, work with remote accounts, support LDAP as well as flexible and powerful system rules. UserGate Mail Server able to handle more 2000 letters per minute.
To provide access to mail in UserGate Mail Server implemented protocol support SSL, POP3s, SMTPs and IMAPs... Email security can now be secured by three antivirus modules: Kaspersky Antivirus, Panda antivirus and Entensys Zero-Hour based on "cloud" technologies.
In the processing of incoming messages in UserGate Mail Server filtering is performed in several stages - by connections, by source address, by destination address, and by content. UserGate Mail Server supports following methods spam filtering:
based DNS (DNSBL, RHSBL, Backscatter, MX, SPF, SURBL);
based on a distributed antispam system ("cloud" antispam);
based on statistics ( own implementation Bayesian filtering).
Besides UserGate Mail Server maintains control SMTP protocol (control of the correctness of commands in accordance with RFC), limits the maximum message size, maximum amount recipients, etc.
Cloud-based antispam in the mail server filters messages based on their content analysis and heuristics.
V UserGate Mail Server integration with IMAP- server MS Exchange or Lotus Domino... Integration provides the ability to create shared folder IMAP on a remote mail server and processing messages in these folders.
UserGate Mail Server provides information about all messages processed by the mail server. Message monitoring allows you to filter by date, processing status (delivered / blocked), source or destination address, force sending messages blocked as spam, and create exclusion lists.
Free license for 5 mailboxes
To get the opportunity free use UserGate Mail Server for 5 mailboxes requires:
Download the distribution kit; In the registration window UserGate Mail Server select "Get free version for 5 boxes ".
Part free license mail server does not include additional modules.
UserGate Mail Server supports backup mail messages, sending automatic replies, setting up rules for processing mail, managing services in the web console and choosing an arbitrary date range in the message history.

8) Rumble Mail Server

Rumble is a miniature mail server for personal use. The application can only be launched from the command line interface of your system.

Features of the "Rumble" program:
1.Support SMTP, POP3 and IMAP
2. Working with Apache
3. Easy to use
4. Rumble is free!

9) Humster

Hamster is free server application for Windows, which allows you to fully work with usenet news on the local network using the NNTP protocol and mail using the SMTP, POP3, IMAP protocols. Its feature is advanced message processing capabilities. It can independently collect mail from mailboxes on the Internet (similar to the functioning of the fetchmail program in * nix), send to a local mailbox after processing (similar to the functioning of the procmail program in * nix), distribute via POP3, send via SMTP and NNTP. There is a setting for user access rights to server resources. Rich macro language. SSL is supported.

10) Axigen

Axigen mail server is a communication server large class integrating SMTP, POP3, IMAP and WebMail services. Having very good setting and security, gives administrators excellent control over mail server traffic.

Today, when you can easily get any number of free mailboxes by simply registering an account with Yandex, Mail.Ru and the like, the issue of setting up a mail server does not bother too many users.

However, there are times when to know at least some aspects this issue will be helpful.

When you need it

There are not so many situations when an ordinary user needs basic knowledge of setting up mail. And nevertheless, any of them can happen at any time:

  • If it was decided to switch from browser to dedicated in a separate program... Indeed, in many respects, such clients are preferable: they allow you to combine mail program with organizer, notebook, as well as more flexible management address book and administer messages.
  • There was an unforeseen failure in the mail client, all the settings were lost. And then the installation of a mail server is simply necessary. Setting it up usually does not take much time and effort, but otherwise you can be left without mail for quite a long time.
  • Free mailboxes can be destroyed by the administration, and without explanation. Yes, and such a box looks in the eyes of business partners, frankly, undignified. Therefore, you will have to start a dedicated one on the server.
  • If the provider offers a separate mailbox, then why not take advantage of this offer.

Configuring Windows Mail Server

Basic email parameters such as DNS, IP data and similar information are issued directly by the provider.

To start using Windows, you will either need to download a suitable one for this operating system client, or resort to the help of built-in clients. First you need to create a new account. As a rule, they are also asked to enter its name, come up with a password and login to enter.

You may need to enable support for mail Windows services via the "Remove and Install Programs" panel in the section for installing E-mail Services components.

To create a new mailbox, you will need to come up with a username and password.

In SMTP, you must specify the port number 25, and for the POP3 server - 110. If the provider provides other parameters, you must enter them. In the event that the mail client being used does not imply entering a port number, you need to leave only the address provided by the provider in the "Server for incoming messages" (this can be either POP3 or IMAP) and "Name for the server of outgoing messages" ( usually only SMTP).

More fine tuning postal Windows Server largely depends on the used mail application but the principle of operation will be the same. The difference may lie in the options graphical interface and in menu items.

Switching from free mail to a dedicated client

Sometimes you need to stay on free however apply as a client separate application... You can show this using the example of mail settings for the Yandex service. The configuration of the mail server will then be carried out with the following parameters.

1. Software settings IMAP protocol for incoming messages:

  • mail server address: imap.yandex.ru;
  • specify SSL in the security settings for the connection;
  • the port number is indicated as 993.

2. To configure outgoing IMAP messages:

  • specify smtp.yandex.ru as the server address;
  • in the connection security parameters, you must also set SSL;
  • the port number must be set to 465.

3. Regarding the POP3 protocol for sent messages:

  • specify pop.yandex.ru as the server address;
  • SSL is specified as the security parameters of the used connection;
  • the port number is indicated as 995.

4. For outgoing messages sent using the POP3 protocol:

  • smtp.yandex.ru is specified as the mail server address;
  • SSL is specified again in the security parameters for the connection used;
  • the port number is set to 465.

As a username, as well as an address and password, you should set existing addresses and passwords from mail on Yandex.

Setting up the Mail.Ru server

Sometimes you need to find out about the settings of the Mail.Ru mail server. In general, the setting looks exactly the same as described in the case of Yandex mail. But the parameters will look like this:

  • full email address(in format with @ sign, for example [email protected]);
  • for the IMAP server, imap.mail.ru is specified;
  • smtp.mail.ru is specified for the SMTP server;
  • the username is the full email address from an existing mail;
  • password is the password used from the mail;
  • IMAP: number 993 (for SSL protocols/ TLS);
  • POP3: number 995 (for SSL / TLS protocols);
  • SMTP: number 465 (for SSL / TLS protocols);
  • you need to indicate that you want to authorize the server of sent letters, in the authentication parameters - a simple password, without encryption.

In general, the settings are specified exactly the same as in the case of Yandex, but only with the addition of the mail prefix. For other free servers, you should set the same parameters, but with the appropriate prefixes.

As you can see, in general, there is nothing complicated in such a matter as setting up a mail server. Even a novice user can cope with this task. But you can be sure that even in the event of a critical failure, you will not have to remain without mail.

The task of raising your own mail servers using Linux-tools, Apache, SQL and the like requires deeper knowledge in the field of information technology.

- two for hosting sites, the third for MS SQL. Since the main activity of the company is the development of custom-made web applications, dozens of client sites operate on the hosting servers. Basically, these are WordPress sites, several online stores, and sites on the management system. self-developed... All these applications have one thing in common - the need to use mail to send messages. These are messages through contact forms on the site or notifications of online stores. Naturally, this requires SMTP.

Problem

Until we were using Windows Azure, the company acquired a license for SmarterMail. He still serves regularly, being on virtual machine from one of the hosting providers. This is what we use to send messages from applications. But there is one security issue. For example, to send messages from WordPress, you have to install a special plugin, because being on Windows platform, it is not possible to send a message using PHP. We use WP Mail SMTP. It allows you to configure sending via any SMTP server. Everything works like a clock. At the same time, all settings for connecting to our mail server are open and available to our clients and webmasters who undertake to serve their sites. This means that the parameters for connecting to our server - login and password, are available to them. So why don't we still use localhost?

As it turns out, not everything is so simple with configuring the SMTP service on Windows Server. There is, of course, instructions on how to turn it on. In principle, everything is clear enough without instructions until you try to send a message. Does not work!

There is not always enough time to find a solution. Since there was something to send mail, we did not tackle this problem anymore. Nevertheless, the first bell has already rang. Someone nevertheless got the parameters of access to our server, because they began to receive several hundred letters with refunds every day. It became obvious that someone is spamming through our mail. Still, it's time to set up and start your local mail service.

As always it happens, in the official documentation everything is written only superficially. The solution to the problem has to be looked for in the forums. Fortunately, everything was found, checked, and now local service SMTP is working properly. This is how it was ...

Turning on the SMTP component

The first step is to enable the SMTP service as a server. We do it in steps. Further, all examples and instructions in relation to Russian Windows versions Server 2012.

  1. Open the Server Manager on the server.
  2. In the menu, select "Management - Add Roles and Components".
  3. In the dialog box of the wizard, on the "Installation Type" tab, click "Next" until the "Components" tab itself.
  4. In the list of components, mark "SMTP Server".
  5. We confirm and wait for the end of the setup.

From now on, SMTP support is enabled. But this is not enough. All of the following steps are not covered in standard instruction by server. This is already from personal experience and publications on thematic forums.

Starting the SMTP Protocol Service

As strange as it sounds, the SMTP service is not started by default in Windows Server 2012. Its launch type is set to "Manual". Let's turn it on automatically.

  1. In the "Server Manager" in the menu, select "Tools - Services".
  2. We find in the services "SMTP Protocol", open double click, and select the "Automatic" startup type. We save. We start the service.

Configuring SMTP Server

Again, everything that has been done above is not enough for us. Sending mail will not work. You need to configure the server. Guess it do some more in a modern way impossible. Its configuration must be done from the "Manager of IIS 6.0". Yes, it is version 6.0, not 7.0, not 7.5 and not 8.0.

  1. In the "Service Manager" we find virtual server"SMTP Virtual Server # 1". Right button we call up the menu with the mouse, select "Properties".
  2. On the General tab, enable logging and indicate the location of the log file. It will be useful to watch, tracking down bugs or spammers from among your own clients.
  3. On the "Access" tab, select the "Connection Management" block, press the "Connect ..." button.
  4. Again, on the "Access" tab, select the "Relay Restrictions" block, press the "Relay ..." button.
  5. In the window that opens, add one computer with the address 127.0.0.1 to the list of computers. We save.
  6. Let's restart the SMTP virtual server just in case. You can close IIS 6.0 Manager.

Security and firewall

Everything is fine here. By default, port 25, which is not needed to work with SMTP, is already allowed in the server's firewall rules. Let's trust him!

Windows Azure endpoint

The last thing to do again, since it comes about the VM we ran on Windows Azure, this is to add an endpoint for port 25. All of the above can be applied regardless of using the cloud service. This applies to any server configuration options. This section is useful only for those who already use cloud service Microsoft.

At the current historical moment, adding the end point is done in the following order:

  1. In the panel Windows management Azure choose your virtual machine.
  2. In the main part of the window, go to the "Endpoints" section.
  3. Below, under the list of endpoints, we find the "Add" command.
  4. In the window that opens, add a new endpoint.
  5. In the second step, select from the list of predefined SMTP endpoints. We save. After a few seconds, the endpoint will be added.

Conclusion

These few simple steps are enough to start the SMTP server. It seems to be easy and simple, but personally, it took me a fair amount of time and nerves to come to this simple solution.

P.S. While I was looking for materials for this article, I came across the document "Components removed or deprecated for use in Windows Server 2012". SMTP was considered an obsolete component that will one day be removed from the system. Maybe it's translation difficulties, but it's not completely clear to me how the proposed System.Net.Smtp will need to be used. So we only dream about peace!

Top related articles