sendEmail trying to use ipv6

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

sendEmail trying to use ipv6

David Fletcher
That as far as I can tell is the problem but I've no idea what's
causing it. Can anybody help please?

I have a program that I wrote some years ago which runs every night as
a cron job on my Ubuntu server 14.04 (32 bit hardware), to email me
with reminders of things to do. It has a system call to use the
sendEmail utility to do this.

Everything was working just fine until a week or two ago. Now, if I for
example issue the command:-
sendEmail -f [hidden email] -t [hidden email] -u
Software testing... -m "Reminder by email"

it responds with:-
Mar 19 10:53:41 serveriii sendEmail[25721]: ERROR => localhost:25
returned a zero byte response to our query.

The mail.log entries from postfix are:-
Mar 19 10:53:40 ServerIII postfix/smtpd[25722]: fatal: cannot handle
socket type AF_INET6 with "inet_protocols = ipv4"
Mar 19 10:53:41 ServerIII postfix/master[9323]: warning:
process /usr/lib/postfix/smtpd pid 25722 exit status 1
Mar 19 10:53:41 ServerIII postfix/master[9323]:
warning: /usr/lib/postfix/smtpd: bad command startup -- throttling


My ISP is Virgin Media who apparently is working on implementing IPv6,
but dragging their feet so I don't yet have it available. Because it
looks to me like something is causing sendemail to try to use IPv6, is
there any way to force it to revert to using IPv4, please?

I know a little about networking but I am nowhere near being an expert.

Thanks for any ideas.

Dave

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: sendEmail trying to use ipv6

Karl Auer
On Mon, 2018-03-19 at 12:32 +0000, David Fletcher wrote:
> it responds with:-
> Mar 19 10:53:41 serveriii sendEmail[25721]: ERROR => localhost:25
> returned a zero byte response to our query.

Is your program trying to send email to localhost? If so, check your
/etc/hosts file and make sure that localhost is not being translated
into an IPv6 address.

It looks to me as if something that never used to resolve to an IPv6
address is now resolving to an IPv6 address (possibly ONLY to an IPv6
address) and your program can't use it.

Also, look in your postfix main.cf and look for a line like
"inet_protocols = XXXX". If "XXXX" is anything except "ipv4", then
comment out the line by putting a hash symbol in front of it, and ADD
this line just below it:

inet_protocols = ipv4

... then save the file, restart postfix, and try again.

Let us know how you go.

Regards, K.

-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Karl Auer ([hidden email])
http://www.biplane.com.au/kauer
http://twitter.com/kauer389

GPG fingerprint: A0CD 28F0 10BE FC21 C57C 67C1 19A6 83A4 9B0B 1D75
Old fingerprint: A52E F6B9 708B 51C4 85E6 1634 0571 ADF9 3C1C 6A3A



--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: sendEmail trying to use ipv6

David Fletcher
On Tue, 2018-03-20 at 00:08 +1100, Karl Auer wrote:
> On Mon, 2018-03-19 at 12:32 +0000, David Fletcher wrote:
> >
> > it responds with:-
> > Mar 19 10:53:41 serveriii sendEmail[25721]: ERROR => localhost:25
> > returned a zero byte response to our query.
> Is your program trying to send email to localhost? If so, check your
> /etc/hosts file and make sure that localhost is not being translated
> into an IPv6 address.

My program is running on the same machine as postfix and the rest of
the mail server so yes it's running on the localhost. I remember I had
to set
mynetworks = 192.168.2.0/24 localhost
in the postfix main.cf to get this to work.

My /etc/hosts file has always had:-
# The following lines are desirable for IPv6 capable hosts
::1     localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

in it. Could this suddenly be causing the problem?

Sorry I don't yet know much about IPv6, having not had the opportunity
to use it.

>
> It looks to me as if something that never used to resolve to an IPv6
> address is now resolving to an IPv6 address (possibly ONLY to an IPv6
> address) and your program can't use it.
>
> Also, look in your postfix main.cf and look for a line like
> "inet_protocols = XXXX". If "XXXX" is anything except "ipv4", then
> comment out the line by putting a hash symbol in front of it, and ADD
> this line just below it:
>
> inet_protocols = ipv4

Yes that's always been the last line of my main.cf. I added that one
years ago as part of a how-to for getting it to use SASL for using the
authenticated SMTP box at 1&1 for my outgoing mail.

Dave

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: sendEmail trying to use ipv6

Karl Auer
On Mon, 2018-03-19 at 13:45 +0000, David Fletcher wrote:
> My /etc/hosts file has always had:-
> # The following lines are desirable for IPv6 capable hosts
> ::1     localhost ip6-localhost ip6-loopback
> ff02::1 ip6-allnodes
> ff02::2 ip6-allrouters
>
> in it. Could this suddenly be causing the problem?

Maybe.

Change that first line into these two:

::1     ip6-localhost ip6-loopback> 
127.0.0.1     localhost 

If you already have a line in your /etc/hosts file starting with 127, and it already contains "localhost" then just change your first line to my first line.

If that helps, great! Otherwise put it back the way it was.

Regards, K.

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Karl Auer ([hidden email])
http://www.biplane.com.au/kauer
http://twitter.com/kauer389

GPG fingerprint: A0CD 28F0 10BE FC21 C57C 67C1 19A6 83A4 9B0B 1D75
Old fingerprint: A52E F6B9 708B 51C4 85E6 1634 0571 ADF9 3C1C 6A3A



--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: sendEmail trying to use ipv6

David Fletcher
Thanks Karl,

Looks like you're The Man!

My /etc/hosts file is now:-

127.0.0.1       localhost
127.0.1.1       ServerIII

# For cron->rsync backup script etc.
192.168.2.102   desktop

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters



So it looks like the localhost in the ::1 line for some reason started
to cause confusion. Happily my reminders by email is running again. I
wrote it to keep a record file of the day since the epoch on which it
last ran, so all I needed to do was edit that file to subtract 30 from
that number to get it to repeat the last month.

Thanks

Dave

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users