Tech Blog - if you need to clear sendmail queue the following is some very usefull commands for doing the jobTo check how many pending mail you have use the "mailq -v" command.
Manually removed pending mails
$ rm /var/spool/mail/*.*
$ rm /var/mqueue/*.*
Delete pending mails using sendmail command
$ sendmail -v -q
You can delete certain domain or user or recipient mail using the following command
$ sendmail -qS -v domainname.com it will delete all mail from *@domainname.com
Delete mail from recipient
$ sendmail -qR -v gmail.com
You can also use find command to removed queues
$ find /var/spool/mqueue -type f -exec grep "Deferred: Connection refused" {} \; -exec rm -rf {} \;
Hope this help!
0 comments:
Post a Comment