MSH installed on opensuse 12.1 cannot connect through localhost port 2

My MSH Hermes from CECID-hku cannot send messages over smtp/java, though it can receive mail from the mailbox.
The MSH start and sending is performed in a regular non GUI console (F1-6).

//From log quote:
2013-04-29 20:22:19 [Thread-19 ] <ERROR> <cecid.ebms.spa> <Cannot send the message>
hk.hku.cecid.piazza.commons.net.ConnectionException: Unable to send SMTP message
by javax.mail.MessagingException: Could not connect to SMTP host: localhost, port: 25
by java.net.ConnectException: Connection refused
at hk.hku.cecid.piazza.commons.net.MailSender.send(MailSender.java:182)
at hk.hku.cecid.ebms.spa.task.OutboxTask.sendMsgBySmtp(OutboxTask.java:679)
at hk.hku.cecid.ebms.spa.task.OutboxTask.execute(OutboxTask.java:448)
at hk.hku.cecid.piazza.commons.module.ActiveThread.run(ActiveThread.java:90)
at java.lang.Thread.run(Thread.java:679)
Caused by: javax.mail.MessagingException: Could not connect to SMTP host: localhost, port: 25;
//End log quote.

This problem is only occurring in opensuse_12.1 but not in opensuse 11.1, 11.2, 11.3 and 11.4

I have also noted that the MSH is creating a different MsgId for the messages on 12.1:
20130429-234630-16700@192.168.0.198
compared to the MsgId created on opensuse 11.1-4:
20130429-234630-16700@127.0.0.2
which may mean that the MSH of 12.1 is not “finding” the localhost

Testing with javamail from oracle, the smtp.send program works in 12.1

Additional info if of importance for the reader:
Because my mail-account do not have authentication over smtp I was told by the IP company to change to pop3 server and pop3 protocol for sending but keeping the port 25.

This make the MSH work over SMTP and mail-account for all of the above 11.1-4

I had also to change the SQL-files from TYPE= INNODB to ENGINE= INNODB
This made it possible to open the ebms parts. (With the new mysql in 12.1 the synonym or alias “TYPE” for “ENGINE” had been deleted, unlike for the other 11.1-4)

I have downloaded 12.2 and 12.3 but not updated to them; if the above problem is understandable or known as to 12.1, it might have been changed in the later versions. I have tried 12.2 but found that the keyboard in the consoles did not perform as expected, the aberration being failing of non-ASCII letter like the ECU € and others. This was changed setting “kbd_mode -a”, but so far I prefer 12.1

The importance of 12.1 for me (and later versions) is the eventual necessity of upgrading, otherwise 11.1-4 will work and be used.

I am searching for a solution.


11.4 is supported until July 2014
https://en.opensuse.org/openSUSE:Evergreen

On 05/01/2013 11:16 AM, sigbj wrote:
> so far I prefer 12.1
>
> The importance of 12.1 for me (and later versions) is the eventual
> necessity of upgrading, otherwise 11.1-4 will work and be used.
>
> I am searching for a solution.

be advised that support for 12.1 ends on the 15th of this month, so
decide soon what you want to move to. cite:
http://en.opensuse.org/Lifetime

personally, i decided on 11.4 Evergreen several months ago.


dd

Am 01.05.2013 11:16, schrieb sigbj:
> I have also noted that the MSH is creating a different MsgId for the
> messages on 12.1:
> 20130429-234630-16700@192.168.0.198
> compared to the MsgId created on opensuse 11.1-4:
> 20130429-234630-16700@127.0.0.2
> which may mean that the MSH of 12.1 is not “finding” the localhost

That also means that chances are good that the access is blocked by the
firewall. It makes a big difference if the port is accessed via the
127.0… or via the local network adress of the machine.
What does


grep localhost /etc/hosts
ping localhost

show?


PC: oS 12.3 x86_64 | i7-2600@3.40GHz | 16GB | KDE 4.10.2 | GTX 650 Ti
ThinkPad E320: oS 12.3 x86_64 | i3@2.30GHz | 8GB | KDE 4.10.2 | HD 3000
HannsBook: oS 12.3 x86_64 | SU4100@1.3GHz | 2GB | KDE 4.10.2 | GMA4500

