Как настроить смартфоны и ПК. Информационный портал
  • Главная
  • Обзоры
  • Локальный smtp сервер windows. Обзор бесплатных почтовых серверов под Windows

Локальный smtp сервер windows. Обзор бесплатных почтовых серверов под Windows

Как-то мне, для работы, понадобилось написать инструкцию с подробным описанием установки почтового сервера и его настройки для Windows Server 2003. Хочется, что б польза от работы была максимальной, вдруг кому-то это будет интересно или полезно. Также я опишу как поюзать свой почтовый сервер. Пост рассчитан чисто для людей, которые ни разу этого не делали и не видели.И так, поехали.....Для того, что б добавить почтовый сервер на свою систему, надо установить соответствующую роль. Откройте окно “Manage Your Server” и нажмите “Add or remove a role”. Весь функционал сервера задается ролями. Подробно о ролях, которые доступны, можно почитать .Я не буду писать об окнах, где надо просто нажать “Next”[:)].В окне ниже видно весь список ролей, которые можно установить. Красным цветом я подсветил, какую роль надо выбрать.
Дальше надо ввести имя почтового домена, который вы создаете. Для примера я назвал именем dmail.com.
Будьте готовы к тому, что Windows Installer попросит вас об установочных файлах, так что подготовьте папку i386.После нажатия на кнопку “Finish” можно приступать к созданию учетной записи.
В окне “Manage Your Server” вы увидите новую добавленную роль Mail Server. Нажмите рядом нее “Manage this mail server”.
В дереве ниже найдите ваш домен и кликните по нему правой кнопкой мышки, дальше New->Mailbox, как показано на картинке.Для примера я создал почтовый ящик с именем test. Также для него надо задать парольПосле нажатия на кнопку OK будет создана новая учетная запись. Для проверки работы учетной записи я расскажу как настроить OutlookExpress.Запустите OutlookExpress. Он попросит вас настроить учетную запись. Заполняем поля которые он показывает[:)].
Вводите адрес, который недавно создали.
Так как почтовый клиент настраивается на той же машине что и установлен почтовый сервер, то можно ввести имя компьютера в качестве POP3 и SMTP серверов.В поле “Account name” надо написать полный адрес почтового ящика.
В принципе это все, теперь можете послать письмо самому себе на адрес

The steps to setup and configure an SMTP Server or mail relay on Windows Server 2012 are very similar to those for Windows Server 2008 except for a few differences. Confusion has arisen due to GUI changes in Server 2012, which has led me to create this post to help anyone that requires explicit step-by-step instructions.

Note : The exact steps for installing SMTP Server on Windows Server 2008 can be found in this previous of mine.

Installing the SMTP feature

1 . Click on the Server Manager icon in the bottom left-hand corner to load the Server Manager Dashboard :

Alternatively, click on the Powershell icon to its right and enter servermanager.exe at the prompt to load the Server Manager Dashboard :

PS C:\Users\Admin> servermanager.exe

2 . When the Server Manager Dashboard loads, click on Add roles and features in the center pane as highlighted below:

The Add Roles and Features Wizard will load, click Next to go past the initial Before You Begin Page :

3 . In the Installation Type section, select Role-based or feature-based installation and click Next :

4 . In the Server Selection section, select your server, in my example below, my server is called 2012 , then click Next to proceed:

5 . In the Server Roles section select Web Server (IIS) as highlighted below and click Next :

Doing so will initiate a prompt to install the required IIS Management Console . Ensure you check the box per the below and click Add Features to proceed:

6 . In the Features section, select the SMTP Server feature then click Install to proceed:

You will prompted to install services and features required by the SMTP Server . Ensure you check the Include management tools (if applicable) box per the below and click Add Features to proceed:

7 . You will now be presented with the Web Server Role (IIS) section. Click Next to proceed:

In the Role Services section, scroll down and under Management Tools select the services to match those checked in screenshot below then click Next to proceed:

8 . The Confirmation section will show all the role and feature configuration options you previously selected:

Click Install to start the installation:

The installation should complete shortly. You nay need to reboot your server to fully complete the installation.

Configuring the SMTP Server

