Skip to main content

IIS Virtual SMTP

SMTP Folders

When you install the SMTP service it creates the following default folder structure in order to process mail:
20140115161234
As you can see from the screenshot above, the folder C:\inetpub\mailroot\contains 4 folders; BadmailDropPickup & Queue. They are explained below in the order that messages are processed:

Pickup

The SMTP service will process messages in the Pickup folder as outbound messages and will attempt to deliver them. To demonstrate what happens when a message is placed in the Pickup folder, perform the following:
1. Create a text file on your desktop called email.txt and paste the following into it, remembering to change the email address information to reflect your own details:
From: blog@yourdomain.com
To: email@yourdomain.com
Subject: Email test
 
This is the test body of the email
 
.
2. Save the changes to email.txt and then copy the file toC:\inetpub\mailroot\Pickup. The SMTP server monitors this folder and when it detects the email.txt file, it will read the contents and send the email to the address in the To: section. This should happen almost immediately.
3. Check the email address the email was sent to and it should arrive shortly – the email was sent to my Gmail account:
20130429184511
A quicker way and easier was of emulating the creation of messages in the Pickup folder is to run a PowerShell command that generates an email. Enter the command below, changing where appropriate the -To and -Fromaddresses:
PS C:\Users\admin> Send-MailMessage -SMTPServer localhost -Toxxxxx@gmail.com -From xxxxx@yourdomain.com -Subject "This is a test email" -Body "Hi, this is a test email sent via PowerShell"
Messages generally don’t build up in the Pickup folder, once detected the SMTP server will try to deliver them. If the intended recipient is a member of the local domain, the SMTP service will move the message to the Drop folder.

Drop

Incoming messages intended for the local domain are placed in the Drop folder. It is very unlikely that you will require the use of the Drop folder in a real-world scenario. Messages in the Drop folder must be retrieved using an email client such as Outlook but also require POP3 server software to be installed in order to enable end-users to connect to and retrieve those messages in the Drop folder. Server 2003 had the option to install the POP3 service but this has since been deprecated on versions of Windows Server since then.
If you are seeing that messages that your applications generate are building up in the Drop folder then this will be most likely be caused by configuring the default local domain to use your DNS domain namespace. The best way to illustrate this is to show you an example.
1. Currently my default local domain is configured with the name of my server, WEB1:
20140116125230
2. I use the PowerShell command below to send an email toblog@vsysad.com:
PS C:\Users\admin> Send-MailMessage -SMTPServer localhost -Toblog@vsysad.com -From admin@vsysad.com -Subject "This is a test email" -Body "Hi, this is a test email sent via PowerShell"
The message is subsequently placed in the Pickup folder and processed and routed through to the mail server that handles mail for the vsysad.com domain. This message is delivered successfully.
3. However, lets change the default local domain to be vsysad.com per the below:
20140116115427
The vsysad.com DNS domain is now considered to be a local domain. If I were to use the same PowerShell command from step 2 above, the message will be processed per the usual method but will be placed the Drop folder:
20140116130612
The message will remain there until I use an email client to connect to the server via POP3 to download it. This will require 3rd party POP3 mail server software to enable this.

Queue

Messages that cannot be delivered  immediately are moved  from the Pickup folder to the Queue folder. The SMTP service will attempt repeatedly to deliver messages in the Queue folder. The number of times it will attempt to deliver the message is configured in the delivery tab, see below:
I have noticed that when delivering emails to domains such as Gmail and Yahoo for the first time, messages will remain in the Queue folder for some time while the SMTP server tries to re-deliver them.

Badmail

Emails that could not be delivered to the intended recipient are left in the Badmail folder. After the number of attempts configured in the Delivery tab (see screenshot above) to deliver the message have not been successful, the message will be moved to the Badmail folder. Messages in the Badmail folder will remain there until administrators diagnose the cause and implement a fix.
Common causes of messages ending up in the Badmail folder are incorrect or invalid email addresses and DNS issues. Follow instructions in these posts toverify DNS and successful mail routing respectively.
Once messages are in the Badmail folder, they can be opened up in notepad and examined. Open up the corresponding .BAD file(s) which will reveal the reason for the message delivery failure. An example is below, whereby the message failed because the recipient’s email address was invalid:
20140122005105

