Vesta Control Panel - Forum

Community Forum

Skip to content

Advanced search
  • Quick links
    • Main site
    • Github repo
    • Google Search
  • FAQ
  • Login
  • Register
  • Board index Main Section Web Server
  • Search

Метод отправки почты PHP mail()

Questions regarding the Web Server
Apache + Nginx, Nginx + PHP5-FPM
Post Reply
  • Print view
Advanced search
20 posts
  • 1
  • 2
  • Next
NORMANN
Posts: 35
Joined: Fri Aug 30, 2013 11:55 am

Метод отправки почты PHP mail()
  • Quote

Post by NORMANN » Fri Aug 30, 2013 1:19 pm

Доброго времени суток! Не могли бы Вы
помочь мне с настройкой функции PHP mail()
У меня VPS с одним IP на ОС:CentOS 6 32bit с
установленной VESTA и всем необходимым
идущим в комплекте. Сайт на DLE 10 установлен и
работает, но проблема с отправкой почты с сайта
при регистрации, в обратной связи и т.д.
Пишет что письмо успешно отправлено, но не доходит до адресата.
На хостинге сайтов где раньше располагался сайт все
работало, дело не в движке. Перечитал кучу
материала в сети насчет настроек, но только
больше запутался. Знаний Сис.админа у меня
практически "0". Могу только по мануалам все установить.
Можно конечно в движке включить метод отправки SMTP, но по SMTP
тоже не отправляется. В Roundcube письма приходят, отправка так же пишет что успешно отправлено, но не доходит до пункта назначения.
Что в методе отправки PHP mail() , что по SMTP пробовал на разные адреса :
@rambler.ru, @mail.ru , @qip.ru , @gmail.com , @yandex.ru , но результат один и тот же.
Хотя с них со всех прием идет.
Пересмотрел все темы на форуме в разделе Mail Server, попробовал все предложенные там варианты, но пока ни как.
Вернул все как было по умолчанию.
Буду признателен Вам если подскажите где что исправить. Прием почты мне не нужен, мне бы только сделать отправку почты с сайта при регистрации, с обратной связи, при восстановлении пароля и т.д.
ПОСЛЕДНИЕ ЗАПИСИ в main.log exim только вот почему там указана почта root@vps.next-best.net, когда у меня домен next-best.net и ящик [email protected], а переадресация стоит на [email protected]
2013-08-30 08:33:14 End queue run: pid=16848
2013-08-30 08:35:38 1VFNvN-0004n5-VA <= [email protected] U=root P=local S=597
2013-08-30 08:35:38 1VFNvN-0004n5-VA == [email protected] R=dnslookup T=remote_smtp defer (-53): retry time not reached for any host
2013-08-30 08:40:37 1VFO0D-0004xX-Hw <= [email protected] U=root P=local S=597
2013-08-30 08:40:37 1VFO0D-0004xX-Hw == [email protected] R=dnslookup T=remote_smtp defer (-53): retry time not reached for any host
2013-08-30 08:45:39 1VFO55-00055V-CX <= [email protected] U=root P=local S=597
2013-08-30 08:45:39 1VFO55-00055V-CX == [email protected] R=dnslookup T=remote_smtp defer (-53): retry time not reached for any host
2013-08-30 08:50:39 1VFO9v-0005CA-F3 <= [email protected] U=root P=local S=597
2013-08-30 08:50:39 1VFO9v-0005CA-F3 == [email protected] R=dnslookup T=remote_smtp defer (-53): retry time not reached for any host
2013-08-30 08:54:52 1VFOE0-0005D1-M4 <= [email protected] U=admin P=local S=1021
2013-08-30 08:55:40 1VFOEm-0005JI-GV <= [email protected] U=root P=local S=597
2013-08-30 08:55:40 1VFOEm-0005JI-GV == [email protected] R=dnslookup T=remote_smtp defer (-53): retry time not reached for any host
2013-08-30 08:55:48 1VFOEu-0005JN-1m <= [email protected] U=admin P=local S=1014
2013-08-30 08:55:48 1VFOEu-0005JN-1m == [email protected] R=dnslookup T=remote_smtp defer (-53): retry time not reached for any host
2013-08-30 08:55:55 1VFOE0-0005D1-M4 gmail-smtp-in.l.google.com [74.125.130.27] Connection timed out
2013-08-30 08:56:58 1VFOE0-0005D1-M4 alt1.gmail-smtp-in.l.google.com [2607:f8b0:400c:c03::1a] Connection timed out
2013-08-30 08:58:01 1VFOE0-0005D1-M4 alt2.gmail-smtp-in.l.google.com [2a00:1450:400c:c00::1a] Connection timed out
2013-08-30 08:59:04 1VFOE0-0005D1-M4 alt2.gmail-smtp-in.l.google.com [173.194.67.26] Connection timed out
2013-08-30 09:00:07 1VFOE0-0005D1-M4 alt3.gmail-smtp-in.l.google.com [173.194.65.27] Connection timed out
2013-08-30 09:01:10 1VFOE0-0005D1-M4 alt4.gmail-smtp-in.l.google.com [173.194.70.27] Connection timed out
2013-08-30 09:01:10 1VFOE0-0005D1-M4 == [email protected] R=dnslookup T=remote_smtp defer (110): Connection timed out
Top

