{"id":283692,"date":"2017-03-22T01:30:03","date_gmt":"2017-03-21T22:30:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=283692"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=283692","title":{"rendered":"\u041f\u043e\u0447\u0442\u043e\u0432\u044b\u0439 \u043a\u043b\u0430\u0441\u0442\u0435\u0440 \u0441\u0432\u043e\u0438\u043c\u0438 \u0440\u0443\u043a\u0430\u043c\u0438"},"content":{"rendered":"<p>\u0421\u0440\u0430\u0437\u0443 \u043e\u0433\u043e\u0432\u043e\u0440\u044e\u0441\u044c \u0447\u0442\u043e \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u0443\u044e \u0437\u0430\u0434\u0430\u0447\u0443 \u043c\u043e\u0436\u043d\u043e \u0440\u0435\u0448\u0438\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u043c\u0438. \u042d\u0442\u043e\u0442 \u043e\u0434\u0438\u043d \u0438\u0437 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445. <br \/>  \u0421\u0442\u0430\u0442\u044c\u044f \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u043d\u0430 \u043d\u0430 \u0442\u0435\u0445, \u043a\u0442\u043e \u0437\u043d\u0430\u0435\u0442 \u043a\u0430\u043a \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 Exim \u0438 Dovecot, \u0438 \u0432 \u043d\u0435\u0439 \u044f \u043d\u0435 \u0431\u0443\u0434\u0443\u0442 \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u0445 \u044d\u0442\u0438\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432.<\/p>\n<p>  \u041d\u0430\u0434\u0435\u044e\u0441\u044c \u0447\u0442\u043e \u043a\u0442\u043e-\u0442\u043e, \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0432 \u0437\u0430\u043c\u0435\u0442\u0443, \u043f\u043e\u043b\u0443\u0447\u0438\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0437\u043d\u0430\u043d\u0438\u044f \u0438\u043b\u0438 \u0438\u0434\u0435\u0438 \u0434\u043b\u044f \u0432\u043e\u043f\u043b\u043e\u0449\u0435\u043d\u0438\u044f \u0441\u0432\u043e\u0435\u0433\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u044f.<\/p>\n<p>  \u0417\u0430\u0434\u0430\u0447\u0430 \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043e\u0442\u043a\u0430\u0437\u043e\u0443\u0441\u0442\u043e\u0439\u0447\u0438\u0432\u044b\u0439 \u0441\u0435\u0440\u0432\u0438\u0441, \u0441 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435\u043c \u043f\u043e\u0447\u0442\u044b \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430\u0445, \u0441 \u0434\u043e\u0441\u0442\u0443\u043f\u043e\u043c \u043f\u043e IMAP.<br \/>  \u041a\u043b\u0430\u0441\u0442\u0435\u0440 \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u0442\u044c \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u044e \u0441 \u043f\u043e\u0440\u044f\u0434\u043a\u043e\u043c 60-\u0442\u0438 \u0444\u0438\u043b\u0438\u0430\u043b\u043e\u0432, \u043a\u0430\u0436\u0434\u044b\u0439 \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0438\u043c\u0435\u0435\u0442 \u0441\u0432\u043e\u0439 \u0434\u043e\u043c\u0435\u043d 3-\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f. <\/p>\n<p>  \u0413\u043b\u0430\u0432\u043d\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430 \u0441\u0435\u0440\u0432\u0438\u0441\u0430, \u0431\u0435\u0441\u043f\u0440\u0435\u0440\u044b\u0432\u043d\u044b\u0439 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043f\u043e\u0447\u0442\u0435. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430 \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u0432\u0430 \u0433\u0435\u043e\u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0438 \u0440\u0430\u0437\u043d\u0435\u0441\u0435\u043d\u043d\u044b\u0445 \u0441\u0435\u0440\u0432\u0435\u0440\u0430, \u0441 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u043f\u043e\u0447\u0442\u043e\u0432\u044b\u0445 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u043e\u0432.<br \/>  \u041e\u0431\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0431\u0443\u0434\u0443\u0442 \u0430\u043a\u0442\u0438\u0432\u043d\u044b\u043c\u0438, \u044d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442 \u0447\u0442\u043e \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u043c\u0435\u0436\u0434\u0443 \u043d\u043e\u0434\u0430\u043c\u0438. \u0427\u0430\u0441\u0442\u044c \u0434\u043e\u043c\u0435\u043d\u043e\u0432 \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u0442\u044c \u043e\u0434\u043d\u0430 \u043d\u043e\u0434\u0430, \u0447\u0430\u0441\u0442\u044c \u0434\u043e\u043c\u0435\u043d\u043e\u0432 \u0434\u0440\u0443\u0433\u0430\u044f. \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0432\u044b\u0445\u043e\u0434\u0430 \u0438\u0437 \u0441\u0442\u0440\u043e\u044f \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u043d\u043e\u0434, \u043a\u043b\u0438\u0435\u043d\u0442\u044b \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u044e\u0442\u0441\u044f \u043d\u0430 \u0434\u0440\u0443\u0433\u0443\u044e.<br \/>  \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434\u0430 \u0434\u043b\u044f <s>\u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438<\/s> \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432 \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Nginx \u0441 \u043c\u043e\u0434\u0443\u043b\u0435\u043c mail. \u0414\u043b\u044f \u043f\u0440\u0438\u0435\u043c\u0430 \u043f\u043e\u0447\u0442\u044b, \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u0432\u0430 smtp \u0441\u0435\u0440\u0432\u0435\u0440\u0430. <\/p>\n<p>  <b>\u0421\u0445\u0435\u043c\u0430:<\/b><br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/319\/723\/d2e\/319723d2e8b04e4eb8a3e12d95030399.jpg\"\/><br \/>   <a name=\"habracut\"><\/a><br \/>  <b>STORAGE<\/b>: \u0425\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 \u043f\u043e\u0447\u0442\u043e\u0432\u044b\u0445 \u044f\u0449\u0438\u043a\u043e\u0432. \u0421\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0434\u0432\u0443\u0445 \u043d\u043e\u0434. <br \/>   \u041a\u0430\u0436\u0434\u0430\u044f \u043d\u043e\u0434\u0430 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0435\u0440 \u0441 2\u04454\u0422\u0431 HDD, \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0435 \u043d\u0430 \u0440\u0430\u0437\u043d\u044b\u0445 \u0445\u043e\u0441\u0442\u0438\u043d\u0433\u0430\u0445 <br \/>   DNS: storage-01.domain.ru \u0438 storage-02.domain.ru<br \/>   \u041e\u0421: FreeBSD, <br \/>   \u041f\u041e: Dovecot, Exim, Postgresql \u0438 Nginx<\/p>\n<p>  <b>SMTP<\/b>: \u0421\u0435\u0440\u0432\u0435\u0440\u0430 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0449\u0438\u0435 SMTP \u0442\u0440\u0430\u0444\u0438\u043a, \u0434\u0432\u0435 \u043d\u043e\u0434\u044b.<br \/>   \u0412\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u044b \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0435 \u043d\u0430 \u0440\u0430\u0437\u043d\u044b\u0445 \u0445\u043e\u0441\u0442\u0438\u043d\u0433\u0430\u0445,<br \/>   DNS: smtp-01.domain.ru \u0438 smtp-02.domain.ru<br \/>   \u041e\u0421: FreeBSD, <br \/>   \u041f\u041e: Exim, Postgresql<\/p>\n<p>  <b>PROXY<\/b>: \u041f\u0440\u043e\u043a\u0441\u0438 \u0441\u0435\u0440\u0432\u0435\u0440 \u0434\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0441\u0435\u0440\u0432\u0438\u0441\u0443 IMAP, POP3, SMTP.<br \/>   \u0412\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0435\u0440. \u0415\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u043d\u0435 \u043f\u0440\u043e\u0434\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u0437\u0432\u0435\u043d\u043e \u0432 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0435, \u043d\u043e \u0432 \u0432\u0438\u0434\u0443 \u0441\u0432\u043e\u0435\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u044b \u043f\u043e\u0434\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u0435\u0447\u0435\u043d\u0438\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043c\u0438\u043d\u0443\u0442 \u0438\u0437 \u0441\u043d\u0430\u043f\u0448\u043e\u0442\u0430. <br \/>   DNS: mail.domain.ru<br \/>   \u041e\u0421: FreeBSD, <br \/>   \u041f\u041e: Nginx<\/p>\n<p>  <b>STORAGE.<\/b><br \/>  \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 MDA \u0431\u044b\u043b \u0432\u044b\u0431\u0440\u0430\u043d Dovecot, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043e\u043d \u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438 \u0443\u043c\u0435\u0435\u0442 \u043a\u043b\u0430\u0441\u0442\u0435\u0440. \u0414\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043f\u043e\u0447\u0442\u044b, \u0431\u044b\u043b \u0432\u044b\u0431\u0440\u0430\u043d \u0444\u043e\u0440\u043c\u0430\u0442 Maildir, \u0442.\u043a. \u0441\u0440\u0430\u0437\u0443 \u0437\u0430\u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0434\u0435\u0434\u0443\u043f\u043b\u0438\u043a\u0430\u0446\u0438\u044e, \u043d\u043e \u043e\u0431 \u044d\u0442\u043e\u043c \u043d\u0438\u0436\u0435.<br \/>  \u0414\u0430\u0442\u0430\u0441\u0442\u043e\u0440\u044b \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0442 \u043f\u043e\u0447\u0442\u0443 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0442 \u0441\u0432\u043e\u0438\u0445 smtp \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432 \u0438 PROXY. \u041f\u043e\u0447\u0442\u0443 \u0432 \u043c\u0438\u0440 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0442 \u0441\u0430\u043c\u0438, \u043c\u0438\u043d\u0443\u044f smtp \u0441\u0435\u0440\u0432\u0435\u0440\u044b. \u041c\u043e\u0436\u043d\u043e \u0438\u0445 \u0441\u043e\u0432\u0441\u0435\u043c \u0441\u043f\u0440\u044f\u0442\u0430\u0442\u044c, \u0438 \u0438\u0441\u0445\u043e\u0434\u044f\u0449\u0443\u044e \u043f\u043e\u0447\u0442\u0443 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0447\u0435\u0440\u0435\u0437 smtp \u043d\u043e\u0434\u044b.<br \/>  \u041f\u0443\u0442\u044c \u0432 \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u043a \u044f\u0449\u0438\u043a\u0430\u043c <b>\/usr\/mail\/\u0434\u043e\u043c\u0435\u043d 2-\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f\/\u0434\u043e\u043c\u0435\u043d 3-\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f\/\u044f\u0449\u0438\u043a\/<\/b><br \/>  \u0412 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043b\u043e\u0433\u0438\u043d\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u043e\u043b\u043d\u044b\u0439 \u044f\u0449\u0438\u043a mail@ldomain.mdomain.ru<\/p>\n<p>  \u0411\u0414:<br \/>  \u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0442\u0430\u0431\u043b\u0438\u0446:<br \/>  <b>mail<\/b> \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043f\u043e\u0447\u0442\u043e\u0432\u044b\u0445 \u044f\u0449\u0438\u043a\u043e\u0432   <\/p>\n<ul>\n<li><b>id<\/b><\/li>\n<li><b>mailbox<\/b> \u2014 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043f\u043e\u0447\u0442\u043e\u0432\u043e\u0433\u043e \u044f\u0449\u0438\u043a\u0430<\/li>\n<li><b>password<\/b> \u2014 \u043f\u0430\u0440\u043e\u043b\u044c \u0432 MD5<\/li>\n<li><b>ldomain_id<\/b> \u2014 id \u0434\u043e\u043c\u0435\u043d\u0430 3-\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f \u0438\u0437 \u0442\u0430\u0431\u043b\u0438\u0446\u044b ldomain<\/li>\n<li><b>mdomain_id<\/b> \u2014 id \u0434\u043e\u043c\u0435\u043d\u0430 2-\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f \u0438\u0437 \u0442\u0430\u0431\u043b\u0438\u0446\u044b mdomain<\/li>\n<li><b>active<\/b> \u2014 \u0441\u0442\u0430\u0442\u0443\u0441 \u043f\u043e\u0447\u0442\u043e\u0432\u043e\u0433\u043e \u044f\u0449\u0438\u043a\u0430. \u0432\u043a\u043b\/\u0432\u044b\u043a\u043b<\/li>\n<\/ul>\n<p>  <b>ldomain<\/b> \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u0434\u043b\u044f \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0434\u043e\u043c\u0435\u043d\u043e\u0432 3-\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f   <\/p>\n<ul>\n<li><b>id<\/b><\/li>\n<li><b>domain<\/b> \u2014 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0434\u043e\u043c\u0435\u043d\u0430<\/li>\n<li><b>active<\/b> \u2014 \u0441\u0442\u0430\u0442\u0443\u0441 \u0434\u043e\u043c\u0435\u043d\u0430. \u0432\u043a\u043b\/\u0432\u044b\u043a\u043b<\/li>\n<\/ul>\n<p>  <b>mdomain<\/b> \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u0434\u043b\u044f \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0434\u043e\u043c\u0435\u043d\u043e\u0432 2-\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f   <\/p>\n<ul>\n<li><b>id<\/b><\/li>\n<li><b>domain<\/b> \u2014 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0434\u043e\u043c\u0435\u043d\u0430<\/li>\n<li><b>active<\/b> \u2014 \u0441\u0442\u0430\u0442\u0443\u0441 \u0434\u043e\u043c\u0435\u043d\u0430. \u0432\u043a\u043b\/\u0432\u044b\u043a\u043b<\/li>\n<\/ul>\n<p>  <b>maps<\/b> \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u0438   <\/p>\n<ul>\n<li><b>id<\/b><\/li>\n<li><b>ldomain_id<\/b> \u2014 id \u0434\u043e\u043c\u0435\u043d\u0430 3-\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f \u0438\u0437 \u0442\u0430\u0431\u043b\u0438\u0446\u044b ldomain<\/li>\n<li><b>mdomain_id<\/b> \u2014 id \u0434\u043e\u043c\u0435\u043d\u0430 2-\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f \u0438\u0437 \u0442\u0430\u0431\u043b\u0438\u0446\u044b mdomain<\/li>\n<li><b>storage1<\/b> \u2014 \u043e\u0441\u043d\u043e\u0432\u043e\u043d\u043e\u0439 \u0441\u0442\u043e\u0440\u0430\u0434\u0436<\/li>\n<li><b>storage2<\/b> \u2014 \u0440\u0435\u0437\u0435\u0440\u0432\u043d\u044b\u0439 \u0441\u0442\u043e\u0440\u0430\u0434\u0436 (\u043f\u043e\u043a\u0430 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f)<\/li>\n<\/ul>\n<p>  \u041a\u0430\u043a \u0443\u0436\u0435 \u043f\u0438\u0441\u0430\u043b \u0432\u044b\u0448\u0435, \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0443 (\u043f\u043e\u0447\u0442\u043e\u0432\u044b\u0435 \u0434\u043e\u043c\u0435\u043d\u044b) \u044f \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e \u043f\u043e \u0434\u0432\u0443\u043c storage, \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 <b>maps<\/b> \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442, \u043d\u0430 \u043a\u0430\u043a\u043e\u043c \u0438\u0437 storage \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0434\u043e\u043c\u0435\u043d 3-\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f.<\/p>\n<pre><code class=\"sql\">mail=# select * from maps limit 3;  id | ldomain_id | mdomain_id |      storage1      |   storage2     ----+------------+------------+--------------------+---------------  56 |         56 |          2 | storage-01.domain.ru | storage-02.domain.ru  57 |         57 |          2 | storage-02.domain.ru | storage-01.domain.ru  58 |         58 |          2 | storage-01.domain.ru | storage-02.domain.ru  (3 \u0441\u0442\u0440\u043e\u043a) <\/code><\/pre>\n<p>  \u041e\u043f\u0438\u0440\u0430\u044f\u0441\u044c \u043d\u0430 \u044d\u0442\u0443 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 Exm-\u044b \u0441\u0442\u043e\u0440\u0430\u0434\u0436\u0435\u0439 \u0438 smtp \u043d\u043e\u0434 \u0431\u0443\u0434\u0443\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u043a\u0443\u0434\u0430 \u0441\u043b\u0430\u0442\u044c \u043f\u0438\u0441\u044c\u043c\u0430. \u0410 Nginx, \u043a \u043a\u0430\u043a\u043e\u043c\u0443 \u0441\u0442\u043e\u0440\u0430\u0434\u0436\u0443 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439. <\/p>\n<p>  C\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0411\u0414 \u0438 \u0442\u0430\u0431\u043b\u0438\u0446:  <\/p>\n<pre><code class=\"sql\"> psql -Upgsql template1  ctreate database mail;  \\q <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"sql\">CREATE TABLE mail ( \t&quot;id&quot; BIGSERIAL PRIMARY KEY, \t&quot;mailbox&quot; CHARACTER VARYING(32) not null, \t&quot;password&quot; CHARACTER VARYING(128), \t&quot;ldomain_id&quot; int NOT NULL,\t  \t&quot;mdomain_id&quot; int NOT NULL, \tactive BOOLEAN DEFAULT TRUE NOT NULL, \tCONSTRAINT &quot;mail_ldomain_id_check&quot; CHECK ((&quot;ldomain_id&quot; &gt; 0)) );  CREATE TABLE &quot;ldomain&quot; (     &quot;id&quot; BIGSERIAL PRIMARY KEY,     &quot;domain&quot; CHARACTER VARYING(32) NOT NULL,     &quot;active&quot; BOOLEAN DEFAULT TRUE NOT NULL,     CONSTRAINT ldomain_k UNIQUE (domain) );  CREATE TABLE &quot;mdomain&quot; (     &quot;id&quot; BIGSERIAL PRIMARY KEY,     &quot;domain&quot; CHARACTER VARYING(32) NOT NULL,     &quot;active&quot; BOOLEAN DEFAULT TRUE NOT NULL,     CONSTRAINT mdomain_k UNIQUE (domain) );  CREATE TABLE &quot;maps&quot; (     &quot;id&quot; SERIAL PRIMARY KEY,     &quot;ldomain_id&quot;  int NOT NULL,     &quot;mdomain_id&quot;  int NOT NULL,     &quot;storage1&quot; CHARACTER VARYING(32) NOT NULL,     &quot;storage2&quot; CHARACTER VARYING(32) NOT NULL,     CONSTRAINT maps_ldomain_k UNIQUE (ldomain_id) ); <\/code><\/pre>\n<p>  <b>Dovecot<\/b><br \/>  Dovecot \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u044e MDA. \u042f \u043e\u0441\u0442\u0430\u0432\u043b\u044e \u0437\u0430 \u0440\u0430\u043c\u043a\u0430\u043c\u0438 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u0431\u0430\u0437\u043e\u0432\u0443\u044e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443 Dovecot, \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u044e\u0441\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u0442\u0435\u0445 \u043c\u043e\u043c\u0435\u043d\u0442\u0430\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u0430\u0436\u043d\u044b \u0434\u043b\u044f \u0441\u0432\u044f\u0437\u043a\u0438 \u0435\u0433\u043e \u0441 DB \u0438 MTA  <\/p>\n<pre><code class=\"bash\">\/usr\/local\/etc\/dovecot\/dovecot.conf protocols = imap pop3 lmtp # \u0434\u043b\u044f \u0441\u0432\u044f\u0437\u043a\u0438 \u0441 Exim \u0431\u0443\u0434\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c LMTP <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"bash\">\/usr\/local\/etc\/dovecot\/dovecot-sql.conf.ext driver = pgsql connect = host=localhost dbname=mail user=mail password=password default_pass_scheme = MD5  iterate_query = \\     SELECT mail.mailbox || '@' || ldomain.domain || '.' || mdomain.domain AS user \\ \tFROM mail \\ \t    INNER JOIN mdomain ON ( mail.mdomain_id = mdomain.id ) \\ \t    INNER JOIN ldomain ON ( mail.ldomain_id = ldomain.id )   password_query = \\     SELECT mail.mailbox || '@' || ldomain.domain || '.' || mdomain.domain AS mail, mail.password \\ \tFROM mail \\ \t    INNER JOIN mdomain ON ( mail.mdomain_id = mdomain.id ) \\ \t    INNER JOIN ldomain ON ( mail.ldomain_id = ldomain.id ) \\ \t\tWHERE mailbox = '%n' AND \\ \t\t    ldomain.domain || '.' || mdomain.domain = '%d' AND \\ \t\t    mail.active = true AND \\ \t\t    ldomain.active = 'true'  user_query = \\     SELECT '\/usr\/mail\/' || ldomain.domain || '.' || mdomain.domain || '\/' || mail.mailbox  AS home  \\ \tFROM mail \\ \t    INNER JOIN ldomain ON ( mail.ldomain_id = ldomain.id ) \\ \t    INNER JOIN mdomain ON ( mail.mdomain_id = mdomain.id ) \\ \t\tWHERE mail.mailbox = '%n' AND \\ \t\t\tldomain.domain || '.' || mdomain.domain = '%d' <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"bash\">\/usr\/local\/etc\/dovecot\/conf.d\/10-auth.conf auth_username_format = %Lu # \u0444\u043e\u0440\u043c\u0430\u0442 \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 mail@ldomain.mdomain.ru !include auth-sql.conf.ext <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"bash\">\/usr\/local\/etc\/dovecot\/conf.d\/10-mail.conf mail_location =  maildir:\/usr\/mail\/%d\/%n\/Maildir #\u041f\u0443\u0442\u044c \u0432 \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u043a \u044f\u0449\u0438\u043a\u0430\u043c \/usr\/mail\/\u0434\u043e\u043c\u0435\u043d 2-\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f\/\u0434\u043e\u043c\u0435\u043d 3-\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f\/\u044f\u0449\u0438\u043a\/ <\/code><\/pre>\n<p>  <b>\u0421\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u044f \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449<\/b><br \/>  \u0418\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e, \u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043b \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u044e \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430\u043c\u0438 \u0441\u0430\u043c\u043e\u0433\u043e Dovecot (dsync) \u043d\u043e, \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u044d\u043a\u0441\u043f\u043b\u0443\u0430\u0442\u0430\u0446\u0438\u0438 \u0432\u044b\u043b\u0435\u0437\u043b\u0430 \u043e\u0447\u0435\u043d\u044c \u043d\u0435\u043f\u0440\u0438\u044f\u0442\u043d\u0430\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430. \u041a\u0430\u043a \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c, \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0431\u044b\u043b\u0430 \u0441\u0432\u044f\u0437\u0430\u043d\u0430 \u0441 \u0442\u0438\u043f\u043e\u043c \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430 Maildir. Dsync \u0441\u0442\u0430\u043b \u0441\u0431\u043e\u0438\u0442\u044c, \u043f\u043b\u043e\u0434\u0438\u0442\u044c \u043a\u043e\u043f\u0438\u0438 \u043f\u0438\u0441\u0435\u043c \u043e\u0442\u0436\u0438\u0440\u0430\u044f \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u043e\u0435 \u043c\u0435\u0441\u0442\u043e \u043d\u0430 \u0434\u0438\u0441\u043a\u0430\u0445. \u041a \u0442\u043e\u043c\u0443 \u043c\u043e\u043c\u0435\u043d\u0442\u0443 \u044f \u0443\u0436\u0435 \u043d\u0435 \u043c\u043e\u0433 \u043f\u0435\u0440\u0435\u0432\u0435\u0441\u0442\u0438 \u0432\u0441\u0435 \u043f\u043e\u0447\u0442\u043e\u0432\u044b\u0435 \u044f\u0449\u0438\u043a\u0438 \u043d\u0430 dbox (\u0444\u0438\u0440\u043c\u0435\u043d\u043d\u044b\u0439 \u0444\u043e\u0440\u043c\u0430\u0442 Dovecot) \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u043e\u0442\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u043e\u0442 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c dsync. \u0412 \u0446\u0435\u043b\u043e\u043c \u0436\u0435, \u043a \u044d\u0442\u043e\u043c\u0443 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0443 \u0434\u0440\u0443\u0433\u0438\u0445 \u043f\u0440\u0435\u0442\u0435\u043d\u0437\u0438\u0439 \u043d\u0435 \u0431\u044b\u043b\u043e. <br \/>  \u041f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c\u0441\u044f \u043a rsync, \u043d\u0435\u0445\u0438\u0442\u0440\u044b\u043c \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u043c \u043e\u043d \u0431\u0435\u0440\u0435\u0442 \u0438\u0437 \u0431\u0430\u0437\u044b \u0442\u0435 \u0434\u043e\u043c\u0435\u043d\u044b \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0431\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043e\u043d \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u0438 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u0438\u0445 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0438 \u043d\u0430 \u0432\u0442\u043e\u0440\u043e\u0439 \u0441\u0435\u0440\u0432\u0435\u0440. \u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0432\u0435\u043d\u043d\u043e, \u043d\u0430 \u0432\u0442\u043e\u0440\u043e\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u0442\u0430\u043a\u043e\u0439 \u0436\u0435 \u0441\u043a\u0440\u0438\u043f\u0442 \u0433\u043e\u043d\u0438\u0442 \u043d\u0430 \u043f\u0435\u0440\u0432\u044b\u0439 \u0441\u0432\u043e\u0438 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0438. \u041a\u043e\u043d\u0435\u0447\u043d\u043e \u044d\u0442\u043e\u0442 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u043c\u0435\u043d\u0435\u0435 \u043d\u0430\u0434\u0435\u0436\u0435\u043d \u0442\u0430\u043a \u043a\u0430\u043a rsync \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u043f\u043e \u0440\u0430\u0441\u043f\u0438\u0441\u0430\u043d\u0438\u044e, \u0435\u0441\u0442\u044c \u043e\u043a\u043d\u043e \u043c\u0435\u0436\u0434\u0443 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u043c\u0438 \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0435\u0441\u043b\u0438 \u0441\u0435\u0440\u0432\u0435\u0440 \u0432\u044b\u0439\u0434\u0435\u0442 \u0438\u0437 \u0441\u0442\u0440\u043e\u044f \u043c\u044b \u043f\u043e\u0442\u0435\u0440\u044f\u0435\u043c \u043f\u0438\u0441\u044c\u043c\u0430.<\/p>\n<p>  \u0441\u043a\u0440\u0438\u043f\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u0441 \u0434\u0432\u0443\u043c\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438 \u2014 \u0438\u043c\u044f_\u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e_\u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0438\u043c\u044f_\u0443\u0434\u0430\u043b\u0435\u043d\u043d\u043e\u0433\u043e_\u0441\u0435\u0440\u0432\u0435\u0440\u0430  <\/p>\n<pre><code class=\"bash\">#mailrsync.pl storage-01.domain.ru storage-02.domain.ru  <\/code><\/pre>\n<p>  \u0441\u043a\u0440\u0438\u043f\u0442 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438:  <\/p>\n<pre><code class=\"perl\">#!\/usr\/local\/bin\/perl use DBI; use threads; use Net::Nslookup; use Sys::Hostname;  @host = split('\\.',hostname);  $dbn=&quot;mail&quot;; $dbuser=&quot;mail&quot;; $dbpass = &quot;password&quot; $curdata=`date +%Y-%m`; chop $curdata; $conn=DBI-&gt;connect(&quot;DBI:Pg:dbname=$dbn;host=localhost&quot;,&quot;$dbuser&quot;,&quot;$dbpass&quot;) or die &quot;Cannot connect&quot;; ($localhostname,$remotehost)=@ARGV; $mail_dir = &quot;\/usr\/mail\/&quot;;  sub domains {     $q = &quot;SELECT ldomain.domain,mdomain.domain,maps.storage1                                   FROM mail                                       INNER JOIN ldomain on (mail.ldomain_id = ldomain.id)                                       INNER JOIN mdomain on (mail.mdomain_id = mdomain.id)                                       INNER JOIN maps on (maps.ldomain_id=ldomain.id)                                          WHERE maps.storage1='&quot;.$localhostname.&quot;'                                              AND mail.mailbox ='dir'&quot;;    $domain = $conn-&gt;prepare($q)          or die &quot;Can't prepare statement: $DBI::errstr&quot;;     $domain-&gt;execute();     while (  my @domain = $domain-&gt;fetchrow_array ) {                 @domains=(@domains,$domain[0].&quot;.&quot;.$domain[1]);            }     print &quot;count of domains: &quot;.($#domains + 1).&quot;\\n&quot;;     $dt = 2; # \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0434\u043e\u043c\u0435\u043d\u043e\u0432 \u0432 \u043e\u0434\u043d\u043e\u043c \u0442\u0440\u0435\u0434\u0435     $count = ($#domains \/ $dt );     print &quot;count: &quot;.$count.&quot;\\n&quot;;     $i1 = 0;      for ($i2 = 0; $i2&lt; $count; $i2++){             if ($dt &gt; $#domains  ){$dt = $#domains ;}              print $dt.&quot;\\n&quot;;             print &quot;loop: &quot;.$i2.&quot;\\n&quot;;                      foreach $item (@domains[$i1..$m]){                print &quot;in \\@domains: &quot;.$mail_dir.$item.&quot;\\n&quot;;                @stack = (@stack,$mail_dir.$item.&quot;\/&quot;);             }             push @threads,threads-&gt;create(\\&sync,\\@stack);            $i1 = $dt+1;            $dt = $dt + 2;            @stack=();       } }  sub sync {     print &quot;sync\\n&quot;;    foreach $target (@stack){          system(`\/usr\/local\/bin\/rsync -H --delete-during -azz -e &quot;\/usr\/bin\/ssh -i \/root\/.ssh\/dovecot_dsa&quot; $target vmail\\@$remotehost:$target`);          print $target.&quot;\\n&quot;;     }  }  domains(); foreach $thread (@threads) {                  $thread-&gt;join();            } <\/code><\/pre>\n<p>  \u041d\u0430 \u044d\u0442\u043e\u043c \u0441 Dovecot, \u0432\u0441\u0435.<\/p>\n<p>  <b>Exim<\/b><br \/>  \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0435 \u0434\u043e\u043c\u0435\u043d\u044b, \u0438\u0441\u0445\u043e\u0434\u044f \u0438\u0437 \u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 maps, \u0434\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b Exim \u00ab\u0437\u043d\u0430\u043b\u00bb \u0441\u0432\u043e\u0438 \u0434\u043e\u043c\u0435\u043d\u044b.  <\/p>\n<pre><code class=\"bash\">domainlist LOCAL_DOMAINS =  \\      ${lookup pgsql{\\     \t    SELECT ldomain.domain || '.' || mdomain.domain AS domainname \\ \t\tFROM ldomain, mdomain,maps \\ \t\t    WHERE ldomain.domain || '.' || mdomain.domain = LOWER('${quote_pgsql:$domain}') \\ \t\t        AND ldomain.active = 'true' \\ \t\t        AND  maps.storage1 = 'storage-01.domain.ru' \\ \t                AND maps.ldomain_id = ldomain.id}} <\/code><\/pre>\n<p>  \u0432 hostlist relay_from_hosts \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044e \u0430\u0434\u0440\u0435\u0441\u0430 smtp \u043d\u043e\u0434 \u0438 \u043f\u0440\u043e\u043a\u0441\u0438, \u043e\u0442 \u043d\u0438\u0445 \u044f \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e \u043f\u043e\u0447\u0442\u0443 \u0431\u0435\u0437 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 (\u043a\u043b\u0438\u0435\u043d\u0442\u044b \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0443\u044e\u0442\u0441\u044f \u043d\u0430 \u043f\u0440\u043e\u043a\u0441\u0438).  <\/p>\n<pre><code class=\"bash\"> relay_from_hosts = localhost : smtp01.domain.ru : smtp02.domain.ru : mail.domain.ru  <\/code><\/pre>\n<p>  \u0412\u0445\u043e\u0434\u044f\u0449\u0443\u044e \u043f\u043e\u0447\u0442\u0443 \u043e\u0442\u0434\u0430\u044e \u0447\u0435\u0440\u0435\u0437 LMPT Dovecot-\u0443. \u0412 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u043c \u0432\u0441\u0435 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e. \u0417\u0430\u043f\u0440\u043e\u0441\u044b \u043a \u0411\u0414 \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u044f\u0449\u0438\u043a\u043e\u0432 \u0438 \u043f\u0430\u0440\u043e\u043b\u0435\u0439 \u0442\u0430\u043a\u0438\u0435 \u0436\u0435 \u043a\u0430\u043a \u0432 \u043b\u0438\u0441\u0442\u0438\u043d\u0433\u0435 \u0434\u043b\u044f Dovecot-a<\/p>\n<p>  <b>SMTP \u043d\u043e\u0434\u044b<\/b><br \/>  \u0411\u0414, \u0442\u0430\u043a\u0430\u044f \u0436\u0435 \u043a\u0430\u043a \u043d\u0430 \u0441\u0442\u043e\u0440\u0430\u0434\u0436\u0430\u0445, \u0437\u0430 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 mail \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043f\u043e\u043b\u0435 password, \u0442.\u043a. \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u043d\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u044e\u0442\u0441\u044f \u043a \u044d\u0442\u0438\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0430\u043c. smtp \u043d\u043e\u0434\u044b \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0442 \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0439 \u0438\u0437 \u043c\u0438\u0440\u0430 \u0442\u0440\u0430\u0444\u0438\u043a. \u041f\u043e \u0431\u0430\u0437\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u044e\u0442 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043b\u0438 \u044f\u0449\u0438\u043a, \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0430\u044f \u0434\u0430\u043b\u044c\u0448\u0435 \u043f\u0438\u0441\u044c\u043c\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u044f\u0449\u0438\u043a\u043e\u0432. <\/p>\n<p>  <b>Exim<\/b>\u00a0<br \/>  \u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u043a\u043e\u043d\u0444\u0438\u0433, \u0437\u0430 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0430  <\/p>\n<pre><code class=\"sql\">ROUTE_LIST =  &quot;${lookup pgsql{\\                    SELECT  COALESCE(storage1,'') || ' : ' || COALESCE(storage2,'') \\ \t\t        FROM (\\                                  SELECT storage1,storage2 \\                                     FROM maps \\                                         INNER JOIN ldomain ON ( maps.ldomain_id = ldomain.id ) \\ \t\t                        INNER JOIN mdomain ON ( maps.mdomain_id = mdomain.id ) \\ \t\t\t                    WHERE ldomain.domain || '.' || mdomain.domain =  '${quote_pgsql:$domain}' \\ \t                      UNION ALL \\ \t                        SELECT storage1,storage2 \\ \t                            FROM co_maps \\ \t                                INNER JOIN co_domain ON ( co_maps.domain_id = co_domain.id ) \\ \t                                    WHERE co_domain.domain  =  '${quote_pgsql:$domain}') AS foo}}&quot;  <\/code><\/pre>\n<p>  SQL \u0437\u0430\u043f\u0440\u043e\u0441 \u0432\u044b\u0442\u044f\u0433\u0438\u0432\u0430\u0435\u0442 \u0438\u043c\u044f \u0441\u0442\u043e\u0440\u0430\u0434\u0436\u0430 \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u0435\u043b\u044f, \u0437\u0430\u0442\u0435\u043c \u0430\u0434\u0440\u0435\u0441 \u0441\u0442\u043e\u0440\u0430\u0434\u0436\u0430 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u0440\u043e\u0443\u0442\u0435\u0440\u0435, \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u0435 route_list. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043f\u0438\u0441\u044c\u043c\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0430 \u0442\u043e\u0442 \u0441\u0442\u043e\u0440\u0430\u0434\u0436 \u0433\u0434\u0435 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0439 \u0434\u043e\u043c\u0435\u043d \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u044f\u0449\u0438\u043a\u0430.   <\/p>\n<pre><code class=\"bash\">begin routers  DATASTORE:     driver = manualroute     domains = DOMAINS     transport = remote_smtp     condition = MAILS     route_list = * ROUTE_LIST     no_more <\/code><\/pre>\n<p>  \u0417\u0430\u043f\u0440\u043e\u0441\u044b \u043a \u0411\u0414 \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u044f\u0449\u0438\u043a\u043e\u0432 \u0438 \u043f\u0430\u0440\u043e\u043b\u0435\u0439 \u0442\u0430\u043a\u0438\u0435 \u0436\u0435 \u043a\u0430\u043a \u0432 \u043b\u0438\u0441\u0442\u0438\u043d\u0433\u0435 \u0434\u043b\u044f Dovecot.<\/p>\n<p>  <b>PROXY<\/b><br \/>  \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u043e\u043a\u0441\u0438 \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0441\u0442\u0443\u043f\u0430\u0442\u044c \u0442\u043e\u0442 \u0436\u0435 Dovecot, \u043d\u043e \u044f \u0432\u044b\u0431\u0440\u0430\u043b Nginx, \u043e\u043d \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u043f\u0440\u043e\u0449\u0435 \u0438 \u043f\u043e\u043d\u044f\u0442\u043d\u0435\u0439 \u0432 \u044d\u0442\u043e\u043c \u043f\u043b\u0430\u043d\u0435. \u0421\u0442\u043e\u044f\u043b\u0430 \u043e\u0434\u043d\u0430 \u0437\u0430\u0434\u0430\u0447\u0430, \u043a\u0430\u043a\u0438\u043c \u0442\u043e \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c nginx-\u0443 \u043a\u0443\u0434\u0430 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f.<\/p>\n<p>  nginx.conf \u043d\u0430 PROXY  <\/p>\n<pre><code class=\"bash\">cat \/usr\/local\/etc\/nginx\/nginx.conf worker_processes  1; worker_rlimit_nofile 8192; pid \/var\/run\/nginx.pid; error_log  \/var\/log\/nginx-error.log debug; error_log  \/var\/log\/nginx-error.log  notice; error_log  \/var\/log\/nginx-error.log  info;  events {   worker_connections  8192;  ## Default: 1024   multi_accept on;   use kqueue; }  mail {     ssl_certificate \/usr\/local\/etc\/ssl\/proxy.crt;     ssl_certificate_key \/usr\/local\/etc\/ssl\/proxy.key;     ssl_session_timeout 5m;     xclient off;      auth_http  storage-01.domain.ru:8185\/auth;      pop3_capabilities\t&quot;LAST&quot; &quot;TOP&quot; &quot;USER&quot; &quot;PIPELINING&quot; &quot;UIDL&quot; &quot;RESP-CODES&quot; &quot;EXPIRE&quot; &quot;IMPLEMENTATION&quot;;     imap_capabilities\t&quot;IMAP4&quot; &quot;IMAP4rev1&quot; &quot;UIDPLUS&quot; &quot;IDLE&quot; &quot;LITERAL+&quot; &quot;QUOTA&quot; &quot;LIST-EXTENDED&quot;;     smtp_capabilities\t&quot;SIZE 52428800&quot; &quot;8BITMIME&quot; &quot;PIPELINING&quot; &quot;STARTTLS&quot; &quot;HELP&quot;;      server {           smtp_auth\tlogin plain;           listen 25;           protocol smtp;           proxy on;           starttls on;     }          server {           smtp_auth\tlogin plain;           listen 587;           protocol smtp;           proxy on;           starttls on;     }          server {           listen 110;           protocol pop3;           proxy on;           starttls on;     }     server {           listen 995;           protocol pop3;           proxy on;           starttls on;     }          server {           listen 143;           protocol imap;           proxy on;           starttls on;     }     server {           listen 993;           protocol imap;           proxy on;           starttls on;     } } <\/code><\/pre>\n<p>  \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u0443 <code>auth_http storage-01.domain.ru:8185\/auth;<\/code><br \/>  <b>\u041d\u0430 \u0441\u0442\u043e\u0440\u0430\u0434\u0436\u0435<\/b>(\u043d\u0430 \u043e\u0431\u043e\u0438\u0445!) \u0442\u043e\u0436\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 Nginx, \u043d\u043e \u0432 \u0440\u0435\u0436\u0438\u043c\u0438 web \u0441\u0435\u0440\u0432\u0435\u0440\u0430, \u0441 \u043e\u0434\u043d\u043e\u0439 \u043b\u0438\u0448\u044c \u0446\u0435\u043b\u044c\u044e \u2014 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441 storage-01.domain.ru:8185\/auth<br \/>  \u042d\u0442\u043e\u0442 \u0437\u0430\u043f\u0440\u043e\u0441 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0443\u0434\u0430\u0447\u043d\u043e\u0439 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0441\u0442\u0430\u0442\u0443\u0441 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438, \u0438\u043c\u044f \u0441\u0442\u043e\u0440\u0430\u0436\u0434\u0430 \u0438 \u043f\u043e\u0440\u0442 \u0441\u0435\u0440\u0432\u0438\u0441\u0430  <\/p>\n<pre><code class=\"bash\">&quot;Auth-Status&quot;, &quot;OK&quot;; &quot;Auth-Server&quot;, &quot;storage-01.domain.ru&quot;; &quot;Auth-Port&quot;, &quot;143&quot;; <\/code><\/pre>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e, nginx \u043d\u0430 PROXY \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u043d\u0430 \u0441\u0442\u043e\u0440\u0430\u0434\u0436 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u0435\u0440\u043d\u0443\u043b\u0441\u044f \u0432 \u043e\u0442\u0432\u0435\u0442\u0435.<br \/>  \u041c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u044c nginx \u043d\u0430 \u0441\u0442\u043e\u0440\u0430\u0434\u0436\u0435, \u043d\u043e \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0431\u044b \u0438 \u043d\u0430 PROXY \u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0431\u0430\u0437\u0443 \u0441 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c\u0438. \u0412 \u043e\u0431\u0449\u0435\u043c \u043c\u043e\u0433\u043b\u0438 \u0431\u044b\u0442\u044c \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b.<\/p>\n<p>  \u041d\u0438\u0436\u0435 \u043a\u043e\u043d\u0444\u0438\u0433 Nginx \u043d\u0430 \u0441\u0442\u043e\u0440\u0430\u0434\u0436\u0435, \u0441 \u043c\u043e\u0434\u0443\u043b\u0435\u043c \u043d\u0430 perl \u0434\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0432\u044b\u0448\u0435\u043e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0433\u043e.  <\/p>\n<pre><code class=\"bash\">worker_processes  4; worker_rlimit_nofile 8192; error_log  \/var\/log\/nginx-error.log  info;  events {   worker_connections  8192;   multi_accept on; } http {     perl_modules  perl\/lib;     perl_require  mailauth.pm;     perl_require  Digest.pm;         access_log off;      server { \tlisten 8185; \tssl_certificate \/usr\/local\/etc\/ssl\/storage-01.crt; \tssl_certificate_key \/usr\/local\/etc\/ssl\/storage-01.key; \tssl_session_timeout 5m;  \tlocation \/auth { \t    perl  mailauth::handler; \t    proxy_set_header X-Real-IP $remote_addr; \t}     } } <\/code><\/pre>\n<p>  \u043c\u043e\u0434\u0443\u043b\u044c mailauth.pm  <\/p>\n<pre><code class=\"perl\">package mailauth; use nginx; use DBI; use Net::Nslookup; use Digest::MD5 qw(md5_hex);  $pg_user = &quot;mail&quot;; $pg_pass = &quot;password&quot;; $passhost = &quot;localhost&quot;; $mapshost = &quot;localhost&quot;;  our $auth_ok; $protocol_ports-&gt;{'pop3'}=110; $protocol_ports-&gt;{'imap'}=143; $protocol_ports-&gt;{'smtp'}=25; $protocol_ports-&gt;{'smtpssl'}=465;   sub handler {      $r = shift;          $Passdbh=DBI-&gt;connect(&quot;DBI:Pg:dbname=mail;host=$passhost&quot;,&quot;$pg_user&quot;,&quot;$pg_pass&quot;);         if (!$Passdbh) {              $r-&gt;header_out(&quot;Auth-Status&quot;, &quot;OK&quot;) ;              $r-&gt;header_out(&quot;Auth-Server&quot;, '0.0.0.0');              $r-&gt;header_out(&quot;Auth-Port&quot;, $protocol_ports-&gt;{$r-&gt;header_in(&quot;Auth-Protocol&quot;)});              $r-&gt;send_http_header(&quot;text\/html&quot;);               return OK;              exit;          };           $Mapsdbh=DBI-&gt;connect(&quot;DBI:Pg:dbname=mail;host=$mapshost&quot;,&quot;$pg_user&quot;,&quot;$pg_pass&quot;);           $auth_ok=0;          $mailbox = $r-&gt;header_in(&quot;Auth-User&quot;);          our $get_pass_from_db=$Passdbh-&gt;prepare(&quot;SELECT password FROM mail                                                  INNER JOIN ldomain ON ( mail.ldomain_id = ldomain.id )                                                  INNER JOIN mdomain ON ( mail.mdomain_id = mdomain.id )                                                  WHERE mail.mailbox || '\\@' || ldomain.domain || '.' || mdomain.domain = ? &quot;);      $get_pass_from_db-&gt;execute($mailbox);     @row=$get_pass_from_db-&gt;fetchrow_array();     $passfromDB=@row[0];      $md5passFromConnect = md5_hex($r-&gt;header_in(&quot;Auth-Pass&quot;));      if ( $passfromDB eq $md5passFromConnect ){             $auth_ok=1;     }     if ($auth_ok==1){           @domain = split('\\@',$mailbox);           $get_server_from_maps = $Mapsdbh-&gt;prepare(                            &quot;SELECT storage1  FROM maps                                   INNER JOIN ldomain ON ( maps.ldomain_id = ldomain.id ) \\                                   INNER JOIN mdomain ON ( maps.mdomain_id = mdomain.id ) \\                                        WHERE ldomain.domain || '.' || mdomain.domain = ? &quot;            );          $get_server_from_maps-&gt;execute(@domain[1]);         @row=$get_server_from_maps-&gt;fetchrow_array();         $server_from_maps = nslookup(host =&gt; $row[0], type =&gt; &quot;A&quot;);         $r-&gt;header_out(&quot;Auth-Status&quot;, &quot;OK&quot;) ;         $r-&gt;header_out(&quot;Auth-Server&quot;, $server_from_maps);         $r-&gt;header_out(&quot;Auth-Port&quot;, $protocol_ports-&gt;{$r-&gt;header_in(&quot;Auth-Protocol&quot;)});     } else {         $r-&gt;header_out(&quot;mail:&quot;, $r-&gt;header_in(&quot;Auth-User&quot;));         $r-&gt;header_out(&quot;Auth-Status&quot;, &quot;Invalid login or password&quot;) ;     }    $r-&gt;send_http_header(&quot;text\/html&quot;);    return OK; }  sub db_fail {     $r-&gt;header_out(&quot;Auth-Status&quot;, &quot;OK&quot;) ;     $r-&gt;header_out(&quot;Auth-Server&quot;, '127.0.0.1');     $r-&gt;send_http_header(&quot;text\/html&quot;); }  1; __END__ <\/code><\/pre>\n<p>  <b>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0438, \u0438 \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043d\u0430 \u0440\u0435\u0437\u0435\u0440\u0432\u043d\u0443\u044e \u043d\u043e\u0434\u0443<\/b><br \/>  \u0421\u0435\u0439\u0447\u0430\u0441 \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043d\u0430 \u0440\u0435\u0437\u0435\u0440\u0432\u043d\u0443\u044e \u043d\u043e\u0434\u0443 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432 \u0440\u0443\u0447\u043d\u043e\u043c \u0440\u0435\u0436\u0438\u043c\u0435. \u041f\u0440\u043e\u0441\u0442\u043e \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 maps \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432 \u043f\u043e\u043b\u0435 storage1. \u0422.\u041a. \u0432\u0441\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0443\u0432\u0435\u0448\u0435\u043d\u044b \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u043e\u043c \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u043a\u0430 \u0431\u044b\u043b\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e.<\/p>\n<p>  <b>\u0417\u0410\u041a\u041b\u042e\u0427\u0415\u041d\u0418\u0415<\/b><br \/>  \u041a\u043b\u0430\u0441\u0442\u0435\u0440 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0443\u0436\u0435 3 \u0433\u043e\u0434\u0430. \u0417\u0430 \u044d\u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043f\u0435\u0440\u0435\u0436\u0438\u043b \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0430\u0434\u0435\u043d\u0438\u0439 \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u043d\u043e\u0434 ( \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u044d\u0442\u0430 \u043d\u043e\u0434\u0430 \u043f\u0435\u0440\u0435\u0435\u0445\u0430\u043b\u0430 \u0432 \u0434\u0440\u0443\u0433\u043e\u0439 \u0414\u0426). <\/p>\n<p>  \u041a\u043e\u043c\u0443-\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0441\u044f \u044d\u0442\u0430 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u0441\u043b\u043e\u0436\u043d\u043e\u0439, \u0437\u0430\u043f\u0443\u0442\u0430\u043d\u043d\u043e\u0439 \u0438 \u00ab\u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434\u043e\u043c\u00bb. \u041d\u043e \u0445\u043e\u0447\u0443 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0430\u043a\u0446\u0435\u043d\u0442 \u043d\u0430 \u0442\u043e\u043c, \u0447\u0442\u043e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0438\u0441\u0445\u043e\u0434\u0438\u043b\u0430 \u0438\u0437 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u0435\u0448\u0435\u0432\u043e\u0435, \u00ab\u043d\u0435\u043d\u0430\u0434\u0435\u0436\u043d\u043e\u0435\u00bb \u0436\u0435\u043b\u0435\u0437\u043e. \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0438\u043c\u0435\u0435\u043c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0438\u0441 \u0441 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c\u044e \u0430\u0440\u0435\u043d\u0434\u044b \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432.<\/p>\n<p>  \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u043a\u0430 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0430\u0441\u044c \u043d\u0435 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u043e\u0439, \u0438 \u044f \u043d\u0435 \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u043b \u043a\u0430\u043a\u0438\u0435 \u0442\u043e \u0432\u0430\u0436\u043d\u044b\u0435 \u0434\u0435\u0442\u0430\u043b\u0438. \u0412 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445, \u0435\u0441\u043b\u0438 \u0431\u0443\u0434\u0443\u0442, \u0431\u0443\u0434\u0443 \u0434\u043e\u043f\u043e\u043b\u043d\u044f\u0442\u044c. <\/p>\n<p>  \u041f\u0421. \u0421\u0442\u0430\u0442\u044c\u044f \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0430\u0441\u044c \u0434\u043b\u0438\u043d\u043d\u043e\u0439, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u043e \u0434\u0435\u0434\u0443\u043f\u043b\u0438\u043a\u0430\u0446\u0438\u044e \u0438 \u0435\u0449\u0435 \u043e\u0434\u043d\u043e\u043c, \u043d\u0435 \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u043e\u043c \u0437\u0434\u0435\u0441\u044c \u0441\u0435\u0440\u0432\u0438\u0441\u0435 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u044d\u0442\u0438\u043c \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u043e\u043c \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0437\u0430\u043c\u0435\u0442\u043a\u0435, \u0435\u0441\u043b\u0438 \u044d\u0442\u043e \u0432\u044b\u0437\u043e\u0432\u0435\u0442 \u0438\u043d\u0442\u0435\u0440\u0435\u0441.<\/p>\n<p>  \u0421\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435!<br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habrahabr.ru\/post\/324538\/\"> https:\/\/habrahabr.ru\/post\/324538\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0421\u0440\u0430\u0437\u0443 \u043e\u0433\u043e\u0432\u043e\u0440\u044e\u0441\u044c \u0447\u0442\u043e \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u0443\u044e \u0437\u0430\u0434\u0430\u0447\u0443 \u043c\u043e\u0436\u043d\u043e \u0440\u0435\u0448\u0438\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u043c\u0438. \u042d\u0442\u043e\u0442 \u043e\u0434\u0438\u043d \u0438\u0437 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445. <br \/>  \u0421\u0442\u0430\u0442\u044c\u044f \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u043d\u0430 \u043d\u0430 \u0442\u0435\u0445, \u043a\u0442\u043e \u0437\u043d\u0430\u0435\u0442 \u043a\u0430\u043a \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 Exim \u0438 Dovecot, \u0438 \u0432 \u043d\u0435\u0439 \u044f \u043d\u0435 \u0431\u0443\u0434\u0443\u0442 \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u0445 \u044d\u0442\u0438\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432.<\/p>\n<p>  \u041d\u0430\u0434\u0435\u044e\u0441\u044c \u0447\u0442\u043e \u043a\u0442\u043e-\u0442\u043e, \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0432 \u0437\u0430\u043c\u0435\u0442\u0443, \u043f\u043e\u043b\u0443\u0447\u0438\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0437\u043d\u0430\u043d\u0438\u044f \u0438\u043b\u0438 \u0438\u0434\u0435\u0438 \u0434\u043b\u044f \u0432\u043e\u043f\u043b\u043e\u0449\u0435\u043d\u0438\u044f \u0441\u0432\u043e\u0435\u0433\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u044f.<\/p>\n<p>  \u0417\u0430\u0434\u0430\u0447\u0430 \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043e\u0442\u043a\u0430\u0437\u043e\u0443\u0441\u0442\u043e\u0439\u0447\u0438\u0432\u044b\u0439 \u0441\u0435\u0440\u0432\u0438\u0441, \u0441 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435\u043c \u043f\u043e\u0447\u0442\u044b \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430\u0445, \u0441 \u0434\u043e\u0441\u0442\u0443\u043f\u043e\u043c \u043f\u043e IMAP.<br \/>  \u041a\u043b\u0430\u0441\u0442\u0435\u0440 \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u0442\u044c \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u044e \u0441 \u043f\u043e\u0440\u044f\u0434\u043a\u043e\u043c 60-\u0442\u0438 \u0444\u0438\u043b\u0438\u0430\u043b\u043e\u0432, \u043a\u0430\u0436\u0434\u044b\u0439 \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0438\u043c\u0435\u0435\u0442 \u0441\u0432\u043e\u0439 \u0434\u043e\u043c\u0435\u043d 3-\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f. <\/p>\n<p>  \u0413\u043b\u0430\u0432\u043d\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430 \u0441\u0435\u0440\u0432\u0438\u0441\u0430, \u0431\u0435\u0441\u043f\u0440\u0435\u0440\u044b\u0432\u043d\u044b\u0439 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043f\u043e\u0447\u0442\u0435. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430 \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u0432\u0430 \u0433\u0435\u043e\u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0438 \u0440\u0430\u0437\u043d\u0435\u0441\u0435\u043d\u043d\u044b\u0445 \u0441\u0435\u0440\u0432\u0435\u0440\u0430, \u0441 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u043f\u043e\u0447\u0442\u043e\u0432\u044b\u0445 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u043e\u0432.<br \/>  \u041e\u0431\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0431\u0443\u0434\u0443\u0442 \u0430\u043a\u0442\u0438\u0432\u043d\u044b\u043c\u0438, \u044d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442 \u0447\u0442\u043e \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u043c\u0435\u0436\u0434\u0443 \u043d\u043e\u0434\u0430\u043c\u0438. \u0427\u0430\u0441\u0442\u044c \u0434\u043e\u043c\u0435\u043d\u043e\u0432 \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u0442\u044c \u043e\u0434\u043d\u0430 \u043d\u043e\u0434\u0430, \u0447\u0430\u0441\u0442\u044c \u0434\u043e\u043c\u0435\u043d\u043e\u0432 \u0434\u0440\u0443\u0433\u0430\u044f. \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0432\u044b\u0445\u043e\u0434\u0430 \u0438\u0437 \u0441\u0442\u0440\u043e\u044f \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u043d\u043e\u0434, \u043a\u043b\u0438\u0435\u043d\u0442\u044b \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u044e\u0442\u0441\u044f \u043d\u0430 \u0434\u0440\u0443\u0433\u0443\u044e.<br \/>  \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434\u0430 \u0434\u043b\u044f <s>\u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438<\/s> \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432 \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Nginx \u0441 \u043c\u043e\u0434\u0443\u043b\u0435\u043c mail. \u0414\u043b\u044f \u043f\u0440\u0438\u0435\u043c\u0430 \u043f\u043e\u0447\u0442\u044b, \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u0432\u0430 smtp \u0441\u0435\u0440\u0432\u0435\u0440\u0430. <\/p>\n<p>  <b>\u0421\u0445\u0435\u043c\u0430:<\/b><br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/319\/723\/d2e\/319723d2e8b04e4eb8a3e12d95030399.jpg\"\/>   <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-283692","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/283692","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=283692"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/283692\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=283692"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=283692"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=283692"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}