|
Thanks Brad,+0000
I removed the RSET but still can not seem to do anything after the
authentication is successful
But I can use telnet and type this all in line by line and it works.
Here is the log after removing the RSET
What am I missing ?
Connection to mail.smtp2go.com established
220 mail.smtp2go.com ESMTP Exim 4.96-S2G Thu, 08 Dec 2022 21:01:41 +0000
EHLO MSD820.MSD.LOCAL
250-mail.smtp2go.com Hello MSD820.MSD.LOCAL
250-SIZE 52428800
250-8BITMIME
250-DSN
250-PIPELINING
250-PIPECONNECT
250-AUTH CRAM-MD5 PLAIN LOGIN
250-CHUNKING
250-STARTTLS
250-PRDR
250 HELP
AUTH LOGIN
334 VXNlcm5hbWU6
<user_name>
334 UGFzc3dvcmQ6
<password>
235 Authentication succeeded
MAIL FROM:<don@xxxxxxxxxx>
500 unrecognized command
ERROR: Invalid reply code to MAIL command.
RCPT TO:<don@xxxxxxxxxx>
503 sender not yet given
ERROR: Invalid reply code to RCPT command.
DATA
503-All RCPT commands were rejected with this error:
503-503 sender not yet given
503 valid RCPT command must precede DATA
ERROR: Invalid reply code to RCPT command.
QUIT
221 mail.smtp2go.com closing connection
Don
From: "Brad Stone" <bvstone@xxxxxxxxx>
To: "Midrange Systems Technical Discussion"
<midrange-l@xxxxxxxxxxxxxxxxxx>
Date: 08/12/2022 11:50 PM
Subject: Re: Modifying SMTPR4 for AUTH LOGIN
Sent by: "MIDRANGE-L" <midrange-l-bounces@xxxxxxxxxxxxxxxxxx>
You shoudn't need the RSET command.
On Thu, Dec 8, 2022 at 3:40 AM Don Brown via MIDRANGE-L <
midrange-l@xxxxxxxxxxxxxxxxxx> wrote:
Hi All,
I know there are great tools available but for the time being our
requirement is to add authentication to our out going emails.
We have been using Scott's SMTPR4 for a long time and it has bee very
good.
I have modified the SMTP_hshake procedure to include an authentication
request.
The results I am getting looked promising but I am stuck after the 235
Authentication succeeded.
Any suggestions gratefully appreciated
Here is my joblog with debug enabled in the program
Connection to mail.smtp2go.com established
220 mail.smtp2go.com ESMTP Exim 4.96-S2G Thu, 08 Dec 2022 09:11:06
+0000EHLO MSD820.XXX.LOCALneed
250-mail.smtp2go.com Hello MSD820.XXX.LOCAL [11.222.111.55]
250-SIZE 52428800
250-8BITMIME
250-DSN
250-PIPELINING
250-PIPECONNECT
250-AUTH CRAM-MD5 PLAIN LOGIN
250-CHUNKING
250-STARTTLS
250-PRDR
250 HELP
AUTH LOGIN
334 VXNlcm5hbWU6
<user_name>
334 UGFzc3dvcmQ6
<password>
235 Authentication succeeded
RSET
500 unrecognized command
ERROR: Invalid reply code to RSET command.
MAIL FROM:<don.brown@xxxxxxxxxx>
ERROR: send(): Descriptor not valid.
SMTP set sender email address fail
Descriptor not valid.
I added the RSET based on an example I saw - really do not know if I
it but I get a similar error if I omit it.
If I look at the connection log from a SMTP Diag tool it looks very
similar well the same to me.
Connecting to mail server.
Connected.
220 mail.smtp2go.com ESMTP Exim 4.96-S2G Wed, 07 Dec 2022 00:31:47
takenEHLO DON-1712
250-mail.smtp2go.com Hello DON-1712 [14.202.71.142]
250-SIZE 52428800
250-8BITMIME
250-DSN
250-PIPELINING
250-PIPECONNECT
250-AUTH CRAM-MD5 PLAIN LOGIN
250-CHUNKING
250-STARTTLS
250-PRDR
250 HELP
AUTH LOGIN
334 VXNlcm5hbWU6
<user_name>
334 UGFzc3dvcmQ6
<password>
235 Authentication succeeded
RSET
250 Reset OK
MAIL FROM: <don@xxxxxxxxxx>
250 OK
RCPT TO: <don@xxxxxxxxxx>
250 Accepted <don@xxxxxxxxxx>
DATA
354 Enter message, ending with "." on a line by itself
.
250 OK id=1p2iLm-bMGltl-06
Forcing disconnection from SMTP server.
QUIT
221 mail.smtp2go.com closing connection
Disconnected.
Message Sent Successfully
Here is the modified procedure ...
// -----------------------------------------
// Send HELO command
// -----------------------------------------
msg = 'EHLO ' + host + CRLF;
if ( sendtext(p_SMTP: msg) = *OFF );
return *OFF;
endif;
rc = response(p_SMTP);
if (rc = -1);
return *OFF;
endif;
if (rc <> 250);
SetError(SMTP_ERR_INVREPLY
: 'Invalid reply code to HELO command.');
return *OFF;
endif;
// -----------------------------------------
// Send AUTH LOGIN Command
// -----------------------------------------
msg = 'AUTH LOGIN ' + CRLF;
if ( sendtext(p_SMTP: msg) = *OFF );
return *OFF;
endif;
rc = response(p_SMTP);
if (rc = -1);
return *OFF;
endif;
if (rc <> 334);
SetError(SMTP_ERR_INVREPLY
: 'Invalid reply code to AUTH LOGIN command.');
return *OFF;
endif;
// -----------------------------------------
// Send USER Name base 64 encoded
// -----------------------------------------
msg = 'user@xxxxxxxxxx';
len = e2a( SMTP: msg : buf : %size(buf));
encLen = base64_encode( %addr (buf) : len : %addr(encData ) :
%size(encData ) -2);
%subst( encData: encLen+1 ) = CRLF;
if ( sendtext(p_SMTP: encData) = *OFF );
return *OFF;
endif;
rc = response(p_SMTP);
if (rc = -1);
return *OFF;
endif;
if (rc <> 334);
SetError(SMTP_ERR_INVREPLY
: 'Invalid reply code to USER name.');
return *OFF;
endif;
// -----------------------------------------
// Send Password base 64 encoded
// -----------------------------------------
msg = 'password';
len = e2a( SMTP: msg : buf : %size(buf));
encLen = base64_encode( %addr (buf) : len : %addr(encData ) :
%size(encData ) -2);
%subst( encData: encLen+1 ) = CRLF;
if ( sendtext(p_SMTP: encData) = *OFF );
return *OFF;
endif;
rc = response(p_SMTP);
if (rc = -1);
return *OFF;
endif;
if (rc <> 235);
SetError(SMTP_ERR_INVREPLY
: 'Authentication failed.');
return *OFF;
endif;
// -----------------------------------------
// Send RSET Command
// -----------------------------------------
msg = 'RSET ' + CRLF;
if ( sendtext(p_SMTP: msg) = *OFF );
return *OFF;
endif;
rc = response(p_SMTP);
if (rc = -1);
return *OFF;
endif;
if (rc <> 250);
SetError(SMTP_ERR_INVREPLY
: 'Invalid reply code to RSET command.');
return *OFF;
endif;
Thanks
Don
--
This email has been scanned for computer viruses. Although MSD has
usereasonable precautions to ensure no viruses are present in this email,MSD
cannot accept responsibility for any loss or damage arising from the
ofrelated
this email or attachments..list
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-l.
Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription
MSDquestions.--
Help support midrange.com by shopping at amazon.com with our affiliate
link: https://amazon.midrange.com
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list
To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-l.
Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
questions.
Help support midrange.com by shopping at amazon.com with our affiliate
link: https://amazon.midrange.com
--
This email has been scanned for computer viruses. Although MSD has taken
reasonable precautions to ensure no viruses are present in this email,
cannot accept responsibility for any loss or damage arising from the useof
this email or attachments..list
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-l.
Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
questions.
Help support midrange.com by shopping at amazon.com with our affiliate
link: https://amazon.midrange.com
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.