How to delete all messages in the delivery queue from a specific sender
search cancel

How to delete all messages in the delivery queue from a specific sender

book

Article ID: 152504

calendar_today

Updated On:

Products

Messaging Gateway

Issue/Introduction

There is a need to know how to delete all messages in the delivery queue from a specific sender or specific recipient.

Resolution

  • This can be done by issuing mta-control delete-msgs-by-sender <regexp> or mta-control delete-msgs-by-rcpt <regexp> command from the CLI. 

(NOTE: This command accepts any Perl regular expressions (case insensitive) as arguments)

mta-control delivery delete-msgs-by-sender user\@example\.com or mta-control delivery delete-msgs-by-rcpt user\@example\.com

  • To remove all NDR messages sent by the Messaging Gateway:

mta-control delivery delete-msgs-by-sender mailer-daemon