vitroot
Posts: 22
Joined: Tue Aug 06, 2013 8:57 am
Contact:
Contact vitroot
Website

Re: Метод отправки почты PHP mail()
  • Quote

Post by vitroot » Fri Aug 30, 2013 1:43 pm

такое ощущение, что на сервере проблема с резолвом.
Поставьте в /etc/resolv.conf

Code: Select all

nameserver 8.8.8.8
и проверьте еще раз
Top

NORMANN
Posts: 35
Joined: Fri Aug 30, 2013 11:55 am

Re: Метод отправки почты nameserver 8.8.8.8
  • Quote

Post by NORMANN » Fri Aug 30, 2013 1:58 pm

vitroot wrote:такое ощущение, что на сервере проблема с резолвом.
Поставьте в /etc/resolv.conf

Code: Select all

nameserver 8.8.8.8
и проверьте еще раз
А там уже так стоит изначально. Может что-то с DNS надо сделать? Но у меня один IP. Пробовал MX делать от Яндекса, но тоже самое. Время сутки выжидал и Яндекс подтвердил работу. Хотя в PHP mail() это по моему не причем. В Microsoft Outlook на компе в настройках автоматически показало Сервер входящей почты: next-best.net , Сервер исходящей почты (SMTP): next-best.net . При тестировании там учетной записи показывает что все работает и в Roundcube приходит Тестовое сообщение Microsoft Outlook. Если что, то папки спама тоже проверял. С Microsoft Outlook отправка тоже не проходит, хотя пишет что выполнено успешно.
Top

skid
VestaCP Team
Posts: 1476
Joined: Wed Apr 06, 2011 11:12 pm

Re: Метод отправки почты PHP mail()
  • Quote

Post by skid » Mon Sep 02, 2013 10:55 am

Возможно проблема в iptables. Он включен?
Top

NORMANN
Posts: 35
Joined: Fri Aug 30, 2013 11:55 am

Re: Метод отправки почты PHP mail()
  • Quote

Post by NORMANN » Tue Sep 03, 2013 12:59 am

skid wrote:Возможно проблема в iptables. Он включен?
Нет не включен. А что может помочь, если его включить? По идее если выкючен, то и блокировать не должен.
Top

skid
VestaCP Team
Posts: 1476
Joined: Wed Apr 06, 2011 11:12 pm

Re: Метод отправки почты PHP mail()
  • Quote

Post by skid » Tue Sep 03, 2013 7:13 am

Я как раз о блокировке хотел узнать. Iptables в данном случае может только усложнить положение. Попробуйте отправить письмо на сервер alt2.gmail-smtp-in.l.google.com используюя telnet.
Top

NORMANN
Posts: 35
Joined: Fri Aug 30, 2013 11:55 am

Re: Метод отправки почты PHP mail()
  • Quote

Post by NORMANN » Thu Sep 05, 2013 2:25 am