The next step is to configure SMTP . To do so we will need to open Internet Information Services (IIS) Manager 6 . 10 . Click on the Server Manager icon per step 1 to load the Server Manager Dashboard . Then c lick Tools and then click on Internet Information Services (IIS) 6.0 Manager to load IIS Manager 6:

9 . In IIS 6 Manager , expand the server name, in my example below it is 2012 , then right-click on SMTP Server and select Properties :

10 . In the General tab, unless you want the SMTP Server to use a specific IP address, leave the settings as they are so that the IP address is set to (All Unassigned) :

11 . To proceed, click on the Access tab:

12 . Click on the Authentication button and ensure Anonymous access is checked and then click OK :

13 . Once back in the Access tab, click on the Connection button. Select Only the list below and then click Add . Enter 127.0.0.1 OK :

The Connection setting controls which computers can connect to the SMTP server and send mail. By granting only localhost (127.0.0.1) access, limits only the server itself the ability to connect to the SMTP server. This is a requirement for security. Click OK to return to the Access tab and then click on the Relay button. Enter 127.0.0.1 as the IP address and then click OK :

The Relay section determines which computers can relay mail through this SMTP server. By only allowing the localhost IP address (127.0.0.1) relay permissions it means that only the server itself can relay mail. Conversely, it prevents the SMTP server from being an open relay and being used to send unsolicited spam email by other computers on the internet, which could lead to the SMTP server being blacklisted.

14 . Next, go to the Messages tab. Here you can enter an email address where copies of non-delivery reports are sent to. You can also configure the location of the Badmail director, however, the default setting should suffice:

15 . Next, go to the Delivery tab:

16 . Click on the Outbound Security button and ensure Anonymous access is selected. As the only server that can connect and relay mail through the SMTP server is localhost this security settings is fine:

17 . Click OK to return to the Delivery tab and then click on Outbound Connections . Leave the defaults as they are:

18 . Click OK to return to the Delivery tab and then click on Outbound Connections , then click on the Advanced button:

Here you will need to enter the fully-qualified domain name of the SMTP server. This will be the host name or A record that has been created in your DNS zone file. This is straight-forward to do but you will have to confirm how you do this with the party that manages DNS for your domain. I have entered mail.сайт as this is fully-qualified. If you click on the Check DNS button you can confirm whether your chosen name resolves successfully. In my case it does as I see the following:

19 . Click OK and then OK again to exit the SMTP Virtual Server Properties . You can also perform this test by running nslookup to confirm the existence of the host name as well as confirming the IP address it resolves to – which should the IP address of your server:

You can also load the nslookup command from PowerShell also:

Please note that DNS is crucial to successful email delivery. If your SMTP server cannot resolve the domains it is trying to send messages to then it will fail. Ensure that the DNS servers you have configured are able to resolve DNS queries successfully. From the above screenshot you can see that the DNS server I have configured, cachens2.dfw1.rackspace.com , was able to successfully resolve my SMTP server’s hostname, mail.сайт . This is one of Rackspace’s many DNS servers and I am 100% confident it works fine.

The reason I am highlighting this is because if your SMTP Server sits within a corporate network it will likely use an internal DNS server. Often these are only configured to resolve internal namespaces therefore resolving external hostnames may fail. Also, firewall rules may block your SMTP Server from querying any DNS servers so please check and ensure DNS queries are resolved successfully and if not make sure it get fixed before going onto the testing phase below.

Another very important point about DNS is that you must ensure that you have a PTR record for reverse DNS lookups configured. The PTR record allows your SMTP Server’s public IP address to be resolved back to your hostname. Some of the major email providers perform revers DNS lookups of mail servers connecting to them as a security measure to check their credibility or reputation. Your web host should have a control panel that allows you to configure reverse DNS if you have a dedicated public IP address. Not having a PTR record will not guarantee email delivery failure but it will very likely delay email delivery and at worst may result in your messages being blocked and your host being blacklisted. I highly recommend you you configure a PTR record for your server.

On all versions of Windows Server, you can setup built-in SMTP server . This SMTP server inside the organization can serve as a mail relay receiving and sending SMTP messages from and to different devices (like senders, scanners, access control devices, etc.) and applications (web applications, SQL Reporting Services, SharePoint), which need an opportunity to send mail using an SMTP service. It is not always rational to deploy a full-featured mail infrastructure, like Microsoft Exchange Server or other mail services.

