Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

SMTP problem with text messaging on WS2008

Posted on 2012-03-28
23
Medium Priority
?
1,132 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 54

Expert Comment

by:Scott Fell, EE MVE
ID: 37779786
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
ID: 37779842
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
ID: 37779929
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
Has Powershell sent you back into the Stone Age?

If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone.  For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why.

 

Author Comment

by:dcass
ID: 37779978
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 29

Expert Comment

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

Author Comment

by:dcass
ID: 37782233
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
ID: 37782261
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
ID: 37782302
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 29

Expert Comment

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

Author Comment

by:dcass
ID: 37782549
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 29

Expert Comment

by:sammySeltzer
ID: 37782752
but what are you using the content_type header for?

Is it to format the body of your text?
0
 

Author Comment

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

Expert Comment

by:sammySeltzer
ID: 37783007
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
ID: 37783132
Yes, that normally works - and it did until I tried to set authentication, but now nothing works.
0
 
LVL 29

Expert Comment

by:sammySeltzer
ID: 37783191
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
ID: 37787206
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 29

Expert Comment

by:sammySeltzer
ID: 37787326
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
ID: 37789629
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
ID: 37789633
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
ID: 37789648
One more thing, the IP and PTR do not match - the PTR is 10.10.1.1.
0
 

Author Comment

by:dcass
ID: 37789684
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
ID: 37798515
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
ID: 37818722
No answer - opening new question
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
When you’re making plans to join the modern business race, you should analyze various details that may affect your results. Nowadays, millions of businesses are trying to grow into established and appreciated professional enterprises.
This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

824 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