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 find out the last X emails sent.

Discussion in 'E-mail Discussions' started by SuperBaby, May 14, 2007.

  1. SuperBaby

    SuperBaby Well-Known Member

    Joined:
    Nov 27, 2003
    Messages:
    331
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Thailand
    cPanel Access Level:
    Website Owner
    Twitter:
    I am using RH9 + WHM/cPanel.

    Is there is way to find out (from WHM or shell) the details of the last x number of emails sent?

    Sometimes I see my server load is very high and the activity related is exim and clamscan. I just want to find out whether the emails being scanned is from my hosted customers or some hacker's activities.
     
  2. david510

    david510 Well-Known Member

    Joined:
    Aug 22, 2004
    Messages:
    473
    Likes Received:
    0
    Trophy Points:
    16
    You may run the following script from the shell to see the last 100 mails successfully delivered from the server and mails delivered into the server.


    Last 100 Mails successfully delivered through the mail server
    Code:
     sed -n '/=>/p' /var/log/exim_mainlog |   sed -e :a -e '$q;N;101,$D;ba' 
    

    Last 100 Mails successfully sent through the mail server
    Code:
     sed -n '/<=/p' /var/log/exim_mainlog |   sed -e :a -e '$q;N;101,$D;ba'
    
     
  3. SuperBaby

    SuperBaby Well-Known Member

    Joined:
    Nov 27, 2003
    Messages:
    331
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Thailand
    cPanel Access Level:
    Website Owner
    Twitter:
    Thank you. This is such an important piece of information for me. Very useful.
     
  4. david510

    david510 Well-Known Member

    Joined:
    Aug 22, 2004
    Messages:
    473
    Likes Received:
    0
    Trophy Points:
    16
    You are welcome :)
     
Loading...

Share This Page