They show as follows:
linux-sb1y:~ # grep localhost /etc/hosts
127.0.0.1 localhost
::1 localhost ipv6-localhost ipv6-loopback
linux-sb1y:~ # ping localhost
PING localhost (127.0.0.1) 56(84) bytes of data.
64 bytes from localhost (127.0.0.1): icmp_seq=1 ttl=64 time=0.058 ms
64 bytes from localhost (127.0.0.1): icmp_seq=2 ttl=64 time=0.062 ms
64 bytes from localhost (127.0.0.1): icmp_seq=3 ttl=64 time=0.064 ms
64 bytes from localhost (127.0.0.1): icmp_seq=4 ttl=64 time=0.062 ms
^C
— localhost ping statistics —
4 packets transmitted, 4 received, 0% packet loss, time 2999ms
rtt min/avg/max/mdev = 0.058/0.061/0.064/0.008 ms
linux-sb1y:~ #

Am 01.05.2013 17:06, schrieb sigbj:
> They show as follows:
> linux-sb1y:~ # grep localhost /etc/hosts
> 127.0.0.1 localhost
> ::1 localhost ipv6-localhost ipv6-loopback
> linux-sb1y:~ # ping localhost
> PING localhost (127.0.0.1) 56(84) bytes of data.

so it is nothing wrong in your settings, the ping correctly resolves to
localhost=127.0.0.1 and this is also the correct setting in the hosts file.
I am myself not familiar with MSH, but did you use exactly the same
version as in the oldr openSUSE versions and did you by accident
configure it somehow to use the computername instead of localhost for
the smtp connection?
It points more to some problem in MSH itself or its configuration from
what I see.

You could also just for testing disable the firewall on that machine
just to see if the connection to that port succeeds then.


PC: oS 12.3 x86_64 | i7-2600@3.40GHz | 16GB | KDE 4.10.2 | GTX 650 Ti
ThinkPad E320: oS 12.3 x86_64 | i3@2.30GHz | 8GB | KDE 4.10.2 | HD 3000
HannsBook: oS 12.3 x86_64 | SU4100@1.3GHz | 2GB | KDE 4.10.2 | GMA4500

I have just tried a message over the MSH after deactivating the Firewall in YaST, but the same error messages comes back.

The MSH version is the same for all installations (11.1-4 and 12.1):
Product And Solution from CECID
and even on the same machine/Rechner as to 11.3-4 and 12.1

I am thinking of the new kernel or associated programs etc., that opensuse_12.1 is compiled with. That is the big difference compared to 11.x : kernel 2.x versus kernel 3.x
My setup is standard in all the instances - no peculiarities I make up, so it is a mystery.

Hopefully some kernel experts in opensuse or programmers would come in here in this forum.
As I have pointed out previously: The MSH** receives **SOAP ebxml from the mailbox but will not send.

Before we jump to suspecting a kernel issue, I would first suspect that
the different java versions are to blame.
Do your older systems run with java from Sun/Oracle or did they already
use OpenJDK (and which version)?


PC: oS 12.3 x86_64 | i7-2600@3.40GHz | 16GB | KDE 4.10.2 | GTX 650 Ti
ThinkPad E320: oS 12.3 x86_64 | i3@2.30GHz | 8GB | KDE 4.10.2 | HD 3000
HannsBook: oS 12.3 x86_64 | SU4100@1.3GHz | 2GB | KDE 4.10.2 | GMA4500

Going to opensuse_11.3 I have following versions listed in YaST:

java-1_6_0-openjdk + developm Installierte Version: 1.6.0.0_b22.1.10.4-0.3.2
java-1_6_0-openjdk-devel Installierte Version 1.6.0.0_b22.1.10.4-0.3.2
libgcj45-jar Installierte Version 4.5.0_20100604-1.9
javacc Installierte Version 4.0-113.2

The MSH is running very stable on 11.3, that has the latest updates available from the SuSE repository

env | grep JAVA
JAVA_BINDIR=/usr/lib/jvm/java/bin
JAVA_HOME=/usr/lib/jvm/java
JAVA_ROOT=/usr/lib/jvm/java
env | grep JRE
JRE_HOME=/usr/lib/jvm/jre

Can you please check with


java -version

if your 12.1 system which has the problem runs also 1.6 or if it runs 1.7?


