Queue priority
In Exchange 2013, Microsoft added a "Priority queue" function, when it was opened, the messages marked as high priority will be delivered first, while those marked as low priority will be delivered later than the normal mail, and the sorter and routing algorithm will not be affected after this feature is turned on. Only the transport service arranges messages in priority order in each delivery queue.
The setting of the queue priority is mainly done by modifying the key value of the EdgeTransport.exe.config configuration file, first by setting the Priorityqueuingenabled key value to True to turn on the function, then adjusting the detail options in the following table as needed, and then restarting the The service is in effect (Restart-service MSExchangeTransport)
Parameters |
Meaning |
Priorityqueuingenabled |
Set to True to turn on the queue priority feature on this MBX, which defaults to false, all of the following options do not take effect. |
Maxhighprioritymessagesize |
Specifies a high-priority message size, and messages that exceed the message size are considered normal messages. The default is 250KB. When entering a value, you need to take the KB or MB as the unit. The value should be less than the Maxsendmessagesize value in Set-transportconfig. |
Lowprioritydelaynotificationtimeout Normalprioritydelaynotificationtimeout Highprioritydelaynotificationtimeout |
Specifies the time-out interval for delayed send status notification (DSN) messages based on message priority, which defaults to Low: 8 hours, Normal: 4 hours, high priority: 30 minutes. This means that high-priority messages should be notified of delayed status sooner if they are delayed for some reason. The format of the value is DD.HH:MM:SS |
Lowprioritymessageexpirationtimeout Normalprioritymessageexpirationtimeout Highprioritymessageexpirationtimeout |
Specifies the maximum time that the transport service attempts to send a failed message, and if this time is exceeded, an NDR is returned to the sender. Similar to the one above, high priority messages get a notification that an earlier message could not be delivered (NDR). The default is low: 2 days, Medium: 2 days, High: 8 hours, the format of the value is the same as the previous one |
Maxperdomainlowpriorityconnections Maxperdomainnormalpriorityconnections Maxperdomainhighpriorityconnections |
These keys specify the maximum number of connections that the transport service can establish with any single remote domain. Use the delivery queue and send connector on the mailbox server to establish a connection to the remote domain. The default is low: 2, Medium: 15, High: 3. The total value of these three keys cannot exceed the Maxperdomainoutboundconnections attribute on Set-transportservice |
As can be seen from the above description, the parameters in EdgeTransport.exe.config and Set-transportservice have a mutual influence on the relationship. The settings for message delay and expiration in the Set-trasportservice command correspond directly to the EdgeTransport.exe.config settings for the normal message priority.
When queuing priority is disabled, all queued priority message limits in the EdgeTransport.exe.config configuration file are ignored. All message restrictions in the Set-transportservice cmdlet apply to all messages that go through the transport service on a mailbox server.
When queuing priority is enabled, the queued priority message limit in the EdgeTransport.exe.config configuration file overrides the corresponding message limit in the Set-transportservice cmdlet. All other message restrictions in the Set-transportservice cmdlet still apply to low-priority, normal-priority, and high-priority messages that pass through the transport service on the mailbox server.
Another is the Set-mailbox command in the downgradehighprioritymessagesenabled parameter, the default is False, set to True, Any high-priority messages sent from the MBX server are automatically demoted to normal priority.
Manage queues
During the daily operation, it is possible to encounter situations where manual intervention is required to adjust the queue. Some of the operations can be done through the UI interface of the Exchange Queue Manager, and EMS provides commands to allow the administrator to perform more detailed operations on the queue, and then let's take a look.
View and manage messages in a queue
Consider a scenario where you suddenly find that there is a backlog of messages in the queue, and that the number of stacks is not reduced, and that the current server load is not high, and you want to figure out why these messages accumulate in the team. So you use the Get-queue command to get the information for that queue that is stacked, as follows:
650) this.width=650; "Width=" "height=" 333 "title=" 1.png "style=" width:600px;height:333px; "src="/HTTP/ S3.51cto.com/wyfs02/m02/70/dd/wkiol1xaqwrjl4-caaliqtnn7ag031.jpg "border=" 0 "vspace=" 0 "hspace=" 0 "alt=" Wkiol1xaqwrjl4-caaliqtnn7ag031.jpg "/>
From this information, you can see is because the DNS query failure caused by the message heap, you have to check the server configuration in DNS resolution, domain-controlled DNS public network forwarding, the public network there is no existence of this SMTP domain name and so on.
There are some times when you encounter the following error:
"421 4.2.1 Unable to connect. Attempted failover to alternate host, but that does not succeed. Either there is no alternate hosts, or delivery failed to all alternate hosts. "
This error indicates that the source server in the current send connector cannot connect to the next hop target in the Nexthopdomain, this situation must first check from itself, the edge of the CAS (proxy send connector) or MBX can access the extranet, or 25 ports that can reach the target SMTP domain mail server. Find yourself this side no problem, to have enough confidence to contact each other: "Your mail server can not receive our mail!" Hurry to see if it is anti-pressure/database hung/off the net! ”
You can then use the Get-message command to get information about each message in the queue that is stuck.
650) this.width=650; "Width=" "height=" 167 "title=" 2.png "style=" WIDTH:600PX;HEIGHT:167PX; "src="/HTTP/ S3.51cto.com/wyfs02/m01/70/dd/wkiol1xaqxnysyjcaaezhxls-qs455.jpg "border=" 0 "vspace=" 0 "hspace=" 0 "alt=" Wkiol1xaqxnysyjcaaezhxls-qs455.jpg "/>
Note The returned message list, preceded by an identity, can continue to use the Get-message command for more detailed information.
650) this.width=650; "Width=" "height=" 265 "title=" 3.png "style=" width:600px;height:265px; "src="/HTTP/ S3.51cto.com/wyfs02/m01/70/e0/wkiom1xaqtchckkqaal9sf7p2xw061.jpg "border=" 0 "vspace=" 0 "hspace=" 0 "alt=" Wkiom1xaqtchckkqaal9sf7p2xw061.jpg "/>
Unlike Exchange 2010, Exchange 2013 uses a longer number to identify messages within a queue, and the ID number in the identity of messages in the queue does not matter with the Message-id attribute of the message itself. The MessageID property will be moved along with the message on the public network, even if the target server is not changed.
If you want to pause the delivery of this message, or the delivery of a group of messages, you can use the Suspend-message command with the-identity parameter named messages in the queue you want to manipulate.
Suspend-message-identity ' ex01\5272\19460496818233 '
You can then use the resume-message command to recover the delivery of the message:
Resume-message-identity ' ex01\5272\19460496818233 '
The Remove-message command can remove the message from the queue, but note that there is a parameter-withndr, that is, to return the sender a message to inform him, if we do not return the NDR, then this parameter is set to $ false:
Remove-message-identity ' ex01\5272\19460496818233 '-withndr $False
Note that you do not need to pause the entire queue before using Remove-message.
Exchange 2013 also provides additional commands for administrators to manipulate messages, namely Export-message and Assemblemessage. It can be very simple to select a message and export the message, including the various components of the message, exported as a text document, and the Export mail action does not remove it from the queue. Note that to export a message, you have to pause the queue, or suspend-message. The exported message can be checked or edited and then re-sent to the pickup or replay directory. So there's a backdoor that can ... No, there is a convenient way to send a message from a queue on a server that has a queue stuck to another server that can reach the destination.
Export-message uses the-identity parameter of the specified message, and the command exports a binary object, You also have to work with the previous script Assemblemessage.ps1 to compile as a readable. eml format file, and we can do this in a series of simple pipe calls:
Get-message-identity ' ex01\5272\19460496818233 ' | Suspend-message | Export-message | Assemblemessage–path c:\exporttemp\
It would be troublesome to export all the messages in a queue because the Assemblemessage script can only invoke one mail object at a time, so let's use a little code trick here:
$theMessages = @ (get-message-queue ' ex01\5272 ') $theMessages | foreach {$i + +; Export-message $_. Identity | Assemblemessage-path ("C:\Temp" + $i + ". eml")}
The first line means that all messages are fetched in the specified queue and stored as an array, and the second line iterates through the array, passing each element in the array (each message) to Export-message, which is then processed by Assemblemessage and exported as a file.
pausing and resuming queues
As mentioned earlier, a queue can have multiple statuses: pause, activity, retry, ready, etc... In some scenarios, administrators will of course want to follow their own requirements for queues, such as temporary pauses to post messages to a particular remote domain, or to have exchange immediately start tripping the previous delivery failed message.
This time it involves Resume-queue, Suspend-queue, retry-queue two orders. The use is also very simple, with the queue name on the back, the remote SMTP domain name is also possible, because the queue database can be used to identify your specific operation of the queue.
Suspend-queue ex01\5272
Suspend-queue contoso.com
Pausing a queue requires confirm, while resuming or retrying does not require confirmation. And these three commands also support the use of the-filter parameter to filter bulk operations, so that you can have all the servers on the server in a "retry" state of the queue to retry delivery immediately:
Retry-queue-filter {status-eq "Retry"}
Submitting messages through the Pickup directory
The general function of the pickup directory is to provide some application-generated messages to be stored here, and then the transport service reads the messages from this directory and delivers them. Some monitoring applications, for example, detect that a server's memory footprint is exceeded, and it generates a message similar to the following format:
To: [email protected]from: [email protected]date:14 July 04:52amsubject: "Emergency" mail Front Edge Transport memory usage more than 9% mime-version:1.0content-type:text/html; charset= "iso-8859-1" Content-transfer-encoding:7bit
By default, the pickup directory is located in%exchangeinstallpath% \transportroles\pickup\, or you can modify the path by using the Set-transportserver command:
Set-transportserver–identity Mbx02–pickupdirectorypath ' D:\Exchange\PickupDirectory '
The basic idea is that the application creates a text message with an. eml extension in the basic SMTP message format, and then puts it in the pickup directory. Every 5 seconds, Exchange checks here once (cannot be modified), and then transmits any. eml files found in the directory.
Other files that do not end in. eml are ignored, and exchange takes 12 messages per 5 seconds from the pickup directory, and if more than 12 are processed, the remainder is handled in the next 5 seconds. Can be adjusted by the parameters in the Set-transportserver the volume of the message, for example, I am here to adjust to processing 250 per minute, then every 5 seconds to deal with 250/12=20.8333 email. :
Set-transportserver–pickupdirectorymaxmessagesperminute 250
The. eml file in the Pickup directory is first renamed to a file with a. tmp extension, and then Exchange detects whether the file has the necessary structure to convert to a normal message. If a. tmp file with the same name is present, it is renamed to the format of < original file name >< date >.tmp, and if the renaming fails, a log error is generated and the next file is processed. If not, the system will issue a delete on close directive to the. tmp file, although the file still appears in the pickup directory but cannot be opened. After the converted message successfully enters the submission queue, the system issues a close instruction and the. tmp command is removed. If the deletion fails, an event log error is generated. If the Microsoft Exchange transport service is restarted when the. tmp file is present in the pickup directory, all the. tmp files are renamed to. eml files and will be processed again. This may cause the message to be transferred repeatedly.
The basic requirements for mail files are as follows:
1. The mail file must be a text file that conforms to the basic SMTP message format. MIME message header fields and content are supported.
2. The file name extension of the mail file must be. eml.
3. There must be at least one e-mail address in the sender of the message header or in the From Message header field. If an e-mail address exists in the Sender and from fields, the e-mail address in the From field is used as the original sender of the message in the message envelope.
4. Only one e-mail address can exist in the Sender field. Multiple e-mail addresses are not allowed. If there is only one e-mail address in the From field, the Sender field is optional.
5. Multiple e-mail addresses are allowed in the From field, but only one e-mail address must exist in the Sender field. The address in the Sender field is then used as the original sender of the message in the message envelope.
There must be at least one e-mail address in the 6, to, Cc, or BCC fields.
7. There must be a blank line between the message header and the message body.
8, the maximum size of the message header is 100 KB and the maximum number of recipients is. You can use the Set-transportservice cmdlet to change these restrictions. These settings affect only the pickup directory.
Exchange will remove the contents of the received, resent-*, and Bcc columns from the message header, and if there is only a recipient address in the BCC bar, Exchange uses undisclosed recipients instead of the contents of the To column, that is, the recipient is unknown. If the date and Message-id two fields are missing, exchange modifies them, uses the format <GUID>@<defaultdomain> adds a Message-id The date and time that the field was processed for mail processing with the Add pickup directory.
Replay Directory
The replay directory is used to resubmit exported Exchange messages and to receive messages from the external gateway server. Like the pickup directory, Exchange checks the replay directory every 5 seconds and processes the message information found inside it. These messages have been formatted for the replay directory. Administrators should not manually increase the content in the replay directory, because the message content placed here is heavily used in the X-header field, which is very easy to mistake. So if you want to submit a new message manually, use the pickup directory.
For more information about the replay directory, refer to: https://technet.microsoft.com/zh-CN/library/bb124230 (v=exchg.150). Aspx#replayreqs
Here finally is the end of the queue this chapter, if there is any do not understand the message can be exchanged, the next chapter we talk about the more relaxed topic: Mail throttling.
This article is from the "Castamere Rainy season" blog, be sure to keep this source http://sodaxu.blog.51cto.com/8850288/1681539
"Deep Exchange 2013"18 queue Part3