Wednesday, November 11, 2009

Clean Sendmail Queue | Ubuntu Linux Howto

Tech Blog - if you need to clear sendmail queue the following is some very usefull commands for doing the job

To 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:

Looking for a tech tip? By installing a spyware remover your computer will be safe.

The HTC Magic mobile phone allows you to blog from your mobile phone!

Best Web Host lists the best web hosts in today's market.

For suggestion and concerns E-mail