Mail Sending Error 501/Error 554 Problem Ubuntu 8.04 Dovecot Squirrelmail On Private Server

I am a web-developer who built a server for a client a couple of years ago but have no previous or ongoing linux experience. I have full access to their server and configuration - but very little experience in linux / server configuration, so clear helpful advice and troubleshooting help would be gratefully received.  Thanks in advance!

My client is able to receive mails fine but when they try to send a mail from their webmail it fails when the recipient is anyone (except for their own email account which receives the mail fine.  I set up squirrelmail for them on their server and that is what they use.  

They didn't have a problem sending mail from their squirrelmail webmail system until I upgraded their server recently from the previous incarnation (gutsy gibbon).  The error email received (with domain xx'd out but all characters crossed out are alphabetical) :

MAIL SUBJECT
------------------
Returned mail: see transcript for details


MAIL BODY
--------------
The original message was received at Tue, 23 Mar 2010 11:08:59 GMT
from localhost [127.0.0.1]

   ----- The following addresses had permanent fatal errors -----
<ian@xxxxxxx.com>
    (reason: 501 Syntactically invalid HELO argument(s))

   ----- Transcript of session follows -----
... while talking to xxxxxxx.com.:
>>> HELO ;; connection timed out; no servers could be reached
<<< 501 Syntactically invalid HELO argument(s)
554 5.0.0 Service unavailable


Full HEADER
---------------
Return-Path: <MAILER-DAEMON>
Received: from localhost (localhost)
     by ;; connection timed out; no servers could be reached (8.14.1/8.14.1/Debian-8ubuntu1) id o2NB90LC016868;
     Tue, 23 Mar 2010 11:09:00 GMT
Date: Tue, 23 Mar 2010 11:09:00 GMT
From: Mail Delivery Subsystem <MAILER-DAEMON>
Message-Id: <201003231109.o2NB90LC016868@;; connection timed out; no servers could be reached>
To: <info@xxxxxxx.co.uk>
MIME-Version: 1.0
Content-Type: multipart/report; report-type=delivery-status;
     boundary="o2NB90LC016868.1269342540/;; connection timed out; no servers could be reached"
Subject: Returned mail: see transcript for details
Auto-Submitted: auto-generated (failure)
merrydownxAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

TobiasHolmCommented:
Hi!

Have you checked the firewall if it's blocking SMTP traffic? Can you test a TELNET session from your clients server to a external SMTP server?

Regards, Tobias
0
merrydownxAuthor Commented:
Hi Tobias, thanks for your answer.  

I can telnet from my location to my clients server.  Is it possible to perform this test remotely somehow (from my machine -> his -> someone else server)?  I work remotely on it now that it has been delivered - though I can go on site if absolutely required.

Jim

0
merrydownxAuthor Commented:
When I tried telnet mail.xxxxxx.co.uk 25 which is my company's mail server I got a reply back: 220 smtp-in-127.livemail.co.uk ESMTP Postfix which I think means that I am reaching my mail providers servers successfully.  I don't know if you could confirm that?

Kind regards,

Jim
0
Newly released Acronis True Image 2019

In announcing the release of the 15th Anniversary Edition of Acronis True Image 2019, the company revealed that its artificial intelligence-based anti-ransomware technology – stopped more than 200,000 ransomware attacks on 150,000 customers last year.

TobiasHolmCommented:
Hi!

Do you have SSH installed on the server? If not, look here: http://www.cyberciti.biz/faq/ubuntu-linux-openssh-server-installation-and-configuration/

Then use PuTTY to connect via SSH to your remote server: http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html

Now you can run 'telnet' to test if you can connect to port 25 on a remote computer. You can use 'nslookup' to get the mail servers addresses.

Example:
user@ubuntu910-desktop:~$ nslookup
> set type=mx
> xpro.se
Server:         172.16.64.3
Address:        172.16.64.3#53

Non-authoritative answer:
xpro.se mail exchanger = 10 mx-cluster-b1.one.com.
xpro.se mail exchanger = 10 mx-cluster-b2.one.com.

Authoritative answers can be found from:
mx-cluster-b1.one.com   internet address = 195.47.247.194
mx-cluster-b2.one.com   internet address = 195.47.247.195


then use 'telnet mx-cluster-b1.one.com 25' to test SMTP.

Regards, Tobias
0
TobiasHolmCommented:
ok! That's good!

Can you continue to test the mail via telnet to see if you can send a message too?
Use this guide for the test: http://support.microsoft.com/kb/153119

Regards, Tobias
0
merrydownxAuthor Commented:
Thanks for the link Tobias.

I tried that and it worked fine.  I received that message at my own email account from the server I am testing using telnet to create the simple message.  So it looks like smtp is not firewalled - if I am reading these tests right.

Jim
0
TobiasHolmCommented:
ok!

Mail Sending Error 501/Error 554 is frequently related to errors in DNS. Some ISP's (the list is growing) will do different types of verification to check if a message is valid before receiving it. I am sure we are all familiar with the lack of a reverse lookup for a mail server, but some ISP's are also checking to see if an email account is valid before receiving the message.