SMTP Domains

It is very important to clarify the distinction between a local domain and a remote domain within the SMTP settings. Choosing the wrong SMTP domain type will result in unintended results.

Local Domains

As stated in the Drop folder section above, a local domain is a DNS domain that is serviced by the local SMTP server. In my example, vsysad.com was the local default domain.
Messages that are received by an SMTP server that are destined for email addresses within the local domain will not be looked up in DNS, they will be dumped straight to the Drop folder. In the case of most environments the SMTP server is used simply to send mail and not to handle incoming mail for that domain. If this is the case for you, do NOT enable yout DNS domain as a local domain within the SMTP server.
You can specify local domains as either default or alias. There can only be one default domain. An alias domain is an alias of the default domain. If you add a new domain and configure it as the new default, the previous default changes to an alias domain.

Remote Domains

Domains that are not designated as local are remote domains. The SMTP service looks up remote domains in DNS and will process the mail according to the settings configured for that specific remote domain. For example, you can add a remote domain and require that the SMTP service always use Transport Layer Security (TLS) encryption in sessions with that domain, which is the case for Gmail.
I hope this post demystifies the various SMTP folders and explains how mis-configuring the domain type can lead to unwanted messages in the Drop folder.

Original Link:http://www.vsysad.com/2014/01/iis-smtp-folders-and-domains-explained/

Comments

Popular posts from this blog

There are currently no logon servers available to service the logon request

When bringing a new server on line, you may see an error that says: The Security System detected an authenticaton error for the server ldap/xxxxxxxt. The failure code from the authentication protocal Kerberos was "There are currently no logon servers available to service the logon request. Event id: 40960 category: SPENGO (Negotiator) (0xc000005e) This issue is the result of missing or the inability to contact the DNS SRV (SeRVice) records. You just brought a new server on line. To complete the process, the server has to register its own host A record and SVR record in DNS. To do this, Type the following at the command prompt: IPconfig /flushdns IPconfig /registerdns net stop netlogon net start netlogon flushing DNS will remove all old or improper DNS records registering dns records registers your Host A record restarting the netlogon will register your SRV records. __________________________________________________________________________________ Speaking of ...

test vpn bandwidth and speed with iperf

This article explains how to use a free utility called iPerf to test the speed of a VPN connection. In this example I am running iPerf on windows but there are other versions available (i.e. Linux). Download iPerf from  http://linhost.info/2010/02/iperf-on-windows/ Put a copy on 2 computers with 1 either side of the VPN. In this example I have put in the c:\triangle folder On the “server” PC open a cmd prompt and navigate to the folder containing iperf. Note on computers running Win7 or Win2008 I recommend running the cmd prompt in elevated mode. Run the command  iperf –s On the “client” PC open a cmd prompt and again navigate to the folder containing iperf. Run the command  iperf –c After a short while the estimated bandwidth is displayed.

Installing the East-Asian language packs

Windows XP SP3 Info 1. Go to Start > Control Panel > Regional & Language Options (or Date, Time, Language and Regional Options) > Languages. 2. Check the box for Install files for East Asian Languages > Click OK and let the process run and then you will have to Restart your PC. Alternatively, you may need to install the East Asian Language pack that is on your original Windows disc. Outlined below is a step-by-step guide to installing it in your computer (for Windows XP - Vista users might have to undergo different steps, but they should still be similar). Try it and see if it works for you: 1. Insert your Windows XP CD 2. Go to Control Panel 3. Go to Regional and Language Options 4. Click on the Languages Tab 5. Click on the Install files for East Asian Languages checkbox and make sure that it's checked. 6. Click on the OK button for the dialog box that appears. 7. Click on the OK button of the window to close it, and begin the installation. ...