In this article we’ll show how to install, configure and test the SMTP server on Windows Server 2012 R2 serving as a mail relay . This SMTP server can only send or forward e-mails, it doesn’t have any means to receive them.

How to Install SMTP Service in Windows Server 2012 R2

SMTP server is one of the system features that can be installed through Server Manager. To do it, open Server Manager Dashboard (servermanager.exe), go to Add roles and features and check SMTP Server when you select the features. To manage the SMTP service, install management consoles, being a part of Web Server (IIS) role, so you will be prompted to install some IIS components.

Leave all the suggested options of Web Server (IIS) role and run installation.

After the components are installed, you may need to restart your computer.

SMTP Server Configuration

The SMTP server is still managed using the old school management console Internet Information Services (IIS) Manager 6 . You can open this console in Server Manager: Tools-> Internet Information Services (IIS) 6.0 Manager or with the command inetmgr6.exe

In IIS 6 Manager unfold the branch with your server name, right-click SMTP Virtual Server and open its properties.

In the General tab, if necessary select the IP address, the SMTP server to respond to, and check Enable logging.

Then go to the Access tab.

Here click Authentication and make sure that the Anonymous access is enabled.

Go back to the Access tab and click Connection . Here you can specify, which devices can send e-mails using our relay. To do it, check Only the list below and enter the list of IP addresses, don’t forget about yourself (127.0.0.1).

Note . As a general rule, it’s worth to check this option and limit the list of accepted devices with the range of IP addresses. Otherwise, your SMTP server may be used by spammers and other hackers as an open relay.

Go to the Messages tab. Here the administrative e-mail address is specified, to which the copies of NDR messages will be delivered, as well as the restrictions of the maximum e-mail size and the number of recipients.

Go to the Delivery tab.

Then click Outbound Security . Here you specify the way of authentication on the external mail server. For example, if all e-mails will be forward to Gmail mail server and then resent to the recipients, check Basic authentication and specify the login and password of your Gmail mailbox (In Google account settings should be allowed to send mail through their SMTP servers).

Then click Advanced .

Here you specify the FQDN name of your SMTP server. Click Check DNS to make sure if the DNS record is correct.

If your server sends mail to an external SMTP server, specify its name in Smart host field (e. g., smtp.gmail.com ).

Save the settings of the SMTP server.

Note .

  1. DNS settings are critical from the point of view of mail system availability. If your SMTP server cannot resolve names, to which e-mails are sent, the delivery won’t be possible.
  2. If your server sends mail to other domains, it is important that the correct PTR record is created for your IP address to resolve reverse DNS lookup. The PTR record for an external IP address has to point at the FQDN name. Otherwise, most external SMTP servers won’t get mail from you, considering your server a spammer one.

SMTPSVC Automatic Start up

Now you only have to configure the automatic startup of your SMTP server. You can do it quickly using PoSh command prompt:

set-service smtpsvc -StartupType Automatic

Start the service:

start-service smtpsvc

Make sure that SMTPSVC is running:

get-service smtpsvc

Status Name DisplayName
-- -- ----
Running smtpsvc Simple Mail Transfer Protocol (SMTP)

SMTP Server Testing

The last thing you have to do is to make sure that your SMTP server is working. It is easier to do it by creating a plain-text file smtp-test-email.txt on your desktop and copying the following text to it. Don’t forget to change the sender and recipient names to yours.

From: [email protected]
To: [email protected]
Subject: Email test
This is the test email

Copy smtp-test-email.txt to C:\inetpub\mailroot\Pickup . SMTP server monitors new files appearing in this folder, and if a file is found it will read it and try to send an e-mail with the given subject and body to the recipient specified in the To: line.

Check the recipient mailbox, and you will see this e-mail.

Tip . You can also test the work of your SMTP server using telnet command prompt, VBS script or PowerShell:

Send-MailMessage -SMTPServer localhost -To [email protected] -From [email protected] -Subject "Email test" -Body " This is the test email from PowerShell"

