cPanel Exim Spamming

# count of all messages in queue
exim -bpc

# a list of message in the queue (time queued, message size, message id, sender, recipient)
exim -bp

Example output
1       4d  1.2K 1Ka6u5-00032Z-Eb <from@example.com>
2                 to@example.com
3
4       62h  1.2K 1KaRH0-0007QZ-B5 <from@example.com>
5                 to@example.com
6
7       3h   22K 1KbLHr-0004ev-An <from@example.com>
8                 to@example.com

#Finding the files with the find command
find /var/spool/exim -name "1Ka6u5-00032Z-Eb*"

# lists messages from a specified sender
exiqgrep -f [user]@domain

# lists messages to a specified recipient
exiqgrep -r [user]@domain

# List all queued messages, grouped by sender address
exim -bpr | grep -Eo "<[^ ]*@[^ ]*>" | sort | uniq -c

# List all queued messages, grouped by recipient address
exim -bpr | grep -Eo "^\s*[^ ]*@[^ ]*$" | sort | uniq -c

# Remove all messages older than 12hrs (43000 seconds)
exiqgrep -o 43000 -i | xargs exim -Mrm

# Remove all frozen messages from the queue
exiqgrep -z -i | xargs exim -Mrm

# Remove all messages from a particular sender
exiqgrep -i -f [user]@domain.com | xargs exim -Mrm

# Remove all messages from a sender that are older than 12hrs
exiqgrep -o 43000 -i -f [user]@domain.com | xargs exim -Mrm

#Processing all messages in queue to force deliver
exim -qff
============================================================
To clear exim mail queue
============================================================
exim -bp | awk '$6~"frozen" {print $3 }' | xargs exim -Mrm
grep -lr 'nobody@' /var/spool/exim/input/ | \sed -e 's/^.*\/\([a-zA-Z0-9-]*\)-[DH]$/\1/g' | xargs exim -Mrm
grep -rl 'From: Mail Delivery System' /var/spool/exim/input/ | \sed -e 's/^.*\/\([a-zA-Z0-9-]*\)-[DH]$/\1/g' | xargs exim -Mrm
grep -rl 'X-Spam-Status: Yes' /var/spool/exim/input/ | \sed -e 's/^.*\/\([a-zA-Z0-9-]*\)-[DH]$/\1/g' | xargs exim -Mrm
grep -rl 'Subject: Mail delivery failed' /var/spool/exim/input/ | \sed -e 's/^.*\/\([a-zA-Z0-9-]*\)-[DH]$/\1/g' | xargs exim -Mrm
grep -rl 'Message rejected' /var/spool/exim/input/ | \sed -e 's/^.*\/\([a-zA-Z0-9-]*\)-[DH]$/\1/g' | xargs exim -Mrm
grep -rl 'retry time not reached for any host' /var/spool/exim/input/ | \sed -e 's/^.*\/\([a-zA-Z0-9-]*\)-[DH]$/\1/g' | xargs exim -Mrm
grep -lr 'Cialis' /var/spool/exim/input/ | \sed -e 's/^.*\/\([a-zA-Z0-9-]*\)-[DH]$/\1/g' | xargs exim -Mrm
grep -lr 'viagra' /var/spool/exim/input/ | \sed -e 's/^.*\/\([a-zA-Z0-9-]*\)-[DH]$/\1/g' | xargs exim -Mrm
grep -lr 'Pharmaceutical' /var/spool/exim/input/ | \sed -e 's/^.*\/\([a-zA-Z0-9-]*\)-[DH]$/\1/g' | xargs exim -Mrm
grep -lr '***SPAM***' /var/spool/exim/input/ | \sed -e 's/^.*\/\([a-zA-Z0-9-]*\)-[DH]$/\1/g' | xargs exim -Mrm
grep -rl 'From: Mail Delivery System' /var/spool/exim/input/ | \sed -e 's/^.*\/\([a-zA-Z0-9-]*\)-[DH]$/\1/g' | xargs exim -Mrm
grep -rl 'Subject: ALL DRUGS HERE' /var/spool/exim/input/ | \sed -e 's/^.*\/\([a-zA-Z0-9-]*\)-[DH]$/\1/g' | xargs exim -Mrm
grep -lr 'DRUGS' /var/spool/exim/input/ | \sed -e 's/^.*\/\([a-zA-Z0-9-]*\)-[DH]$/\1/g' | xargs exim -Mrm
exiqgrep -i -f root@ | xargs exim -Mrm <-------------To delete emails to root@
=============================================================================
root@server [~]# exim -bp |exiqsumm
Count Volume Oldest Newest Domain
----- ------ ------ ------ ------
1 110KB 87m 87m burkert.com
1 2662 24h 24h compufort.com
---------------------------------------------------------------
66 911KB 5d 0m TOTAL

Command to get the count of total emails send by each cPanel account
# grep 'cwd=' /var/log/exim_mainlog|awk '{for(i=1;i<=10;i++){print $i}}'|sort|uniq -c|grep cwd|sort -n


2 comments:

  1. Excellent post, Helped alot!!!

    ReplyDelete
  2. I was in so much debit and needed a way to clear it up because my life was in danger, then I saw comments about cloned ATM Credit Cards that can be programmed to hack into and withdraw money from any ATM machines around you . I doubted this but decided to give it a try by contacting {skylinktechnes@yahoo.com} they responded with their guidelines on how the card works. I was assured that the card can withdraw $5,000 instant per day and it had a usage limit of 12 months. So I requested one & paid the delivery fee to obtain the card, i was shocked to see the parcel{card} delivered at my doorstep. I picked it up and went back inside and confirmed the workings and genuinity of the card at the atm machine closest to me. This is no doubt because I have the card & have made use of the card countless times without any complaints. These hackers are USA based hackers set out to help people with financial freedom!! Contact these email if you wants to get rich with this Via email skylinktechnes@yahoo.com whatsapp/t: +1(213)785-1553

    ReplyDelete