skid wrote:Я как раз о блокировке хотел узнать. Iptables в данном случае может только усложнить положение. Попробуйте отправить письмо на сервер alt2.gmail-smtp-in.l.google.com используюя telnet.
На третьем пункте Инвалид.
Image
Top

skid
VestaCP Team
Posts: 1476
Joined: Wed Apr 06, 2011 11:12 pm

Re: Метод отправки почты PHP mail()
  • Quote

Post by skid » Thu Sep 05, 2013 7:32 am

Во время helo вместо ip укажите домен.
Top

NORMANN
Posts: 35
Joined: Fri Aug 30, 2013 11:55 am

Re: Метод отправки почты PHP mail()
  • Quote

Post by NORMANN » Thu Sep 05, 2013 1:52 pm

skid wrote:Во время helo вместо ip укажите домен.
Теперь на четвертом пункте 550 реле не допускается.

Image

И логи exim main.log
2013-09-05 09:55:35 1VHQUH-0004zn-ME alt2.gmail-smtp-in.l.google.com [2a00:1450:400c:c00::1b] Connection timed out
2013-09-05 09:56:22 H=vps.next-best.net (next-best.net) [93.188.161.249] F=<[email protected]> rejected RCPT [email protected]: relay not permitted
2013-09-05 09:56:38 1VHQUH-0004zn-ME alt4.gmail-smtp-in.l.google.com [173.194.70.26] Connection timed out
2013-09-05 09:56:38 1VHQUH-0004zn-ME == [email protected] R=dnslookup T=remote_smtp defer (110): Connection timed out
2013-09-05 09:56:38 1VHMgF-0001OX-3Q == [email protected] <[email protected]> R=dnslookup T=remote_smtp defer (-53): retry time not reached for any host
2013-09-05 09:56:38 1VHF1B-0002hQ-0x Message is frozen
2013-09-05 09:56:38 1VHO9I-0002al-0Z == [email protected] <[email protected]> R=dnslookup T=remote_smtp defer (-53): retry time not reached for any host
2013-09-05 09:57:41 1VHQSP-0004zZ-Nt gmail-smtp-in.l.google.com [2607:f8b0:4002:c04::1b] Connection timed out
2013-09-05 09:58:44 1VHQSP-0004zZ-Nt gmail-smtp-in.l.google.com [74.125.140.27] Connection timed out
2013-09-05 09:59:47 1VHQSP-0004zZ-Nt alt2.gmail-smtp-in.l.google.com [2a00:1450:400c:c05::1a] Connection timed out
2013-09-05 10:00:50 1VHQSP-0004zZ-Nt alt2.gmail-smtp-in.l.google.com [173.194.78.27] Connection timed out
2013-09-05 10:01:22 SMTP command timeout on connection from vps.next-best.net (next-best.net) [93.188.161.249]
2013-09-05 10:01:53 1VHQSP-0004zZ-Nt alt3.gmail-smtp-in.l.google.com [74.125.136.27] Connection timed out
2013-09-05 10:02:56 1VHQSP-0004zZ-Nt alt4.gmail-smtp-in.l.google.com [2a00:1450:4001:c02::1a] Connection timed out
2013-09-05 10:02:56 1VHQSP-0004zZ-Nt == [email protected] R=dnslookup T=remote_smtp defer (110): Connection timed out
2013-09-05 10:02:56 1VHQXu-00053w-L5 == [email protected] R=dnslookup T=remote_smtp defer (-53): retry time not reached for any host
2013-09-05 10:02:56 1VHMnX-0001TI-6v == [email protected] R=dnslookup T=remote_smtp defer (-53): retry time not reached for any host
2013-09-05 10:02:57 1VHR1T-0005pd-7J == [email protected] <[email protected]> R=dnslookup T=remote_smtp defer (-53): retry time not reached for any host
2013-09-05 10:02:57 1VHR5J-0005uL-FZ == [email protected] R=dnslookup T=remote_smtp defer (-53): retry time not reached for any host
2013-09-05 10:04:00 1VHMlU-0001T1-2Z alt1.gmail-smtp-in.l.google.com [2607:f8b0:400c:c03::1a] Connection timed out
2013-09-05 10:05:03 1VHMlU-0001T1-2Z alt3.gmail-smtp-in.l.google.com [173.194.65.27] Connection timed out
2013-09-05 10:05:03 1VHMlU-0001T1-2Z == [email protected] R=dnslookup T=remote_smtp defer (110): Connection timed out
2013-09-05 10:05:03 1VHERc-0000zE-Hm Message is frozen
2013-09-05 10:05:03 End queue run: pid=17551
Top

