The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to delete bounce back mail from SSH

Discussion in 'E-mail Discussions' started by its_joe, Dec 13, 2007.

  1. its_joe

    its_joe Well-Known Member

    Joined:
    Feb 15, 2007
    Messages:
    134
    Likes Received:
    0
    Trophy Points:
    0
    Hello,

    We have Linux CentOS with WHM 11 installed on it. '

    On our server weekly we got too many bounce back mail. I want to delete that mails from the backend(SSH). So please give me any command or script that i can run in cron, so that the mails are deleted automatically and i don't have to schedule job for it.


    thanks. waiting for the replies.

    its_joe
     
  2. WebScHoLaR

    WebScHoLaR Well-Known Member

    Joined:
    Dec 14, 2005
    Messages:
    511
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    Planet Earth
    Have you set the default address of the domains on your server to :fail: ? What usually happens that spammers send emails from xyzaddress@yourdomain.com to others. As the spam emails are sent to random addresses so some of them bounce back to sender. If you have the default address set to :fail: then any email sent to xyzaddress@yourdomain.com will not be accepted by your mailserver. However if you have set the default/catch all address then the bounce back email or any email sent to xyzaddress@yourdomain.com will be delivered to the mailbox.
     
  3. its_joe

    its_joe Well-Known Member

    Joined:
    Feb 15, 2007
    Messages:
    134
    Likes Received:
    0
    Trophy Points:
    0
    Hello,

    Thank you for the reply.

    Our server is a shared server. And on it about 1500 domains are configured. All the website have there own rules and there own filters. We cannot touch there rules for the spam/filters.

    And the all the bounce mails get stored in the main server's exim(/var/spool/exim) .

    So we just want to delete these selected bounce back mails.

    Like we have the command to delete the Frozen mails on the server
    exim -bpru|grep frozen|awk {'print $3'}|xargs exim -Mrm

    So i want the command like this which will delete the bounce back mails.
     
  4. brianoz

    brianoz Well-Known Member

    Joined:
    Mar 13, 2004
    Messages:
    1,146
    Likes Received:
    6
    Trophy Points:
    38
    Location:
    Melbourne, Australia
    cPanel Access Level:
    Root Administrator
    There's an addon from www.configserver.com called "cmq" (Configserver Mail Queue) which will solve your problems. You need to install it into WHM before using it; don't worry, it's safe, I have it on all my servers and it's been developed by a trusted cpanel expert.
     
  5. its_joe

    its_joe Well-Known Member

    Joined:
    Feb 15, 2007
    Messages:
    134
    Likes Received:
    0
    Trophy Points:
    0
    Hello,

    We already have Configserver Mail Queue installed on the server and we delete the bounce back mails from it.

    But now I want to delete the bounce back mails from the SSH. And I want to added that command or script that will delete the bounce mail in the cron. So that this cron will run weekly and delete the unwanted mails. And there will be no separate task for delete the mail queue.

    Waiting for the reply.

    its_joe
     
  6. its_joe

    its_joe Well-Known Member

    Joined:
    Feb 15, 2007
    Messages:
    134
    Likes Received:
    0
    Trophy Points:
    0
    is there anyone to get the reply for this thread ?????
     
  7. ashokpomnar

    ashokpomnar Active Member

    Joined:
    Sep 30, 2006
    Messages:
    28
    Likes Received:
    0
    Trophy Points:
    1

    You can delete Frozen mail using following command
    exiqgrep -z -i |xargs exim -Mrm
     
  8. its_joe

    its_joe Well-Known Member

    Joined:
    Feb 15, 2007
    Messages:
    134
    Likes Received:
    0
    Trophy Points:
    0
    Hello,

    thanks for the information.

    I also got some information as follows:

    #Remove the frozen messages.
    exiqgrep -zi|awk {'print $3'}|xargs exim -Mrm

    #Remove nobody mails
    exim -bpru|grep nobody|awk {'print $3'}|xargs exim -Mrm

    #Remove mail older than 1 day
    exiqgrep -o 86400 |awk {'print $3'}|xargs exim -Mrm


    one can use it.
     
Loading...

Share This Page