This validation is done by looking up the MX record for a given domain and then checking the mail server listed in the MX record to verify that the sender has an account on that machine. Most mail servers will respond to this query. Once it is known that the user does exist in the mail domain, the mail is received and delivered to the appropriate box.

If the server does not respond to this query or the senders account does not exist on the server referenced in the DNS MX record for that domain, the 554 DNR error message is issued.

Check your MX Records and your PTR records on your DNS server. If you have more than one MX record for domain make sure the records are valid and the priorities are properly set. This will fix a lot of the 554 problems.

Also, did you set up a SPF record for your domain? You can let disappear certain relaying issues (mostly due to spam filters) using an SPF record.

A question though: Is it only through webmail it fails? The same recipient works when using telnet?

Regards, Tobias
0
merrydownxAuthor Commented:
Ok, thanks for your help so far, this is where it gets sticky...  I hope you have the patience to bear with me on this one as your help has been terrific so far!

I never got mail working through a mail client using these accounts., they have always used the webmail which worked until recently.  I don't know if this does suggest that its some element of dns/smtp not working rather than the squirrelmail config, but I thought I'd mention it in case.

I will try to check DNS, I think the place to be check would be somewhere within BIND DNS Server (I am using webmin to remotely administrate currently).  I am not sure where to look for this really.  Can you point me at a file location on the server or section of the BIND DNS Server interface through webmin?

Jim
0
TobiasHolmCommented:
I've found a similar bug but it's for an older Ubuntu release, see this: https://bugs.launchpad.net/ubuntu/+source/sendmail/+bug/99459

while talking to xxxxxxx.com.:
>>> HELO ;; connection timed out; no servers could be reached
<<< 501 Syntactically invalid HELO argument(s)
554 5.0.0 Service unavailable

Is the xxxxxxx.com domain above the domain you mail to or from? It looks like the SMTP traffic doesn't get through.

I also found this: http://archiver.rootsweb.ancestry.com/th/read/Listowners/2006-02/1139318933
http://archiver.rootsweb.ancestry.com/th/read/Listowners/2006-02/1139349374
It could be that the domain you send from are blacklisted in some spam filter when getting the "554 5.0.0 Service unavailable" error.

Anyway, did you manage to send a mail via telnet to a recipient that doesn't work through webmail?

Regards, Tobias
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
merrydownxAuthor Commented:
Hi Tobias.

SOME SUCCESS HERE THANK YOU SO MUCH! (answers first, strategy below)

yes when I followed the link you sent to me for telneting a mail to someone I tried successfully to send myself a mail from the server having the problem.  This did not work via webmail.

The xxx.com address above is a recipient email address it seems the mail is being bounced on arrival yes.   I doubt the server could be blacklisted as it is a private server, by which I mean it is running out of my clients office and they have less than 100 users currently.  They never mail out for marketing, just to reply to clients.

Successful Bit
------------------
Right, now I skipped to the end of the text at the end of the first link to where it mentions: removing the following lines from sendmail.mc (which I found on my server at: /etc/mail/sendmail.mc and /usr/share/sendmail/cf/debian/sendmail.mc)

include(`/etc/mail/m4/dialup.m4')dnl
include(`/etc/mail/m4/provider.m4')dnl
------------------

Questions
-------------
Now, I haven't too much of a clue whether this jury-rigged fix is likely to have some unwanted side effects, or if there is a better fix for this.  I'm happy to take your advice on that Tobias, but I have tested sending to my company's mail and my gmail and both are working.

So just a few questions:

Are we to assume that this is - as you describe it above - a bug of this version or a rough patch for a configuration error I have made?

Do you think that this is a safe fix for the server or basis for further investigation?

Was I right to comment out the lines from both locations I gave above?

I am unlikely to upgrade the server again this decade ;)  I only performed the last upgrade in order to get SSH/telnet access working properly ironically.  Thanks for your help so far Tobias.  If I could trouble you to give me pointers on the above questions I would be most grateful!!!

Jim
0
TobiasHolmCommented:
I think you should reboot the server to see if the fix stays put!

I think you did right to comment out the lines from both locations!

Regards, Tobias
0
merrydownxAuthor Commented:
I rebooted it after applying the fix and just rebooted it on your suggestion to see if it held (which it did).

Unless you think there is room for improvement with this fix Tobias, I will be happy to close this case.  I am very grateful for your help.  I didn't come to the advice you found via google myself, I was getting hung up in investigating DNS and settings for domain which seem not to be the cause this time!!!

Let me know if you would.

Jim
0
TobiasHolmCommented:
ok! Then I would say this problem is solved. I was unsure if the fix would remain after a reboot, but it seems like it did. The problem looks like a bug in the upgrade affecting sendmails config files.

Regards, Tobias
0
merrydownxAuthor Commented:
Thanks for the confirmation, time and help with this Tobias!

Jim
0
merrydownxAuthor Commented:
Thanks very much for your help getting to this solution Tobias.  I doubt I'd have got to the bottom of the problem this decade without help!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux Distributions

From novice to tech pro — start learning today.