PC: oS 12.3 x86_64 | i7-2600@3.40GHz | 16GB | KDE 4.10.2 | GTX 650 Ti
ThinkPad E320: oS 12.3 x86_64 | i3@2.30GHz | 8GB | KDE 4.10.2 | HD 3000
HannsBook: oS 12.3 x86_64 | SU4100@1.3GHz | 2GB | KDE 4.10.2 | GMA4500

Here is the output from the opensuse_12.1

cat /etc/issue && java -version
Welcome to openSUSE 12.1 “Asparagus” - Kernel \r (\l).

java version “1.6.0_27”
OpenJDK Runtime Environment (IcedTea6 1.12.4) (suse-32.1-i386)
OpenJDK Client VM (build 20.0-b12, mixed mode)

Am 01.05.2013 23:06, schrieb sigbj:
> java version “1.6.0_27”
> OpenJDK Runtime Environment (IcedTea6 1.12.4) (suse-32.1-i386)
> OpenJDK Client VM (build 20.0-b12, mixed mode)
>
So it is also 1.6, sorry then I have no idea.

The link you gave shows downloads for software which was last updated in
Jan 2010, have you considered to contact them if there are known issues
with modern Linux systems?

Of course you could just go with 11.4 + Evergreen for the moment as a
workaround, this is supported till 2014.
http://en.opensuse.org/openSUSE:Evergreen


PC: oS 12.3 x86_64 | i7-2600@3.40GHz | 16GB | KDE 4.10.2 | GTX 650 Ti
ThinkPad E320: oS 12.3 x86_64 | i3@2.30GHz | 8GB | KDE 4.10.2 | HD 3000
HannsBook: oS 12.3 x86_64 | SU4100@1.3GHz | 2GB | KDE 4.10.2 | GMA4500

Well,thank you very much, anyway!

I notice in YaST that as to Hostname/DNS there is a box called this “Hostnamen der Loopback-Adresse zuweisen” but I do not know what this is for(?)

I have got some good help before on the Hermes Forum,but I haven’t so far taken up this problem at their forums, but I consider doing it.
Unfortunately their forums sometimes are quite silent.

S

Assign Hostname to Loopback IP associates your hostname with 127.0.0.2
(loopback) IP address in /etc/hosts. This is an useful option if you
want to have the hostname resolvable at all times, even without active
network.

http://doc.opensuse.org/documentation/html/openSUSE/opensuse-reference/cha.basicnet.html

maybe you should test that, it sounds promising.


PC: oS 12.3 x86_64 | i7-2600@3.40GHz | 16GB | KDE 4.10.2 | GTX 650 Ti
ThinkPad E320: oS 12.3 x86_64 | i3@2.30GHz | 8GB | KDE 4.10.2 | HD 3000
HannsBook: oS 12.3 x86_64 | SU4100@1.3GHz | 2GB | KDE 4.10.2 | GMA4500

I tested it - doing the change in Hostnamen/DNS, checkmarking the box in question, but still the same error messages come up. There is one difference,though, det sender-machinery is hanging a while before it finishing up. This is just what it uses to be when messages really are sendt through the MSH; so I “thought” it was actually sendt.

The /etc/hosts look like this now:

IP-Address Full-Qualified-Hostname Short-Hostname

127.0.0.1 localhost

special IPv6 addresses

::1 localhost ipv6-localhost ipv6-loopback

fe00::0 ipv6-localnet

ff00::0 ipv6-mcastprefix
ff02::1 ipv6-allnodes
ff02::2 ipv6-allrouters
ff02::3 ipv6-allhosts
192.168.0.198 linux-sb1y.site linux-sb1y
192.168.0.199 linux-sb1y.site linux-sb1y
127.0.0.2 linux-sb1y.site linux-sb1y

By the way, I noted that the MSH in opensuse_11.4 had the MsgId of the hostname 192.168.0.199 and not @127.0.0.2
On 11.4 the messages are sendt.
Changing to cable ( that has the IP 192.168.0.199) instead of wireless on 12.1 made no difference.
I give a more complete output here - but clearing the receivers emailaddr - , as you can see all steps are running OK except the sender part:

2013-05-02 12:41:25 [Thread-21 ] <INFO > <cecid.ebms.spa> <Sign the message: 20130502-124125-39601@192.168.0.198>
2013-05-02 12:41:25 [Thread-21 ] <DEBUG> <pkg.pki.ApacheXMLDSigner> <setEnvelope, using algorithm: rsa-sha1>
2013-05-02 12:41:25 [Thread-21 ] <DEBUG> <pkg.pki.ApacheXMLDSigner> <addDocument URI: cid Payload-0, contentType: application/octet-stream>
2013-05-02 12:41:25 [Thread-21 ] <DEBUG> <pkg.pki.ApacheXMLDSigner> <start signing>
2013-05-02 12:41:25 [Thread-21 ] <DEBUG> <pkg.pki.ApacheXMLDSigner> <got private key from keystore>
2013-05-02 12:41:25 [Thread-21 ] <DEBUG> <pkg.pki.ApacheXMLDSigner> <created DocumentResolver>
2013-05-02 12:41:25 [Thread-21 ] <DEBUG> <pkg.pki.ApacheXMLDSigner> <created Transform>
2013-05-02 12:41:25 [Thread-21 ] <DEBUG> <pkg.pki.ApacheXMLDSigner> <added main document (envelope)>
2013-05-02 12:41:25 [Thread-21 ] <DEBUG> <pkg.pki.ApacheXMLDSigner> <added 1 attachment documents>
2013-05-02 12:41:25 [Thread-21 ] <DEBUG> <pkg.pki.ApacheXMLDSigner> <got the certificate chain from keystore>
2013-05-02 12:41:25 [Thread-21 ] <DEBUG> <pkg.pki.ApacheXMLDSigner> <added the certificate chain to signature>
2013-05-02 12:41:25 [Thread-21 ] <DEBUG> <pkg.pki.ApacheXMLDSigner> <message signed>
2013-05-02 12:41:25 [Thread-21 ] <INFO > <cecid.ebms.spa> <Send message 20130502-124125-39601@192.168.0.198 to xxxxxxxxxxx@xxxxxxxx>
2013-05-02 12:41:26 [Thread-21 ] <ERROR> <cecid.ebms.spa> <Cannot send the message>
hk.hku.cecid.piazza.commons.net.ConnectionException: Unable to send SMTP message
by javax.mail.MessagingException: Could not connect to SMTP host: localhost, port: 25
by java.net.ConnectException: Connection refused
at hk.hku.cecid.piazza.commons.net.MailSender.send(MailSender.java:182)
at hk.hku.cecid.ebms.spa.task.OutboxTask.sendMsgBySmtp(OutboxTask.java:679)
at hk.hku.cecid.ebms.spa.task.OutboxTask.execute(OutboxTask.java:448)
at hk.hku.cecid.piazza.commons.module.ActiveThread.run(ActiveThread.java:90)
at java.lang.Thread.run(Thread.java:679)
Caused by: javax.mail.MessagingException: Could not connect to SMTP host: localhost, port: 25;
nested exception is:
java.net.ConnectException: Connection refused
at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1391)
at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:412)
at javax.mail.Service.connect(Service.java:288)
at javax.mail.Service.connect(Service.java:169)
at javax.mail.Service.connect(Service.java:118)
at javax.mail.Transport.send0(Transport.java:188)
at javax.mail.Transport.send(Transport.java:118)
at hk.hku.cecid.piazza.commons.net.MailSender.send(MailSender.java:179)
… 4 more
Caused by: java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:327)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:193)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:180)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:384)
at java.net.Socket.connect(Socket.java:546)
at java.net.Socket.connect(Socket.java:495)
at com.sun.mail.util.SocketFetcher.createSocket(SocketFetcher.java:233)
at com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:189)
at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1359)
… 11 more
2013-05-02 12:41:26 [Thread-21 ] <ERROR> <cecid.ebms.spa> <Error in outbox task>
hk.hku.cecid.ebms.spa.task.DeliveryException: Cannot send the message

There has been a lot of good inputs here from you - hints and Vorschlage to solve the problem. I am going to take care of it. There must be a simple reason somewhere…

Going back a while: something started to happen with 11.4 as to the MsgId and continues in 12.1 with more problems.

On a Desktop machine and a laptop machine 11.4 did not work properly with the standard or default kernel installed. There was a repeating and constant hang and in addition lockout of the keyboard and mouse. When I replaced the default kernel with the desktop-kernel both machines worked fine. But these things do not directly affect the matter and concern we have dealt with here, enthough I wonder what it can be…

I run a bit out of ideas but can you try to see on what the smtp is
listening


sudo netstat -plntu | grep :25