So we have configured our own SMTP mail relay in Windows Server 2012 R2 and and tested sending messages through it.

Посмотрело: 42433

5

И так, у нас есть установленный Windows Server 2008 R2 и запущенный сайт под управлением CMS DLE (DataLife Engine), с которого нужно настроить отправку почты.
SMTP-сервер на компьютерах с Windows Server 2008 по умолчанию не установлен. Чтобы установить SMTP-сервер, необходимо воспользоваться диспетчером сервера.
В окне Диспетчер сервера нажмите кнопку Добавить компоненты, чтобы открыть мастер добавления компонентов.(для наглядности я произведу установку на чистом сервере)

На странице Выбор компонентов выберите пункт SMTP-сервер. При появлении диалогового окна с сообщением Добавить компоненты, необходимые для SMTP-сервера? нажмите Добавить необходимые компоненты. Нажмите кнопку Далее.


На странице Подтверждение параметров установки нажмите кнопку Установить. Страница Ход установки служит для отображения процесса установки SMTP-сервера мастером добавления компонентов.



На странице Результаты установки убедитесь, что отображается сообщение Установка успешно завершена, и нажмите кнопку Закрыть.

Если все сделано правильно в Диспетчере служб IIS должна появиться остастка. Нажимаем: "Открытие функции".

Сдесь мы можем произвести настройки нашего SMTP-сервера. Поставим галку на "использовать localhost" и с права нажмем "применить".

В 90 процентов случаев этих настроек достаточно для благополучной отправки почты с установленных сайтов.
Но иногда приходится устанавливать параметры SMTP более детально.(ну например после установки и последующего удаления стороннего SMTP-сервера)

Нажмите кнопку Пуск, выберите пункт Панель управления, затемСистема и безопасность, затем пункт Администрирование, а затем щелкните пункт Диспетчер служб IIS 6.0.



Откроется окно "Диспетчер служб IIS 6.0"

В дереве консоли разверните узел Имя сервера. При установке SMTP-сервера предоставляется виртуальный сервер .

Нажимаем правой кнопкой на "SMTP Virtual Server #1" и открываем "свойства".

Переходим на вкладку "Доступ" и нажимаем "Ретрансляция..."

Другой вариант: Отмечаем пункт "все компьютеры, кроме списка ниже" и добавляем адреса с которых Вы не хотите производить отправку почты или оставляете поле пустым, если нет никаких ограничений.
На этом собственно настройка SMTP-сервера завершена.
Переходим к настройкам сайта.
Открываем админ панель, заходим в настройки системы, открываем настройки E-mail
В графе "метод отправки почты" ставим "SMTP"
В графе "SMTP хост" ставим "localhost"
В графе "SMTP Порт" ставим "25"
Жмем "сохранить"

Ну вот собственно и все.

На всех версиях Windows Server возможно с помощью встроенных средств поднять собственный SMTP сервер . Такой SMTP сервер внутри организации может работать в качестве почтового релея, принимая и пересылая наружу SMTP сообщения от различных устройств (к примеру, сендеров, сканеров, устройств СКД и пр.) и приложений (веб приложения, SQL Reporting Services, SharePoint), которым необходимо иметь возможность отправлять почту через SMTP сервер. Ведь не всегда целесообразно разворачивать полноценную почтовую инфраструктуру типа Microsoft Exchange Server или других почтовых сервисов.

В этой статье мы покажем, как установить, настроить и протестировать работу SMTP сервера на Windows Server 2012 R2 , который будет функционировать в качестве mail релея . Такой SMTP сервер сможет только отправлять/пересылать почту, средства для получения писем у него отсутствуют.

Установка службы SMTP на Windows Server 2012 R2

SMTP сервер – это одна из функций системы, которую можно установить через . Для этого откройте консоль Server Manager Dashboard (servermanager.exe), перейдите в режим Add roles and features и на этапе выбора функций отметьте чекбокс у пункта SMTP Server . Для управления службой SMTP нужно установить консоли управления, которые входят в комплект роли Web Server (IIS), поэтому будет предложено дополнительно установить ряд компонентов IIS.

Оставляем все предлагаемые опции роли Web Server (IIS) и запускаем установку.

