Categories
Java Linux

JavaMail: Sending mails fails

Ever stumbled across this?

javax.mail.SendFailedException: Sending failed;
   nested exception is:
      javax.mail.MessagingException: 501 5.0.0 HELO requires domain address

I wasn’t able for a long time to find the solution in the net although many people reported having this problem. The only hint you find is “There was an invalid entry in /etc/hosts”. But noone said exactly what the “invalid entry” was.

I myself found that there was no invalid entry but the configured hostname of the machine (issue “hostname” in a shell) cannot be resolved by DNS. The result is the given error message from the mail server.

What is happening? JavaMail resolves its own hostname by asking for the local hostname. The SMTP protocol requires the sending domain while handshaking. The server will try to resolve the domain by its DNS. If the hostname sent cannot be resolved then the server responds with “HELO requires domain address” as stated above.

I hope that this issue now becomes clearer to all of you.

PS: Solution is make sure your hostname can be resolved by DNS. Fix your hostname if it’s wrong or add the DNS entry.

Categories
Linux

Ubuntu 11.10 Upgrade Problems

Grrr, that was nasty. I upgraded my Ubuntu to 11.10 after the 11.04 installation on my Lenovo laptop did not boot anymore with the latest kernel update. I usually install all updates that Ubuntu’s Update Manager proposes and never had problems so far. Until yesterday when the last kernel update was received.

The laptop did not boot anymore. It halted somewhere without any further notice. Switching to the console with Ctrl-Alt-F1 and checking the X11 log at /var/log/Xorg.0.log revealed that NVIDIA graphics driver could not be loaded anymore. Re-installing the driver did not fix the problem :(. Well, at least I could boot the old kernel and check systems out.

However, I wasn’t able to make the newest kernel working with NVIDIA’s kernel module. So I finally tried the distribution upgrade to 11.10. But again, the system stuck in the boot. Even worse, I had a new symptom:

Unable to connect to the system bus: Failed to connect to socket /var/run/dbus/system_bus_socket: Connection refused

An internet research turned up this excellent forum thread which told me that the distribution upgrade had failed to migrate two directories. Following the instructions of #24 – using mv command and setting chmod 1777 /run/lock did finally help me to repair the system.

So guys, if you observe the weird behaviour after upgrading a kernel on an NVIDIA based computer, check out:

  • The X11 log for messages about your kernel module
  • Wiki page http://wiki.ubuntuusers.de/Grafikkarten/NVIDIA/nvidia
  • Wiki page http://wiki.ubuntuusers.de/Grafikkarten/Nvidia
  • and of course, google your boot log error