10 Replies Latest reply on Apr 27, 2012 9:35 AM by user12240205

    E-mail sending from PL/SQL fails with SMTP error 550 must check for new....

    user12240205
      We have a issue like this. We have a e-mail program (PL/SQL stored procedure which is called from a 10g R2 form) which sends e-mails using UTL_SMTP. It was working but suddenly from day-before-yesterday stopped working. Mail admin says he did not change any mail server paras.

      The DB is in Linux so is the mail server. We finally did a code change. Now the mail goes to SMTP server but the mail does not go out of it (to a gmail address). We did a trace of the SMTP log and found out that it throws *550 automated@suninsurance.com.fj must check for new mail first* .

      Here is the SMTP server log:
      [192.168.0.6:25]
      
      Wed 2012-04-25 18:52:46: --> 220 suninsurance.com.fj ESMTP MDaemon 12.5.4; Wed, 25 Apr 2012 18:52:46 +1200
      Wed 2012-04-25 18:52:46: <-- HELO 192.168.0.6
      Wed 2012-04-25 18:52:46: --> 250 suninsurance.com.fj Hello 192.168.0.6, pleased to meet you
      Wed 2012-04-25 18:52:46: <-- MAIL FROM:automated@suninsurance.com.fj
      Wed 2012-04-25 18:52:46: --> 250 <automated@suninsurance.com.fj>, Sender ok
      Wed 2012-04-25 18:52:46: <-- RCPT TO:peter.silva@gmail.com
      Wed 2012-04-25 18:52:46: --> 550 automated@suninsurance.com.fj must check for new mail first
      Wed 2012-04-25 19:02:45: Connection timed out!
      Wed 2012-04-25 19:02:45: SMTP session terminated (Bytes in/out: 96/256)
      Wed 2012-04-25 19:02:46: ----------
      Wed 2012-04-25 19:20:11: Session 17159; child 1
      What could be the problem here? Any help would be greatly appreciated.
        • 1. Re: E-mail sending from PL/SQL fails with SMTP error 550 must check for new....
          Paul  Horth
          It's not an Oracle issue. Please google "must check for new mail first" to get tips on what might be wrong.
          • 2. Re: E-mail sending from PL/SQL fails with SMTP error 550 must check for new....
            user12240205
            Paul Horth wrote:
            It's not an Oracle issue. Please google "must check for new mail first" to get tips on what might be wrong.
            I tried Googling but did not find anything useful. I only found this one: http://forums.smartertools.com/showthread.php/29213-Error-550-must-check-for-new-mail-first But since mail admin said he did not change anything in paras this might not be helpful. Only then I thought of asking here.
            • 3. Re: E-mail sending from PL/SQL fails with SMTP error 550 must check for new....
              Paul  Horth
              There is http://www.techtalkz.com/microsoft-outlook/157269-550-you-must-check-your-mail-ip-smtp-auth-before-send.html
              which mentions SMTP authorisation and other useful things.

              I repeat it isn't an Oracle problem per se. Your SMTP might not be set up properly or you might not be using it properly. Talk to your admin.

              Edited by: Paul Horth on 25-Apr-2012 05:52

              Edited by: Paul Horth on 25-Apr-2012 05:55
              1 person found this helpful
              • 4. Re: E-mail sending from PL/SQL fails with SMTP error 550 must check for new....
                BluShadow
                The error is an SMTP error, not an oracle error. As already mentioned the issue is not an oracle issue.

                Even if your email admin says no parameters have changed he may have done something without realising and needs to check for you.
                1 person found this helpful
                • 5. Re: E-mail sending from PL/SQL fails with SMTP error 550 must check for new....
                  Billy~Verreynne
                  Weird error message text you are receiving from the mail server. The SMTP specifications are in RFC2821.

                  It states (about the 550 response code):
                  Servers MAY reject or bounce messages when they are not
                  deliverable when addressed.  When they do so, they MAY either
                  provide address-updating information with a 551 code, or may
                  reject the message as undeliverable with a 550 code and no
                  address-specific information.  
                  The 550 response is thus typically a result when the mail server detects that you are specifying an invalid address. The spec lists it as follows:
                  550 Requested action not taken: mailbox unavailable
                      (e.g., mailbox not found, no access, or command rejected
                      for policy reasons)
                  The error message you are seeing seems to suggest a possible problem with the sender's mailbox. Which is weird as it should be accepting the mail for delivery to the recipient's mailbox - and that mailbox could be full and no new e-mail could thus be accepted. So the error message does make much sense to me...

                  What happens if you do check the mailbox of the sender (using POP3 or IMAP)? Any errors reported with the mailbox by the e-mail client?

                   
                  PS. As already stated - this error has nothing to do with Oracle. Oracle simply reports the error code it received from the SMTP server.
                  1 person found this helpful
                  • 6. Re: E-mail sending from PL/SQL fails with SMTP error 550 must check for new....
                    Marwim
                    RCPT TO:peter.silva@gmail.com
                    If I read this correctly, then you want to send a mail to a GMAIL account. Maybe GMAIL wants to verify your identity and therefore asks for a login by checking your inbox. I cannot check it, but any mail client should have a setting"POP before SMTP".

                    Regards
                    Marcus
                    • 7. Re: E-mail sending from PL/SQL fails with SMTP error 550 must check for new....
                      Billy~Verreynne
                      But the SMTP server is not from the gmail/google domain - it is suninsurance.com.fj.

                      From the SMTP conversation transcript, this would seem to be the local mail server. It will typically check two things (simplified).

                      Is the recipient non-local and is the sender also non-local - reject, as why should it accept sending mail to the recipient domain when the sender is not a local domain user. (no open relay)

                      In this case, the sender is local - automated@suninsurance.com.fj. Thus the recipient can be either local or not.

                      The recipient being a gmail domain user simply means that the server should accept that mail transaction and forward that mail to the recipient's domain (using the MX records for the recipient domain to identify the mail server to contact for delivering that mail).

                      So the error text seems a bit weird to me - cannot understand why the mail server is refusing to accept what seems to be the recipient address..

                      Edited by: Billy Verreynne on Apr 25, 2012 3:25 PM
                      • 8. Re: E-mail sending from PL/SQL fails with SMTP error 550 must check for new....
                        BluShadow
                        Billy  Verreynne  wrote:
                        So the error text seems a bit weird to me - cannot understand why the mail server is refusing to accept what seems to be the recipient address..
                        Unless some new corporate policy has been implemented to prevent staff sending mail to certain 'personal' type email addresses rather than authorised business partners?
                        • 9. Re: E-mail sending from PL/SQL fails with SMTP error 550 must check for new....
                          Billy~Verreynne
                          No idea Blu. Think the closest I've ever come to mail server admin was configuring MTAs (Mail Transfer Agents) for Microsoft Mail on OS/2 "servers" (ordinary PCs) back in the 90's for metropol company-to-company mail hookup, when the Internet was still something brand new (and sometimes unheard of) in the corporate world here.

                          So why that mail server is throwing that particular error message on an external recipient address (and no EXPN or VRFY commands used) - I can only wildly speculate. :-)
                          • 10. Re: E-mail sending from PL/SQL fails with SMTP error 550 must check for new....
                            user12240205
                            Finally figured out the problem and fixed it. Now it is working.

                            *"must check for new mail first"* means that before sending mail you have to check your mails (i.e. download) your mails first from the mail server, because the normal setting is for SMTP servers is that you can send mail only if you received a mail. So, when you receive a mail (i.e. check mail), your IP is recorded in the SMTP server log. Now if you send a mail, only mails with the IPs which has received any mail will be allowed to send mails outside.

                            In order to only a send a mail without receiving any mail first you have to use SMTP authentication.

                            I.e. After
                             
                             c := utl_smtp.open_connection(p_smtp_host, p_smtp_port);       
                            utl_smtp.EHLO(c, p_smtp_host);  
                            You have to give UID/PWD for the SMTP server like this:
                             utl_smtp.command( c, 'AUTH LOGIN');
                            utl_smtp.command( c, utl_raw.cast_to_varchar2( utl_encode.base64_encode( utl_raw.cast_to_raw( p_un))) );
                            utl_smtp.command( c, utl_raw.cast_to_varchar2( utl_encode.base64_encode( utl_raw.cast_to_raw( p_pwd))) );
                            However, when we sent like this we got a another SMTP error:
                            554 Message is not RFC compliant; missing "Date" header 
                            To solve this do this:
                            Go to Setup -> Default Domain & Servers, Servers, uncheck ...refuse
                            messages which are not RFC compliant. That will allow MDaemon to accept  the malformed messages without date headers..
                            Doing this solved the problem. Now we can send mails to outside mail boxes (like Gmail). In Gmail, when we checked the inbox there was no mail. It had gone the Spam folder. This is also important since you have to check the spam folder since Gmail will think it is spam. Once the mail is flagged as "not spam" it will start coming to your inbox.