После окончания установки компонентов может потребоваться перезагрузка системы.

Настройка SMTP сервера

Управляется SMTP сервер по-прежнему через старую добрую консоль управления Internet Information Services (IIS) Manager 6 . Открыть эту консоль можно через Server Manager: Tools-> Internet Information Services (IIS) 6.0 Manager или командой inetmgr6.exe

В консоли IIS 6 Manager разверните ветку с именем сервера, щёлкните ПКМ по SMTP Virtual Server и откройте его свойства.

На вкладке General , если необходимо, выберите IP адрес, на котором должен отвечать SMTP сервер и включите ведение логов Enable logging (чтобы сохранялась информация обо всех отправленных письмах).

Затем перейдите на вкладку Access .

Здесь нажмите на кнопку Authentication и убедитесь, что разрешен анонимный доступ (Anonymous access ).

Вернитесь на вкладку Access и нажмите кнопку Connection . Здесь можно ограничить с каких устройств могут отправлять почту через наш релей, нужно выбрать опцию Only the list below и указать список IP адресов, не забыв самого себя (127.0.0.1).

Примечание . Как правило, обязательно стоит включать эту опцию, ограничив как минимум список обслуживаемых устройств диапазоном IP адресов. В противном случае ваш SMTP сервер может использоваться спамерами и другими злоумышленниками как открытый релей.

Переходим на вкладку Messages . Здесь указывается административный email, куда будут приходить копии NDR сообщений и ограничения на максимальный размер писем и количество получателей.

Переходим на вкладку Delivery :

Затем нажимаем на кнопку Outbound Security . Здесь указывается, как нужно авторизоваться на сервере, куда будет пересылаться почта. К примеру, если вся почта будет отправляться на почтовый сервер Gmail и уже с него пересылаться адресатам, нужно выбрать Basic authentication , указав в качестве пользователя и пароля данные почтового ящика на сервисе Gmail (в настройках аккаунта Google нужно разрешить отправку через их smtp сервера).

Затем жмем на кнопку Advanced

Здесь указывается FQDN имя нашего smtp сервера. Нажмите кнопку Check DNS чтобы проверить корректность записи в DNS.

Если сервер должен пересылать почту внешнему smtp серверу, нужно указать его имя в поле Smart host (к примеру smtp.gmail.com ).

Сохраняем настройки SMTP сервера.

Примечание . 1. Настройки DNS критичны с точки зрения работоспособности почтовой системы. Если ваш SMTP сервер не может разрешить DNS имена, на которые он пытается отправить письма, доставка не удастся.

  1. Если ваш сервер сам будет отправлять почту в другие домены, важно, чтобы для вашего адреса была сформирована правильная PTR запись для разрешения обратных DNS запросов. PTR запись для белого IP адреса должна указывать на FQDN имя. В противном случае большинство внешних smtp серверов не будут принимать от вас почту, считая ваш сервер спамерским.

Автозапуск службы SMTPSVC

Осталось настроить автозапуск службы SMTP сервера. Быстрее всего это сделать из командной строки PoSh:

set-service smtpsvc -StartupType Automatic

Запустим службу:

start-service smtpsvc

Проверим, что служба SMTPSVC запущена:

get-service smtpsvc

Status Name DisplayName
—— —- ————
Running smtpsvc Simple Mail Transfer Protocol (SMTP)

Тестирование SMTP сервера

Ну и последнее, что осталось сделать, проверить работу созданного SMTP сервера. Проще всего это сделать, создав на рабочем столе текстовый файл smtp-test-email.txt и скопировав в него следующий текст, заменив имя отправителя и получателя на ваши.

From: [email protected]
To: [email protected]
Subject: Email test
This is the test email

Скопируйте файл smtp-test-email.txt в каталог C:\inetpub\mailroot\Pickup . SMTP сервер следит за появлением файлов в этой каталоге и при обнаружении файла прочтет его содержимое и попытается отправить письмо с данной темой и текстом адресату, указанному в разделе To: .

Проверьте ящик получателя, в него должно упасть такое письмо.

Итак, мы настроили собственный почтовый SMTP релей на Windows Server 2012 R2 и протестировали отправку писем через него.

Лучшие статьи по теме