WatchDirectory Forum
http://www.watchdirectory.net/cgi-bin/yabb25/YaBB.pl
watchDirectory forums >> Plugins >> SMTP error when sending to an external email
http://www.watchdirectory.net/cgi-bin/yabb25/YaBB.pl?num=1191972715

Message started by flyinglow on Oct 10th, 2007 at 1:31am

Title: SMTP error when sending to an external email
Post by flyinglow on Oct 10th, 2007 at 1:31am
I'm trying to setup Watch Directory to send an email to an external recipient.  I have been successful at sending files to people in our environment (same domain) but I can't send to anyone externally.  
When I test it, the system appears to use the wrong email address for authentication.  For example, I'm using the "Login" Authentication process and the userid is 'data'.  When I try to use the Test button, it asks me "Enter an email address to send the test message to."  I enter an email address (I'll type a junk one here for protection) of userid@yahoo.com.  An error message comes back saying "SMTP returned error. 550 5.7.1 Unable to relay for userid@yahoo.com".  
When I view the log it appears as if it's trying to use the "userid@yahoo.com" to authenticate when it should be using the "data" account.  Here is the log:

*** seeIntegerParam(0,29,1)
*** seeIntegerParam(0,62,2)
*** seeStringParam(0,58,data)
*** seeStringParam(0,57,**password removed**)
*** seeSmtpConnect
<200:26279375>
VS Win32 Version 1.2.1 Build 1
SEE Win32 Version 4.0.8 Build 5
GdP Software                                      
CID=8720
<101:26279390>
vSocket: 0 created
vs: LogHandle = 716
<102:26279390>
LocalHost = 'MGMT SERVER'
<104:26279390>
Server = 'exchangeserver.internaldomain.local'
ServerIP = 192.168.XXX.XXX
<105:26279390>
Socket=604, RemoteIP=**removed**, RemotePort=25
<106:26279921>
<201:26279953>
R: 220 smtp.internaldomain.org Microsoft ESMTP MAIL Service, Version: 6.0.3790.211 ready at  Tue, 9 Oct 2007 16:23:30 -0700
<202:26280156>
S: EHLO yahoo.com
<203:26280406>
R: 250-smtp.internaldomain.org Hello [192.168.XXX.XXX]
R: 250-TURN
R: 250-SIZE
R: 250-ETRN
R: 250-PIPELINING
R: 250-DSN
R: 250-ENHANCEDSTATUSCODES
R: 250-8bitmime
R: 250-BINARYMIME
R: 250-CHUNKING
R: 250-VRFY
R: 250-X-EXPS GSSAPI NTLM LOGIN
R: 250-X-EXPS=LOGIN
R: 250-AUTH GSSAPI NTLM LOGIN
R: 250-AUTH=LOGIN
R: 250-X-LINK2STATE
R: 250-XEXCH50
R: 250 OK
<160:26280406>
S: AUTH LOGIN
<162:26280656>
R: 334 VXNlcm5hbWU6
S: ZGF0YQ==
<163:26280687>
R: 334 UGFzc3dvcmQ6
S: QnJhMW4yMDA3
<164:26280921>
R: 235 2.7.0 Authentication successful.
AUTH LOGIN ok
*** seeSendEmail
*** Sending...
<204:26280921>
S: MAIL FROM:<userid@yahoo.com>
<205:26280953>
R: 250 2.1.0 userid@yahoo.com....Sender OK
<206:26280953>
<207:26280953>
S: RCPT TO:<userid@yahoo.com>
<208:26280953>
R: 550 5.7.1 Unable to relay for userid@yahoo.com
ERROR(26280953): SockCode=0 SeeCode=-49 PrevState=208 ThisState=208 NextState=208
SMTP returned error. 550 5.7.1 Unable to relay for userid@yahoo.com
*** seeClose
<258:26330671>
S: QUIT
<259:26330703>
R: 221 2.0.0 smtp.internaldomain.org Service closing transmission channel
vSocket: 0 closed
*** Releasing channel 0 ***


Can you explain to me what I might be doing wrong?

Title: Re: SMTP error when sending to an external email
Post by Gert on Oct 10th, 2007 at 6:48am
Hello,


