fetchmail: connection to localhost:smtp [::1/25] failed

Hi,

suddenly, my fetchmail doesn’t work anymore. I use it to fetch mails from a pop3 server applying an .fetchmailrc configuration file which has worked for years. Now, I get this error message:

Trying to connect to ::1/25…connection failed.
fetchmail: connection to localhost:smtp ::1/25] failed: Connection refused.
Trying to connect to 127.0.0.1/25…connection failed.
fetchmail: connection to localhost:smtp [127.0.0.1/25] failed: Connection refused.
fetchmail: Connection errors for this poll:
name 0: connection to localhost:smtp ::1/25] failed: Connection refused.
name 1: connection to localhost:smtp [127.0.0.1/25] failed: Connection refused.
fetchmail: SMTP connect to localhost failed
fetchmail: POP3> QUIT

Apparently, the connection to the pop3 mail server is working alright, but when fetchmail is trying to actually fetch the mails it has trouble saving them into /var/mail/<username>

It might be due to the latest updates. Or it might be due to the fact that I had my laptop (successfully) connected to a wireless network for the first time. However, now I’m back at my old ethernet cable and the problem remains.

Otherwise, I’m not aware of any changes on my system since the last time it worked.

I looked on the internet and got the impression that postfix could be involved but I couldn’t find a good advice so far.
Does someone have an idea what’s going on?

Thank you!

That happened to me about two weeks ago. I restarted the smtp service (“sendmail” in my case), and that solved the problem. No mail was lost – “fetchmail” had not deleted from the server because of the error.

I rechecked after the next boot. And sendmail was still not running. So I used “systemctl enable” to re-enable the service. All has been well since then. I am not sure what went wrong the first time.

Actually, I do have a guess as to what went wrong. There was an update to “sendmail”. And I think there’s a check that the aliases database is newer than the sendmail binary. So it had to be rebuilt, and probably there was a bug in the rebuild or it took too long for “systemd”.

Hi Nrickert,

sounds very reasonable for my case, too. Could you elude on how you were able to “restart sendmail” or “systemctl enable” ? Simply entering it into a console results in “Too few arguments.” in my case.

Thank you for your effort.

Sorry. I gave too few details (because I didn’t know whether you were using “sendmail”).


# systemctl start sendmail.service
# systemctl enable sendmail.service

The first of those starts the service now. The second configures it to automatically start on future boots.

On 2014-07-05 15:36, nrickert wrote:

> Sorry. I gave too few details (because I didn’t know whether you were
> using “sendmail”).
>
>
> Code:
> --------------------
>
> # systemctl start sendmail.service
> # systemctl enable sendmail.service
>
> --------------------

Careful, you have to find out first if you are using sendmail or
postfix, and the default is the later. Starting the wrong one, if
installed, will cause problems.

It is typical for postfix to abort if the IP adress changes, when
changing network. You have to make sure that the entry in the /etc/hosts
file is correct for the current network connection, so just restarting
it may not suffice.

But you should see appropriate messages in the mail logs.


Cheers / Saludos,

Carlos E. R.
(from 13.1 x86_64 “Bottle” at Telcontar)

And once again, Nrickert rescued my system!

I didn’t know whether my system should be using sendmail or postfix. It must have been whatever the OpenSuse installer took as default. And I didn’t really know how to find this out (especially as the process was obviously not running at the moment). However, I looked into the installed software packages using Yast and found that the postfix packages were not installed but one sendmail package.

So I tried the first command

systemctl start sendmail.service

then “fetchmail” and voila: 58 mails were downloaded.
So, I issued the 2nd command and I expect it will work also.

So thanks again for your help!

On 2014-07-08 00:36, flo73 wrote:
>
> And once again, Nrickert rescued my system!
>
> I didn’t know whether my system should be using sendmail or postfix. It
> must have been whatever the OpenSuse installer took as default. And I
> didn’t really know how to find this out (especially as the process was
> obviously not running at the moment). However, I looked into the
> installed software packages using Yast and found that the postfix
> packages were not installed but one sendmail package.

Strange. The default has been postfix for about a decade. People get
sendmail either intentionally, or because they try to remove postfix,
and then yast automatically selects sendmail as replacement.


Cheers / Saludos,

Carlos E. R.
(from 13.1 x86_64 “Bottle” at Telcontar)

Normally, the default is “postfix”. But perhaps you installed something else that wants “sendmail”.

Being a long time sendmail hacker, I always install “sendmail” rather than postfix.

Perhaps it is ‘alpine’? Other than that, I can’t imagine having chosen anything concerning this. Or maybe I clicked absentmindedly on sendmail because it appeared well known to me…:\

On 2014-07-10 23:56, flo73 wrote:
>
> nrickert;2652854 Wrote:
>> Normally, the default is “postfix”. But perhaps you installed something
>> else that wants “sendmail”.
>>
> Perhaps it is ‘alpine’? Other than that, I can’t imagine having chosen
> anything concerning this. Or maybe I clicked absentmindedly on sendmail
> because it appeared well known to me…:\

No, alpine should not “require” installation of a particular smtp
server. Even none at all, as it can use a remote smtp server.

The most typical occurrence is for people to think that they don’t need
postfix, and click to remove it, without noticing that then installation
of sendmail as replacement is automatic.

There are several package pairs (or triplets) that have forced
alternatives. The system needs one, so removing one automatically
installs another.


Cheers / Saludos,

Carlos E. R.
(from 13.1 x86_64 “Bottle” at Telcontar)