Description
The mail queue is the components allowing asynchronous mail processing in the James email server.
The ManageableMailQueue exposes some interesting wiring functionalities like:
- ManageableMailQueue::getSize
- ManageableMailQueue::flush
- ManageableMailQueue::clear
- ManageableMailQueue::remove by recipient, sender or name
- ManageableMailQueue::browse
This functionality would be very helpful for an ADMIN, hence we should expose them in the CLI.
Thus we would like to have the following CLI commands:
QueueSize queueName flushQueue queueName clearQueue queueName removeFromQueue queueName [sender,recipient,name] sender@domain.com browseQueue queueName [Browse being returning mail name, sender, recipients]
To do so:
- Create a MailQueueManagementMBean and MailQueueManagement implementation, that exposes these functionalities (with one extra argument: queue name). MailQueueManagement would use the injected MailQueueFactory, and implement the given behaviour if the MailQueue is "manageable" and throw otherwise.
- You need to add the commands in CmdType (as well as related tests)
- Add your command handling in ServerCmd and add related tests
- You need to record the given MBEAN in spring and Guice
- An integration test in "james-server-cli-integration" would be welcome.
Of course, feel free to ask for help on the gitter chat.