de-DEen-GB
 
MVP - Most Valuable Professional
rss

Just can't get enough of IT

This blog is about mostly anything in IT. But the primary focuses are Microsoft Technologies like Exchange, Office 365, Azure and Cloud Security.

Exchange Server 2010Exchange Server 2013Exchange Server 2016PowerShellDescription

When migrating to new version of Exchange Servers you must move your internal SMTP relay endpoints. This can be a challeging tasks as application owners mostly ignore your requests for such changes. 

You can use the information provided in the receive connector log files to identify remote clients (MTAs / MTUs) connecting to the legacy infrastructure. The assumption is that protocol logging is enabled. You can easily active protocol logging across all receive connector fo a single server using the following EMS PowerShell one-liner:

Get-ReceiveConnector -Server EX01 | Set-ReceiveConnector -ProtocolLoggingLevel Verbose

The scripts searches the log files for the connection's EHLO response which containes the remote name or remote IP-address of the system connecting to the receive connector.

You can either search

  • Legacy Exchange Servers (aka Exchange Server 2010)
  • Modern Exchane Servers 
    • Frontend Transport
      or
    • Backend Transport (aka Hub Transport)

For more information read the readme.md file at Github.

Note

You need to adjust the log file path to suit your IT infrastructure. A next releas will contain a more automatic solution.

Examples

# Search legacy Exchange servers SMTP receive log files for the last 4 days and save search results in a single CSV file

.\Get-RemoteSmtpServers.ps1 -Servers SRV01,SRV02 -LegacyExchange -AddDays -4 -ToCsv

Version History

  • 1.0, Initial community release 
  • 1.1, Fixed Issue #2

Links

Follow

 

Read More »
On December 23, 2016
0 Comment
2328 Views

Exchange Server 2007 Exchange Server 2010 Exchange Server 2013 Exchange Server 2016Exchange email adress policies are used to generate addresses since the early days of Exchange. Email address policies are used to automatically generate addresses for various protocols (SMTP, FAX, CCMAIL, MSMAIL). These overall use of address policies is well documented, but there is still some odd behaviour of the policies when it comes to language specific character handling.

The following list describes the common parameters:

  • %s = Surname (Last Name)
  • %g = Given Name (First Name)
  • %i = Middle Initial
  • %d = Display Name
  • %m = Exchange Alias
  • %rxy = Replace all subsequent characters x with character y
  • %rxx = Remove all subsequent characters x

All language specific characters and other non RFC 821/822 compliant characters are either translated or removed.

Source character Target character in SMTP address
 Space  Hypen
 A - Z | a -z  A - Z | a - z
 Ä, Ö, Ü | ä, ö, ü  Ae, Oe, Ue | ae, oe, ue
 ß  ss
 áàâ | ÁÀÂ  a | A
 éèê | ÉÈÊ  e | E
 íìî | ÍÌÎ  i | I
 óòô | ÓÒÔ  o | O
 úùû | ÚÙÛ  u | U
 §  S
 µ  M
 " ( ) ´ [ ] : . < > , ;  Omitted

 

Example 1

User without any language specific characters

Given Name: John
Last Name : Doe
Alias     : JohnDoe

Email address policy results

%g.%s@mcsmemail.de  = John.Doe@mcsmemail.de
%m@mcsmemail.de     = JohnDoe@mcsmemail.de
%1g_%s@mcsmemail.de = J_Doe@mcsmemail.de

 

Example 2

User with German language specific characters

Given Name: Michael
Last Name : Müller
Alias     : Michael Mueller

Email address policy results

%g.%s@mcsmemail.de  = Michael.Mueller@mcsmemail.de
%m@mcsmemail.de     = Michael-Mueller@mcsmemail.de
%2g%s@mcsmemail.de  = MiMueller@mcsmemail.de

 

Example 3

User with Scottish language specific characters

Given Name: Ian
Last Name : O'Connell
Alias     : IanOConnell

Email address policy results

%g.%s@mcsmemail.de  = Ian.O'Connell@mcsmemail.de
%m@mcsmemail.de     = IanOConnell@mcsmemail.de
%3g%5s@mcsmemail.de = IanO'Con@mcsmemail.de

 

Problem

As you might have noticed, the apostrophe is not handled as a special character but an RFC compliant character. The address policy is applied without any issues at all.

But a SMTP address containing an apostrophe leads to email transport errors and must be removed.

 

Solution

You can use the replacement parameter to strip all apostrophes from the surname by using the following email address policy.

%g.%r''%s@mcsmemail.de = Ian.OConnell@mcsmemail.de

This example will only remove apostrophes from the surname (%s) as the replacement parameter is placed in front of the surname parameter.

 

Links

 

 

Read More »