🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.lang.php
Article #231310

Re: socket_connect(): unable to connect [111]: Connection refused

#231310
From: Lemat
Date: Wed, 06 Apr 2016 21:20
68 lines
2799 bytes
W dniu 06.04.2016 o 22:11, jivanmukta@poczta.onet.pl pisze:
> Kod:
>
> public function checkMailServer() {
>      list($server, $port) = $this->getMailServerData();
> var_dump($server, $port);
>      $socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
>      if ($socket && socket_connect($socket, $server, $port)) {
>          socket_close($socket);
>          return TRUE;
>      }
>      socket_close($socket);
>      return FALSE;
> }
>
> produkuje:
>
> string(5) "pecet" int(25)
> A PHP Error was encountered
> Severity: Warning
> Message: socket_connect(): unable to connect [111]: Connection refused
> Filename: libraries/Common.php
> Line Number: 468
> An Error Was Encountered
> Serwer poczty nie działa.
>
> mimo, ĹĽe:
>
> $ sudo service --status-all | grep postfix
> [ + ] postfix
> $ mail robert@pecet
> Cc:
> Subject: Test
> Test
> $ mail
> "/var/mail/robert": 1 wiadomość 1 nowa
>
> Jak zmieniłem zmienną $server na localhost to mam:
>
> string(9) "localhost" int(25) SMTP Error: Could not authenticate.
> An Error Was Encountered
> Błąd przy wysyłaniu e-maila. : Błąd przy wysyłaniu e-maila. (SMTP Error: Could not authenticate.)
>
> W /etc/hosts mam:
>
> 127.0.0.1 localhost
> 127.0.1.1 pecet
>
> O co może chodzić? Byłbym wdzięczny za pomoc.
>

to, że serwer poczty chodzi nie oznacza automatycznie, że nasłuchuje na 
interfejsach sieciowych.

poleceniem
netstat -anp|grep :25
wyświetlisz to, co nasłuchuje

Jak na moje "Connection refused" oznacza, że postfix nie nasłuchuje na 
127.0.1.1

"Could not authenticate" to natomiast informacja, ĹĽe postfix oczekuje 
loginu i hasła. Podstawową konfigurację postfixa znajdziesz u mnie na 
stronie.

-- 
Pozdrawiam
Lemat
Technical Details
Message-ID: <57057d1f$0$678$65785112@news.neostrada.pl>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!agh.edu.pl!news.agh.edu.pl!newsfeed2.atman.pl!newsfeed.atman.pl!goblin1!goblin.stu.neva.ru!newsfeed.neostrada.pl!unt-exc-01.news.neostrada.pl!unt-spo-a-02.news.neostrada.pl!news.neostrada.pl.POSTED!not-for-mail
References: <f5d07c84-a3ba-49f1-87ad-ada24bd924f5@googlegroups.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!agh.edu.pl!news.agh.edu.pl!newsfeed2.atman.pl!newsfeed.atman.pl!goblin1!goblin.stu.neva.ru!newsfeed.neostrada.pl!unt-exc-01.news.neostrada.pl!unt-spo-a-02.news.neostrada.pl!news.neostrada.pl.POSTED!not-for-mail
Subject: Re: socket_connect(): unable to connect [111]: Connection refused
Newsgroups: pl.comp.lang.php
References: <f5d07c84-a3ba-49f1-87ad-ada24bd924f5@googlegroups.com>
From: Lemat <#@lemat.priv.pl>
Date: Wed, 6 Apr 2016 23:20:23 +0200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0
MIME-Version: 1.0
In-Reply-To: <f5d07c84-a3ba-49f1-87ad-ada24bd924f5@googlegroups.com>
Lines: 68
Message-ID: <57057d1f$0$678$65785112@news.neostrada.pl>
Organization: Telekomunikacja Polska
NNTP-Posting-Host: 79.189.200.118
X-Trace: 1459977503 unt-rea-a-01.news.neostrada.pl 678 79.189.200.118:48309
X-Complaints-To: abuse@news.neostrada.pl
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit