Esaminare la coda

Mostra i messaggi in attesa con numero, destinazione e ultimo errore: il primo controllo quando la posta non arriva.

Warteschlange

PowerShell (Windows)

Get-Queue (Exchange) Integrato

Get-Queue | Sort-Object MessageCount -Descending |
  Format-Table Identity, Status, MessageCount, NextHopDomain, LastError -AutoSize

IIS SMTP Pickup Integrato

Get-ChildItem "$env:SystemRoot\System32\inetsrv\mailroot\Queue" | Measure-Object

Shell Unix (bash)

mailq Integrato

mailq | tail -1
mailq | head -30

postqueue / exim Strumento aggiuntivo

postqueue -p | tail -1
exim -bpc

I cmdlet Exchange richiedono l'Exchange Management Shell. Su Linux il comando dipende dall'MTA: mailq funziona per Postfix ed Exim, i comandi di dettaglio differiscono.

Esaminare un messaggio

Mostra un singolo messaggio in attesa con mittente, destinatari, header e il motivo dell'errore.

PowerShell (Windows)

Get-Message (Exchange) Integrato

Get-Message -Identity "3F2A81C0B45" | Format-List Identity, Subject, FromAddress, Recipients, Status, LastError, Queue

Get-MessageTrackingLog Strumento aggiuntivo

Get-MessageTrackingLog -MessageId "3F2A81C0B45" -Start (Get-Date).AddDays(-1) | Format-Table Timestamp, EventId, Source, Recipients

Shell Unix (bash)

postcat Integrato

postcat -qv 3F2A81C0B45

exim Strumento aggiuntivo

exim -Mvh 3F2A81C0B45
exim -Mvb 3F2A81C0B45

Forzare la consegna

Avvia subito la consegna di tutti i messaggi in attesa invece di aspettare il prossimo tentativo.

PowerShell (Windows)

Retry-Queue (Exchange) Integrato

Get-Queue | Where-Object { $_.Status -eq "Retry" } | Retry-Queue -Resubmit $true

Force-Resubmit Strumento aggiuntivo

Get-Queue | Where-Object { $_.MessageCount -gt 0 } | ForEach-Object { Retry-Queue -Identity $_.Identity }

Shell Unix (bash)

postqueue Integrato

postqueue -f

exim Strumento aggiuntivo

exim -qff

Utile subito dopo aver risolto un'interruzione. Con una coda molto grande genera un picco di carico sulla destinazione.

Eliminare un messaggio

Rimuove un messaggio dalla coda, facoltativamente senza rapporto di mancato recapito.

PowerShell (Windows)

Remove-Message (Exchange) Integrato

Remove-Message -Identity "3F2A81C0B45" -WithNDR $false -Confirm:$false

Remove-Queue Strumento aggiuntivo

Get-Queue | Where-Object { $_.Status -eq "Suspended" } | Get-Message | Remove-Message -WithNDR $false -Confirm:$false

Shell Unix (bash)

postsuper Integrato

postsuper -d 3F2A81C0B45
# ALLE zurueckgestellten loeschen: postsuper -d ALL deferred

exim Strumento aggiuntivo

exim -Mrm 3F2A81C0B45

Non reversibile. Esaminate prima il messaggio e salvatelo se necessario (postcat, Get-Message).

Trovare i messaggi rinviati

Filtra la coda per testo di errore o codice di risposta per trovare lo schema dietro un'interruzione.

PowerShell (Windows)

Get-Queue (Exchange) Integrato

Get-Queue | Where-Object { $_.LastError -like "*550*" } |
  Format-Table Identity, MessageCount, NextHopDomain, LastError -AutoSize

Get-MessageTrackingLog Strumento aggiuntivo

Get-MessageTrackingLog -EventId FAIL -Start (Get-Date).AddHours(-24) | Format-Table Timestamp, RecipientStatus

Shell Unix (bash)

mailq / grep Integrato

mailq | grep -B1 "550" | head -40

postqueue Strumento aggiuntivo

postqueue -j | grep -o '"recipients".*' | head -20

Altre aree