SMTP code: 503

Posted on 2004-10-29
Last Modified: 2010-03-18

I got this situation and I have no idea why it caused SMTP code 503...please help me.

This is what I tried to do.  I try to run my program and send warning email if a condition is satisfied.  But I cannot receive any warning emails so I use a lan analyzer to detect what's wrong...and I got this SMTP code 503.  What will cause this problem and how can I solve this problem.  My program runs fine with other Linux 9.0....not sure which setting in Linux I should modify...Any idea????


Question by:xenia27
    LVL 10

    Expert Comment

    Hi xenia27,
    You're not authenticating with your mail server, that's what that business is about. I don't know what program you are using, but your mail server is set to require authentication for all non-local smtp transfer it looks like. You may want to configure that program to authenticate when it sends mail or make your SMTP server not require authentication if requests are coming from your lan.


    Author Comment

    how can I authenticate my program when it sends mail??  what should I do?  ^^
    LVL 10

    Expert Comment

    > Well, what are you doing exactly. Is your mail server on your network or are you using an ISP mail server or what? Also, did you write this program, is it a shell script or what?

    Author Comment

    by:xenia27 mail server is on our network...
    I write this program...and it's an executable program in C++...
    So what should I do?

    Author Comment

    By the way, why I got this error message, "Error: send HELO/EHLO first", which came with error 503??  
    LVL 2

    Accepted Solution

    Sounds as if you have written a program that attempts to communicate directly with an SMTP server by opening a connection to port 25 on the server and speaking raw SMTP.

    That's daft, in my opinion. Why bother writing your own SMTP routines, when you can invoke the "mail" or "mailx" programs and use someone else's implementation?
    However, if you *must* send raw SMTP messages, you should probably take the time to read RFC821 ( ). A successful SMTP protocol session (*without authentication*) goes something like this:

    client:  HELO  foo
    server:  250 Hello
    client : MAIL FROM: <>
    server:  250  <>... Sender ok
    client:  RCPT TO: <fred@bar.comt>
    server:  250  <matt@bar.comt>... Recipient ok
    client:  DATA
    server:  354 Enter mail, end with "." on a line by itself
    client:  Subject: Hi!
    client:  This is a test mail
    client:  .
    server:  250  Message accepted for delivery
    client:  QUIT
    server:  221 Closing connection

    Perhaps you are skipping the "HELO", "MAIL FROM:", "RCPT TO:" and "DATA" commands and trying to launch directly into sending the headers and body of an e-mail?

    LVL 10

    Assisted Solution

    Well after seeing you are getting the EHLO/HELO first message I may have to agree with Matt. I would wonder how you are implementing the mail function in your program. Though are you having any problems sending mail using the server from other clients, not using your program?

    Author Comment

    Sorry for taking this long...but I'm still waiting for the reply after I adding HELO in my program..However, I think this will work!  Thank you~~~

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Suggested Solutions

    Title # Comments Views Activity
    E-mail settings for Fail2ban 7 82
    OpenWrt 1 20
    Linux SSH Error 9 40
    Linux on a Dell PowerEdge 720 3 37
    I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
    Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
    In this Experts Exchange video Micro Tutorial, I'm going to show how small business owners who use Google Apps can save money by setting up what is called a catch-all email address in their Gmail accounts. By using the catch-all feature, small busin…
    Need more eyes on your posted question? Go ahead and follow the quick steps in this video to learn how to Request Attention to your question. *Log into your Experts Exchange account *Find the question you want to Request Attention for *Go to the e…

    933 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now