Solved

SMTP problem with text messaging on WS2008

Posted on 2012-03-28
23
1,061 Views
Last Modified: 2012-04-07
Hi - I've finally gotten my email to work and the text messaging did work, but now when I send them out, they stay in the queue and one error message is:
Message delivery to the host '166.181.112.1' failed while delivering to the remote domain 'email.uscc.net' for the following reason: An SMTP protocol error occurred.
then something about unable to match sender with  - can't find that again.
DNS has not changed from old server to new.
Using simple ASP.

The same code worked on WS2003 and has worked on this server before.
The only changes were to enable 32 bit on the Application Pool.
I did catch a hacker sending 120,000 email messages through on the server today and had to delete them all and I closed port 25 for incoming -
IIS 6.0 (SMTP) is using anonymous - no authentication required.


<%
Set objEmail = CreateObject("CDO.Message")
objEmail.From = "9999999999@email.uscc.net"   ' also used an email address
objEmail.To = "dc@xxxxx.com;9999999999@email.uscc.net"  ' email gets delivered
objEmail.textbody = "test"
objEmail.Configuration.Fields.Item _
 ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objEmail.Configuration.Fields.Item _
 ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "127.0.0.1"
objEmail.Configuration.Fields.Item _
 ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objEmail.Configuration.Fields.Update
objEmail.Send
%>

XML view:
- <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
- <System>
  <Provider Name="smtpsvc" />
  <EventID Qualifiers="32772">4006</EventID>
  <Level>3</Level>
  <Task>0</Task>
  <Keywords>0x80000000000000</Keywords>
  <TimeCreated SystemTime="2012-03-28T23:31:54.000000000Z" />
  <EventRecordID>516718</EventRecordID>
  <Channel>System</Channel>
  <Computer>CWEB</Computer>
  <Security />
  </System>
- <EventData>
  <Data>166.181.112.1</Data>
  <Data>email.uscc.net</Data>
  <Data>An SMTP protocol error occurred.</Data>
  <Binary>D70204C0</Binary>
  </EventData>
  </Event>

Thanks in advance!
0
Comment
Question by:dcass
  • 16
  • 6
23 Comments
 
LVL 52

Expert Comment

by:Scott Fell, EE MVE
Comment Utility
Can't you require authentication?  Couldn't somebody just keep trying a different port until it worked?  I would require authentication.  Then in your cdo script use the sample here as a base. Also just by dumb luck, could you be blocked by   uscc.net for TOS? http://www.paulsadowski.com/wsh/cdo.htm

Const cdoSendUsingPickup = 1 'Send message using the local SMTP service pickup directory. 
Const cdoSendUsingPort = 2 'Send the message using the network (SMTP over the network). 

Const cdoAnonymous = 0 'Do not authenticate
Const cdoBasic = 1 'basic (clear-text) authentication
Const cdoNTLM = 2 'NTLM

