Cara Membersihakan email postfix

Issue

  •     /var/spool/postfix/maildrop contains thousands of files
  •     How to flush or delete emails from the postfix mail queue

Resolution

 To flush the queue (force delivery) :

    [root@rh-mcnode01 ~]# postfix flush

 To delete mails from queue :

        Check the mail queue, using the mailq command and delete a specific email like so :

     [root@rh-mcnode01 ~]# postsuper -d mailID

 To remove all mail from all the queues ( hold, incoming, active and deferred ) , run :

     [root@rh-mcnode01 ~]# postsuper -d ALL

The email is stored in maildrop queue, you can run postsuper -d ALL maildrop to nuke all of them

     [root@rh-mcnode01 ~]# postsuper -d ALL maildrop

 To remove all mails in the deferred queue only, run :

  [root@rh-mcnode01 ~]# postsuper -d ALL deferred

Alternative command

You can execute the following command to remove all file from /var/spool/postfix/maildrop/.

[root@rh-mcnode01 ~]# find /var/spool/postfix/maildrop/ -type f | xargs rm  -rf

sumber: https://antnix07.blogspot.com/2018/08/how-to-flush-or-delete-emails-from.html