NORMANN
Posts: 35
Joined: Fri Aug 30, 2013 11:55 am

Re: Метод отправки почты PHP mail()
  • Quote

Post by NORMANN » Fri Sep 06, 2013 1:32 am

Поменял в exim.conf
hostlist relay_from_hosts = 127.0.0.1 на
hostlist relay_from_hosts = 127.0.0.1:93.188.161.249 и получилось это.
Image

Последние логи
2013-09-05 21:10:47 1VHkZT-0006nz-UC <= [email protected] U=admin P=local S=1028
2013-09-05 21:10:47 1VHkZT-0006nz-UC == [email protected] R=dnslookup T=remote_smtp defer (-53): retry time not reached for any host
2013-09-05 21:13:42 1VHkcI-0006oM-8x <= [email protected] U=admin P=local S=1828
2013-09-05 21:14:45 1VHkcI-0006oM-8x imx1.rambler.ru [81.19.66.235] Connection timed out
2013-09-05 21:15:48 1VHkcI-0006oM-8x imx1.rambler.ru [81.19.66.234] Connection timed out
2013-09-05 21:15:48 1VHkcI-0006oM-8x == [email protected] R=dnslookup T=remote_smtp defer (110): Connection timed out
2013-09-05 21:16:57 1VHkfR-0006st-7y <= [email protected] U=admin P=local S=1041
2013-09-05 21:18:00 1VHkfR-0006st-7y gmail-smtp-in.l.google.com [74.125.137.26] Connection timed out
2013-09-05 21:19:03 1VHkfR-0006st-7y alt2.gmail-smtp-in.l.google.com [2a00:1450:400c:c03::1a] Connection timed out
2013-09-05 21:20:06 1VHkfR-0006st-7y alt2.gmail-smtp-in.l.google.com [173.194.66.27] Connection timed out
2013-09-05 21:20:06 1VHkfR-0006st-7y == [email protected] R=dnslookup T=remote_smtp defer (110): Connection timed out
2013-09-05 21:24:36 unexpected disconnection while reading SMTP command from vps.next-best.net (next-best.net) [93.188.161.249]
2013-09-05 21:27:53 1VHko2-0006xe-Of <= [email protected] H=vps.next-best.net (next-best.net) [93.188.161.249] P=smtp S=407
2013-09-05 21:28:56 1VHko2-0006xe-Of gmail-smtp-in.l.google.com [2607:f8b0:4002:c04::1a] Connection timed out
2013-09-05 21:29:59 1VHko2-0006xe-Of alt1.gmail-smtp-in.l.google.com [173.194.73.27] Connection timed out
2013-09-05 21:31:02 1VHko2-0006xe-Of alt2.gmail-smtp-in.l.google.com [2a00:1450:400c:c03::1b] Connection timed out
2013-09-05 21:32:05 1VHko2-0006xe-Of alt2.gmail-smtp-in.l.google.com [173.194.66.26] Connection timed out
2013-09-05 21:33:08 1VHko2-0006xe-Of alt3.gmail-smtp-in.l.google.com [2a00:1450:4013:c00::1a] Connection timed out
2013-09-05 21:33:08 1VHko2-0006xe-Of == [email protected] R=dnslookup T=remote_smtp defer (110): Connection timed out
Top


Post Reply
  • Print view

20 posts
  • 1
  • 2
  • Next

Return to “Web Server”



  • Board index
  • All times are UTC
  • Delete all board cookies
  • The team
Powered by phpBB® Forum Software © phpBB Limited
*Original Author: Brad Veryard
*Updated to 3.2 by MannixMD
 

 

Login  •  Register

I forgot my password