Set objMessage = CreateObject("CDO.Message") 
objMessage.Subject = "Example CDO Message" 
objMessage.From = """Me"" <me@my.com>" 
objMessage.To = "test@paulsadowski.com" 
objMessage.TextBody = "This is some sample message text.." & vbCRLF & "It was sent using SMTP authentication."

'==This section provides the configuration information for the remote SMTP server.

objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 

'Name or IP of Remote SMTP Server
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "mail.your.com"

'Type of authentication, NONE, Basic (Base64 encoded), NTLM
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = cdoBasic

'Your UserID on the SMTP server
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusername") = "youruserid"

'Your password on the SMTP server
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "yourpassword"

'Server port (typically 25)
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 

'Use SSL for the connection (False or True)
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = False

'Connection Timeout in seconds (the maximum time CDO will try to establish a connection to the SMTP server)
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60

objMessage.Configuration.Fields.Update

'==End remote SMTP server configuration section==

objMessage.Send

Open in new window

0
 

Author Comment

by:dcass
Comment Utility
Maybe I'm missing something but would making it authenticated help get it through?
And I'm using localhost as the smtpserver - "localhost" and I've tried "127.0.0.1".  Is that a problem?
0
 

Author Comment

by:dcass
Comment Utility
Tried to add authentication - added it to both SMTP and to the specific web site under SMTP, but now no emails are going out at all:
     Set myMail=CreateObject("CDO.Message")
     sSubject = "Web Site Registration"
         email=request.form("email")

       myMail.Subject = sSubject
       myMail.From= "catson@catson.com"

         myMail.To="catson@catson.com"  ' not the real email
         myMail.HTMLBody="<html>"+email+"<html>"
             myMail.Configuration.Fields.Item _
             ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
            myMail.Configuration.Fields.Item _
             ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "127.0.0.1"
            myMail.Configuration.Fields.Item _
             ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusername") = "user"
'Your password on the SMTP server
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "pwd"
            myMail.Configuration.Fields.Update       
                myMail.Send
 
                Set myMail = Nothing
0
 

Author Comment

by:dcass
Comment Utility
I meant to say:
Tried to add authentication - added it to both SMTP and to the specific web site under IIS, but now no emails are going out at all.

Then I removed everything I had added and everything still sticks in the QUEUE - no messages anywhere, no problems that I can see - I restarted both smtp and IIS and nothing.

This is getting real annoying - I hope someone can help !
0
 
LVL 28

Expert Comment

by:sammySeltzer
Comment Utility
Check in the badmail folder. Do you see anything in there?
0
 

Author Comment

by:dcass
Comment Utility
Nothing - it's all in the Queue - with a message they have been delayed, but they never go through.  I'm having a smart host set up today and hoping that uscellular has not put us in their spam list.  We are not on Spamhaus - we don't allow spam and we know all of our customers.
0
 

Author Comment

by:dcass
Comment Utility
Do you need to set up authentication at the SMTP level or on each web site in IIS or both?
If we use NTLM, do we still put in a user name and password when we send, and won't that be sent in clear text?
0
 

Author Comment

by:dcass
Comment Utility
I also would like to know how to set the The Content-Type Header Field - it is coming though as bit7 and maybe it should be quotable-printable or base64.
0
 
LVL 28

Expert Comment

by:sammySeltzer
Comment Utility
Well, users are strongly encouraged to avoid using ntlm unless you have strongly typed passwords
0
 

Author Comment

by:dcass
Comment Utility
OK, I'll use basic or strong passwords.
This may well solve my problems if I can figure out how to set the Content-Type Header Field - it is coming though as 7bit and maybe it should be quotable-printable.
0
 
LVL 28

Expert Comment

by:sammySeltzer
Comment Utility
but what are you using the content_type header for?

Is it to format the body of your text?
0
The curse of the end user strikes again      

You’ve updated all your end user’s email signatures. Hooray! But guess what? They’re playing around with the HTML, adding stupid taglines and ruining the imagery. Find out how you can save your signatures from end users today.

 

Author Comment

by:dcass
Comment Utility
Maybe you can't set the header on smtpsvc - but it definitely is to format the body of the text.
0
 
LVL 28

Expert Comment

by:sammySeltzer
Comment Utility
Well, you probably can but it is more pain than it is worth.

What I do is use body to format and style my text:

body = "<font color='firebrick'>Hello:</font><br>" _
       & "<font color='000000'>This is to inform you that a potential new parishioner has just sent you a mebership registration form</font><br>" _
       & "<font color='000000'> Please click the link below to print the form</font><br>" _
       & "<font color='blue'><a href='http://domain.org/print_form.asp?familyEmail=" & (familyEmail) & "'>Click Here</a></font><br>"

Open in new window

Add as much text as needed separatinb by _ .

Inside your mail, you simply use as:

myMail.HTMLBody = Replace(""&body& "",vbCrLf,"<br>"&vbCrLf)

Open in new window


It writes and renders as formatted.
0
 

Author Comment

by:dcass
Comment Utility
Yes, that normally works - and it did until I tried to set authentication, but now nothing works.
0
 
LVL 28

Expert Comment

by:sammySeltzer
Comment Utility
when you say, "nothing works", what do you mean?

Are you getting an error?

Can you post your code, removing or hiding any confidential stuff?
0
 

Author Comment

by:dcass
Comment Utility
Sometimes email goes out, sometimes it sits in the queue.  Today, it's sitting in the queue.
I can't figure out what is making the difference.

Is there anyway for emails waiting to go out to get ahead of the ones that won't go out for whatever reason?

I already posted the code (above).

I did find that I'm on the barracuda spam list, which is really funny because I've only been able to send out a few emails myself and someone else was using it to send out hundreds of thousands (and theirs was going out until I cleaned out the queue).

Are there any other black lists to check besides spamhaus and barracuda?
0
 
LVL 28

Expert Comment

by:sammySeltzer
Comment Utility
Emails will go out regardless of whether the emails are on spam list or not.

If they are on spam list, they go into spam box but go out anyway.

if they are rejected, that's a separate email.

What you could do is go back into smtp server under Messages tab and configure it to send Non Delivery report to badmail folder.

This way, you can review and see what could be preventing emails from queueing up and not getting sent out.

Also, change event viewer for error messages and possible causes of emails getting stuck in the queue folder.

It is also my believe that it is possible that the email destinations are not answering due to perhaps, restrictive email screening protocols.  As long as you know the address is correct, and you have checked the SMTP log file for possible hints, it's a problem outside your control; really not much you can do especially given the fact you have noted that some do fly - an indication that your code works.
0
 

Author Comment

by:dcass
Comment Utility
SMTPSVC LOG but I don't know how to read it or what it means:

#Fields: date time cs-username s-sitename s-computername s-ip s-port cs-method sc-win32-status cs(User-Agent)

2012-03-30 02:14:15 OutboundConnectionCommand SMTPSVC1 CWEB - 25 EHLO 0 -
2012-03-30 02:14:15 OutboundConnectionResponse SMTPSVC1 CWEB - 25 - 0 -
2012-03-30 02:15:10 CWEB SMTPSVC1 CWEB 127.0.0.1 0 HELO 0 -
2012-03-30 02:15:10 CWEB SMTPSVC1 CWEB 127.0.0.1 0 MAIL 0 -
2012-03-30 02:15:10 CWEB SMTPSVC1 CWEB 127.0.0.1 0 RCPT 0 -
2012-03-30 02:15:10 CWEB SMTPSVC1 CWEB 127.0.0.1 0 RCPT 0 -
2012-03-30 02:15:10 CWEB SMTPSVC1 CWEB 127.0.0.1 0 DATA 0 -
2012-03-30 02:15:10 CWEB SMTPSVC1 CWEB 127.0.0.1 0 QUIT 141 -

It was set for folder badmail, but nothing is there.

It's the same email address being delivered from time to time.

General tab
IP Address = All unassigned (should this be the local ip address of the
server which is the only one in the list?

Access Tab
Authentication - Anonymous
Connection - All except the list below is selected, and there are no
computers in the list
Relay - All except the list below is selected, and there are no
computers in the list

Delivery Tab
Advanced - No Masquerade Domain or smart host (no idea what to do here
at all - can we use or isp smtp server? If so, how do we authenticate
with it?)
Maximum hop count = 15
FQDN resolves ok with the Check DNS button
Perform reverse DNS lookup is NOT checked.
Outbound Security - Anonymous access
TLS Encryption is not checked

LDAP Routing Tab
Enable LDAP Routing is not checked, all others are greyed out.

Security Tab
Operators are Administrators, Network Service and Local Service

In the domain list for the Default SMTP Virtual Server, only the FQDN (CWEB)
of the machine is there.

If someone has a complete list of things I should do regarding settings
changes and/or reboots etc, I would be most grateful!
0
 

Author Comment

by:dcass
Comment Utility
Also, when I search on http headers on network-tools, I get:

Server returned error: 404 Server returned error information for request
Header are:

HTTP/1.1 404 Not Found
Content-Type: text/html; charset=us-ascii
Server: Microsoft-HTTPAPI/2.0
Date: Fri, 30 Mar 2012 22:30:54 GMT
Connection: close
Content-Length: 315
0
 

Author Comment

by:dcass
Comment Utility
One more thing, the IP and PTR do not match - the PTR is 10.10.1.1.
0
 

Author Comment

by:dcass
Comment Utility
Another bit of information:
Warning in event viewer on smtpsvc:
Message delivery to the host '166.182.112.1' failed while delivering to the remote domain 'email.uscc.net' for the following reason: An SMTP protocol error occurred.
Log Name:System
Source: smtpsvc
Event ID:  4006
Level: Warning
User: N/A
OpCode:
Keywords: Classic
Computer: CWEB
0
 

Accepted Solution

by:
dcass earned 0 total points
Comment Utility
since no one has responded to this in a few days and I know it's not a code problem and it is an smtpsvc error, I would like to close this.  I think it has to do with DNS and PTR or reverse lookup - something is not set up right on the server.
0
 

Author Closing Comment

by:dcass
Comment Utility
No answer - opening new question
0

Featured Post

Don't lose your head updating email signatures!

Do your end users still have the wrong email signature? Do email signature updates bore you or fill you with a sense of dread? You can make this a whole lot easier on yourself by trusting an Exclaimer email signature management solution. Over 50 million users do...so should you!

Join & Write a Comment

There was an incident about the POP3 issue for the double read receipts and delivery receipts in Exchange 2013.  There was huge research been done and found solution for the duplicate mails. Especially when the user gets  duplicate mails.
Possible fixes for Windows 7 and Windows Server 2008 updating problem. Solutions mentioned are from Microsoft themselves. I started a case with them from our Microsoft Silver Partner option to open a case and get direct support from Microsoft. If s…
This tutorial will walk an individual through locating and launching the BEUtility application and how to execute it on the appropriate database. Log onto the server running the Backup Exec database. In a larger environment, this would generally be …
This tutorial will give a short introduction and overview of Backup Exec 2012 and how to navigate and perform basic functions. Click on the Backup Exec button in the upper left corner. From here, are global settings for the application such as conne…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now