0

I try to use Chilkat AppendMail method to store sent email in Sent mailbox

$oIMAP.AppendMail($sMailbox_name, $oEmail)

Mostly it works fine. But on some end clients configurations I get:

              --sendCmdToSmtp
            --sendRcptTo
            sendCmdToSmtp:
              SmtpCmdSent: DATA<CRLF>
            --sendCmdToSmtp
            readSmtpResponse:
              SmtpCmdResp: 250 OK
            --readSmtpResponse
            readRcptTo:
              readSmtpResponse:
                SmtpCmdResp: 250 Accepted
              --readSmtpResponse
              recipient: *****@destination.pl
            --readRcptTo
            readRcptTo:
              readSmtpResponse:
                SmtpCmdResp: 250 Accepted
              --readSmtpResponse
              recipient: *****@sender.pl
            --readRcptTo
            readSmtpResponse:
              SmtpCmdResp: 354 Enter message, ending with "." on a line by itself
            --readSmtpResponse
          --sendWithPipelining
          sendCmdToSmtp:
            SmtpCmdSent: <CRLF>.<CRLF>
          --sendCmdToSmtp
          readSmtpResponse:
            SmtpCmdResp: 250 OK id=1nypCX-0005r9-EO
          --readSmtpResponse
        --sendSmtpEmail
      --sendMimeInner
    --sendEmailInner
    Success.
  --SendEmail
--ChilkatLog

My question is why 354 Enter message, ending with "." on a line by itself occurs ?

I already read: sendmail error Enter mail, end with "." on a line by itself

and: https://serverfault.com/questions/509464/error-message-not-sent-server-replied-354

where I read: Whoever wrote the webmail program needs to go back and read RFC 5321 again and then fix the bug.

So I wonder if it is something wrong with Chilkat component ? Or I need to change something in my code ?

Michał Lipok
  • 365
  • 6
  • 24
  • 1
    That doesn't make sense. Your line of code refers to IMAP, but the log output is for sending an email message via SMTP (with the pipelining extension). The log output has nothing to do with the IMAP call. – arnt Jun 08 '22 at 08:30
  • That is also not an SMTP error: that's just the premable of the server telling the client they can send the message now after providing the envelope. – Max Jun 08 '22 at 14:31

1 Answers1

1

My guess is that you have instances of both the MailMan object (for SMTP) and the IMAP object. You call MailMan.SendEmail to send the email, and it works fine. Then you make a call to an Imap method to copy (append) the sent email to the "Sent" folder on the mail server. The Imap call fails, but then you mistakenly show the mailman.LastErrorText instead of the imap.LastErrorText.

Chilkat Software
  • 1,405
  • 1
  • 9
  • 8
  • Almostly. I mean I found out that the IMAP problem was related to the fact that I was trying to appendemail to mailbox `INBOX.Sent` or `Sent`, but in fact this particular server had mailbox `SENT`. After I change mailbox to `SENT` no more error ocurs. I still must investigate why I get error from MailMan object. Will back soon with more information. – Michał Lipok Jun 20 '22 at 23:05
  • `mailman.LastErrorText instead of the imap.LastErrorText.` I do not catch error like that. I catch errors from ActiveX COM object directly, I mean by using `COM ERROR HANDLER` – Michał Lipok Jun 20 '22 at 23:07