Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 419
  • Last Modified:

How to setup SMTP using a DMZ server

I have a new website I am trying to launch and am having an issue with an automated email function. Whenever a user changes their password the site emails the user and let's them know. When doing so, an error is returned stating "Unable to read data from the transport connection: net_io_connectionclosed."

The server where the site is hosted is in the DMZ of a Cisco firewall. Port 25 is open in the access list. I have verified that telnet using port 25 connects from the web server (dmz) to the exchange server (internal network). However when attempting to run any commands, the connection is lost.

Ping works both ways as well.

The web server is setup as a relay server in exchange. When connecting a cable from the web server to the internal network, the email will send without issue.
          imports system.net.mail
Dim Emailer As New System.Net.Mail.MailMessage("from", "to")
Emailer.Subject = "Error in the Site"
Dim mailClient As New System.Net.Mail.SmtpClient()
Dim basicAuthenticationInfo As New System.Net.NetworkCredential("username", "password")
        Emailer.Body = "The error description is as follows : " & serverror
        mailClient.Host = "hostname"
        mailClient.UseDefaultCredentials = False
        mailClient.Credentials = basicAuthenticationInfo
And I have also tried using this code.
                imports system.web.mail
        Dim mail As New MailMessage()
        mail.To = "address"
        mail.From = "address"
        mail.Subject = "this is a test email."
        mail.Body = "this is my test email body"
        SmtpMail.SmtpServer = smtpserver

Open in new window

  • 3
1 Solution
It is probably a "mailguard" issue.  In my experience that feature has always been quite errant.

You can try to disable it:

policy-map global_policy
 class inspection_default
  no inspect esmtp

bmaitdepartmentAuthor Commented:
I will give that a try today. Thanks.
bmaitdepartmentAuthor Commented:
policy-map is not a recognized command on my firewall. I did however look up how to disable mailguard for my particular server. I entered the command

no fixup protocol smtp 25

This did not solve the issue.
bmaitdepartmentAuthor Commented:
Access had not been granted to the DMZ server using the connection option in the virtual SMTP server.

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now