Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6157331
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T20:46:02+00:00 2026-05-23T20:46:02+00:00

Using MS VC++ C:9 (2008) in Windows XP 32 bits and Boost.asio: I’ve written

  • 0

Using MS VC++ C:9 (2008) in Windows XP 32 bits and Boost.asio:

I’ve written an application who can send/receive e-mails from/to an proprietary dBase using the POP3/SMTP protocols. The whole thing work as expected, but there are an problem in the SMTP connection process that for the moment, I’ve been unable to resolve in a generic way.

In SMTP, the whole process is a sequence of commands from the client (C:) and reading the responses from the remote server (S:). The command is sent with some as:

async_write (socket_, request_,
    boost::bind(&IPCON::hndlSOKresp, this, placeholders::error));

The server response to the client’s command, is always ended with CRLF sequence, so the hdlSOKresp() function, includes some as:

async_read  (socket_,  response_,  transfer_at_least(1),
     boost::bind(&IPCON::hndlRemain,  this,  placeholders::error));

In turn, hadlRemain() verifies if the received buffer ends with the CRLF pair, and otherwise, calls itself recursively until the whole response has been received.

The schema work fine when -as usually-, the server response contains one line, but the command EHLO/HELLO, produce a multiline response containing the main characteristics of the server and specific of each server. As an example, there are tree responses:

1&1 Nemesis server (a knonw Internet service provider):

250-smtp.1and1.es
250-STARTTLS
250-AUTH LOGIN PLAIN
250-AUTH=LOGIN PLAIN
250-PIPELINING
250-SIZE 120000000
250 HELP

Google Gmail:

250-mx.google.com at your service, [83.61.174.109]
250-SIZE 35882577
250-8BITMIME
250-AUTH LOGIN PLAIN XOAUTH
250 ENHANCEDSTATUSCODES

Yahoo:

250-smtp212.mail.bf1.yahoo.com
250-AUTH LOGIN PLAIN XYMCOOKIE
250-PIPELINING
250 8BITMIME

The question is: how can be handled this situation?

The momentary workaround is that if I know the connection that has been used, then I can wait until the last word. I.e: if Gmail is used, the connection can continue reading until the word “ENHANCEDSTATUSCODES\r\n” has been received and the whole process continues as a charm. But obviously this is not a practical option.

Another approach has been include this specific command in a try/catch block and use the timer to abort the reading process after a while. Some as:

// the connection-object panelp is defined here -out of the try/catch block-
try {
    if (!smtpConnect (panelp))  {
        // throw some error…
    }
} catch (...) {
    // if (error == connection timed-out) then continue
}

// the process continues here

The problem here is that if continuing after an exception, the process hang in the next asio operation. It seems as if the stack unwinding affected the asio behavior in some way.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T20:46:03+00:00Added an answer on May 23, 2026 at 8:46 pm

    Please see this document: SMTP Multiline Reponses:

    The format for multiline replies requires that every line, except the
    last, begin with the reply code, followed immediately by a hyphen, “-”
    (also known as minus), followed by text. The last line will begin with
    the reply code, followed immediately by <SP>, optionally some text,
    and <CRLF>.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We're using Windows 2008 and we are thinking of switching application servers from Adobe
Well, to begin with, I'm using Visual Studio 2008 on a 32-bits Windows XP
Using Visual Studio 2008, c#, .net 2.0. I have a Windows Forms client application
I have created an application in VS C# Express 2008 using Windows 7 as
My application runs SQL Server 2008 on Windows Server 2008 using Tomcat. I am
I'm using VB 2008 express to create a windows form application. I have a
I am working on a Windows Form-Based application in Visual Studio 2008 using C#
I'm working on a project using Windows 2008, .NET 3.5 and WCF for some
I'm using Visual Studio 2008 (on Windows 2003 Server / 32 bit) to compile
Is it possible to query certificate store on windows server 2008 using .net platform?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.