Sendmail: Clear / Delete / Flush Mail Queue Command

To clear the mail queue in Sendmail, you can use the following command:

sendmail -q

The -q option tells Sendmail to process the mail queue and deliver any pending messages. By default, Sendmail checks the mail queue every hour, but you can use the -q option to force it to process the queue immediately.

If you want to delete a specific email from the mail queue, you can use the sendmail -qI command, where I is the identifier of the email you want to delete. The identifier can be found by running the sendmail -bp command, which displays a list of messages in the mail queue.

For example, if you want to delete the email with identifier H75C1BE4E0, you can use the following command:

sendmail -qIH75C1BE4E0

It’s important to note that deleting an email from the mail queue will not notify the sender that the email was not delivered. The email will simply be removed from the queue and will not be delivered.

(www.kbic.com)

Leave a Comment