if it only listens to 127.0.0.1 but you come over as 127.0.0.2 (your
loopback) then you probably have to restart that smtp service first or
configure it to accept from the ip as which your sending application is
seen by the smtp service.


PC: oS 12.3 x86_64 | i7-2600@3.40GHz | 16GB | KDE 4.10.2 | GTX 650 Ti
ThinkPad E320: oS 12.3 x86_64 | i3@2.30GHz | 8GB | KDE 4.10.2 | HD 3000
HannsBook: oS 12.3 x86_64 | SU4100@1.3GHz | 2GB | KDE 4.10.2 | GMA4500

I had to drop the grep to get an output (we are still on the 12.1):

sigbj@linux-sb1y:~> sudo netstat -plntu | grep :25
root’s password:
sigbj@linux-sb1y:~> sudo netstat -plntu
Aktive Internetverbindungen (Nur Server)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.1:3310 0.0.0.0:* LISTEN 1963/clamd
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 870/cupsd
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 1558/mysqld
tcp 0 0 ::1:631 :::* LISTEN 870/cupsd
udp 0 0 0.0.0.0:5353 0.0.0.0:* 721/avahi-daemon: r
udp 0 0 0.0.0.0:631 0.0.0.0:* 870/cupsd
udp 0 0 0.0.0.0:38524 0.0.0.0:* 721/avahi-daemon: r
sigbj@linux-sb1y:~> sudo netstat -plntu | grep -e “:25”
sigbj@linux-sb1y:~>

PLease tell me what to do further, I don’t know how to restart the smtp server

Can you compare that to what you have on the systems where it works?
If I am not completely blind you have simply nothing which runs on port
25 at localhost, so it is no miracle you cannot connect to it.


PC: oS 12.3 x86_64 | i7-2600@3.40GHz | 16GB | KDE 4.10.2 | GTX 650 Ti
ThinkPad E320: oS 12.3 x86_64 | i3@2.30GHz | 8GB | KDE 4.10.2 | HD 3000
HannsBook: oS 12.3 x86_64 | SU4100@1.3GHz | 2GB | KDE 4.10.2 | GMA4500

Yes, my friend, you are right! We are now on opensuse_11.3:

sigbj@linux-mncr:~> sudo netstat -plntu | grep :25
root’s password:
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 2222/master
tcp 0 0 ::1:25 :::* LISTEN 2222/master

sigbj@linux-mncr:~> sudo netstat -plntu
Aktive Internetverbindungen (Nur Server)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 2005/mysqld
tcp 0 0 127.0.0.1:3310 0.0.0.0:* LISTEN 2280/clamd
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 1433/rpcbind
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 1662/cupsd
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 2222/master
tcp 0 0 :::111 :::* LISTEN 1433/rpcbind
tcp 0 0 ::1:631 :::* LISTEN 1662/cupsd
tcp 0 0 ::1:25 :::* LISTEN 2222/master
udp 0 0 0.0.0.0:111 0.0.0.0:* 1433/rpcbind
udp 0 0 0.0.0.0:631 0.0.0.0:* 1662/cupsd
udp 0 0 0.0.0.0:5353 0.0.0.0:* 1574/avahi-daemon:
udp 0 0 0.0.0.0:756 0.0.0.0:* 1433/rpcbind
udp 0 0 0.0.0.0:58672 0.0.0.0:* 1574/avahi-daemon:
udp 0 0 :::111 :::* 1433/rpcbind
udp 0 0 :::756 :::* 1433/rpcbind
sigbj@linux-mncr:~>

So, what is next step to do?

The “master” you see in the lines with port 25 indicates the use of postfix.
So you need to check on 12.1 if postfix is installed first, if it is
installed you need to check why it does not run.


su -
rcpostfix status

check also in yast -> runlevel editor if it is enabled (you need to do
that anyway otherwise it is not there if you reboot) or start as a
simple test with “rcpostfix start” and see what it says.


PC: oS 12.3 x86_64 | i7-2600@3.40GHz | 16GB | KDE 4.10.2 | GTX 650 Ti
ThinkPad E320: oS 12.3 x86_64 | i3@2.30GHz | 8GB | KDE 4.10.2 | HD 3000
HannsBook: oS 12.3 x86_64 | SU4100@1.3GHz | 2GB | KDE 4.10.2 | GMA4500