Code (] *** seeStringParam(0,58,data)
*** seeStringParam(0,57,**password removed**[/code):

This part is where the actual authentication data is sent (so this seems correct).

[code]S: MAIL FROM:<userid@yahoo.com>
S: RCPT TO:<userid@yahoo.com>


And here the "From" and "To" are sent. You are quite right, it should not useuserid@yahoo.com as the "from" address - this may very well explain the SMTP relay error you receive.
This is a problem only present in the "Test Email" window, so you can ignore the error. The rest of the program will use the correct from address.

Thanks for reporting this, it will be fixed in the next release.

Gert

Title: Re: SMTP error when sending to an external email
Post by flyinglow on Oct 10th, 2007 at 8:14pm
I'm still getting an error even when just using the email plugin.  Here is the log showing the failure:

vs: LogHandle = 280
*** seeStringParam(0,53,EJ Data<data@ourdomain.org>)
*** seeIntegerParam(0,8,0)
*** seeIntegerParam(0,25,59)
*** seeSendEmail
*** Sending...
<204:93152156>
S: MAIL FROM:<data@ourdomain.org>
<205:93152187>
R: 250 2.1.0 data@ourdomain.org....Sender OK
<206:93152187>
<207:93152187>
S: RCPT TO:<bob@yahoo.com>
<208:93152187>
R: 550 5.7.1 Unable to relay for bob@yahoo.com
ERROR(93152187): SockCode=0 SeeCode=-49 PrevState=208 ThisState=208 NextState=208
SMTP returned error. 550 5.7.1 Unable to relay for bob@yahoo.com
*** seeClose
<258:93152187>
S: QUIT
<259:93152218>
R: 221 2.0.0 smtp.ourdomain.org Service closing transmission channel
vSocket: 0 closed
*** seeStringParam(0,53,EJ Data<data@ourdomain.org>)
*** seeIntegerParam(0,29,1)
*** seeIntegerParam(0,62,2)
*** seeStringParam(0,58,data)
*** seeStringParam(0,57,**password removed**)
*** seeIntegerParam(0,32,1)
*** seeIntegerParam(0,64,0)
*** seeIntegerParam(0,1001,0)
*** seeStringParam(0,51,X-PostMan: MGMT-SERVER)
*** seeSmtpConnect
<200:93157718>
VS Win32 Version 1.2.1 Build 1
SEE Win32 Version 4.0.8 Build 5
GdP Software                                      
CID=8720
<101:93157718>
vSocket: 0 created
vs: LogHandle = 280
<102:93157718>
LocalHost = 'MGMT-SERVER'
<104:93157718>
Server = 'exchange-server.ourdomain.local'
ServerIP = 192.168.XXX.XXX
<105:93157718>
Socket=272, RemoteIP=**removed**, RemotePort=25
<106:93158250>
<201:93158281>
R: 220 smtp.ourdomain.org Microsoft ESMTP MAIL Service, Version: 6.0.3790.211 ready at  Wed, 10 Oct 2007 10:58:09 -0700
<202:93158484>
S: EHLO ourdomain.org
<203:93158734>
R: 250-smtp.ourdomain.org Hello [192.168.3.21]
R: 250-TURN
R: 250-SIZE
R: 250-ETRN
R: 250-PIPELINING
R: 250-DSN
R: 250-ENHANCEDSTATUSCODES
R: 250-8bitmime
R: 250-BINARYMIME
R: 250-CHUNKING
R: 250-VRFY
R: 250-X-EXPS GSSAPI NTLM LOGIN
R: 250-X-EXPS=LOGIN
R: 250-AUTH GSSAPI NTLM LOGIN
R: 250-AUTH=LOGIN
R: 250-X-LINK2STATE
R: 250-XEXCH50
R: 250 OK
<160:93158734>
S: AUTH LOGIN
<162:93158984>
R: 334 VXNlcm5hbWU6
S: ZGF0YQ==
<163:93159015>
R: 334 UGFzc3dvcmQ6
S: QnJhMW4yMDA3
<164:93159250>
R: 235 2.7.0 Authentication successful.
AUTH LOGIN ok
*** seeSendEmail
*** Sending...
<204:93159250>
S: MAIL FROM:<data@ourdomain.org>
<205:93159281>
R: 250 2.1.0 data@ourdomain.org....Sender OK
<206:93159281>
<207:93159281>
S: RCPT TO:<bob@yahoo.com>
<208:93159281>
R: 550 5.7.1 Unable to relay for bob@yahoo.com
ERROR(93159281): SockCode=0 SeeCode=-49 PrevState=208 ThisState=208 NextState=208
SMTP returned error. 550 5.7.1 Unable to relay for bob@yahoo.com
*** seeStringParam(0,20,C:\Documents and Settings\All Users\Application Data\watchDirectory\System.Mail\Out\dummy.log)


For some reason, the way the message is constructed, our smtp server thinks that the program is trying to relay for bob@yahoo.com.  It seems like something is still not working properly.  Any more ideas on what I might be doing wrong?

Title: Re: SMTP error when sending to an external email
Post by Gert on Oct 11th, 2007 at 1:44pm
Strange.... I will post the new beta in about an hour. That version fixes the "test message" issue, and will make it easier for you to experiment. Can you try to use different "authentication" methods with the beta, perhaps that helps.

If that doesn't work, can you setup an email account for me on your server so I can do some testing?

Gert

Title: Re: SMTP error when sending to an external email
Post by Gert on Oct 11th, 2007 at 6:10pm
Hello again,

I have sent your last messagelog to someone who is very knowledgeable about smtp servers, and this is what he had to say:


Quote:
According to your log file, you authenticated with the server successfully.
But evidently the SMTP server is refusing to accept mail addressed to certain recipients.
Yes, this is indeed a little strange. Normally all email is accepted from authenticated senders. Perhaps the server is set up to reject email for delivery outside of its domain.
Contact the server's administrator and ask why your email was not accepted for delivery although you were authenticated.


According to him, it might be a misconfiguration of the SMTP server.

Hope this helps,

Gert

WatchDirectory Forum » Powered by YaBB 2.5.2!
YaBB Forum Software © 2000-2017. All Rights Reserved.