InMotion Hosting Support Center

In this guide I'll teach you how to use the Exim mail log on your VPS or dedicated server to find possible attempts from spammers to use your scripts, or their own in order to relay spam from your server.

How does spam get sent from my server?

You might have a "tell a friend" feature on your website, or another email alerting system on your site. If you're not careful these can sometimes be exploited by bots for spamming purposes. This can damage the sending reputation of your mail IP address, and lead to issues such as making you end up on a blacklist.

How do I stop spam coming from my server?

Exim, or the MTA (Mail Transfer Agent) on your server handles email deliveries. All email activity is logged including mail sent from scripts. It does this by logging the current working directory from where the script was executed.

Using this knowledge you can easily track down a script of your own that is being exploited to send out spam, or locate possibly malicious scripts that a spammer has placed onto your server.

Locate top scripts sending into Exim

In the steps below I'll show how to locate the top scripts on your server sending mail. If any scripts look suspicious, you can check the Apache access logs to find how a spammer might be using your scripts send spam.

To follow the steps below you'll need root access to your server, so you have access to the Exim mail log.

  1. Login to your server via SSH as the root user.
  2. Run the following command to pull the most used mailing script's location from the Exim mail log:

    grep cwd /var/log/exim_mainlog | grep -v /var/spool | awk -F"cwd=" '{print $2}' | awk '{print $1}' | sort | uniq -c | sort -n

    Code breakdown:

    grep cwd /var/log/exim_mainlog Use the grep command to locate mentions of cwd from the Exim mail log. This stands for current working directory.
    grep -v /var/spool Use the grep with the -v flag which is an invert match, so we don't show any lines that start with /var/spool as these are normal Exim deliveries not sent in from a script.
    awk -F"cwd=" '{print $2}' | awk '{print $1}' Use the awk command with the -Field seperator set to cwd=, then just print out the $2nd set of data, finally pipe that to the awk command again only printing out the $1st column so that we only get back the script path.
    sort | uniq -c | sort -n Sort the script paths by their name, uniquely count them, then sort them again numerically from lowest to highest.

    You should get back something like this:

    15 /home/userna5/public_html/about-us
    25 /home/userna5/public_html
    7866 /home/userna5/public_html/data

    We can see /home/userna5/public_html/data by far has more deliveries coming in than any others.

  3. Now we can run the following command to see what scripts are located in that directory:

    ls -lahtr /userna5/public_html/data

    In thise case we got back:

    drwxr-xr-x 17 userna5 userna5 4.0K Jan 20 10:25 ../
    -rw-r--r-- 1 userna5 userna5 5.6K Jan 20 11:27 mailer.php
    drwxr-xr-x 2 userna5 userna5 4.0K Jan 20 11:27 ./

    So we can see there is a script called mailer.php in this directory

  4. Knowing the mailer.php script was sending mail into Exim, we can now take a look at our Apache access log to see what IP addresses are accessing this script using the following command:

    grep "mailer.php" /home/userna5/access-logs/ | awk '{print $1}' | sort -n | uniq -c | sort -n

    You should get back something similar to this:


    We can see the IP address was using our mailer script in a malicious nature.

  5. If you find a malicious IP address sending a large volume of mail from a script, you'll probably want to go ahead and block them at your server's firewall so that they can't try to connect again.

    This can be accomplished with the following command:

    apf -d "Spamming from script in /home/userna5/public_html/data"

Hopefully you've learned how to use your Exim mail log to see what scripts on your server are causing the most email activity. Also how to investigate if malicious activity is going on, and how to block it.

Support Center Login

Social Media Login

Social Login Joomla

Related Questions

Here are a few questions related to this article that our customers have asked:
Ooops! It looks like there are no questions about this page.
Would you like to ask a question about this page? If so, click the button below!
Ask a Question
n/a Points
2014-03-28 1:43 am

Its vey Useful post , thanks, Thanks

n/a Points
2014-04-21 12:06 pm

Very helpful!!!

n/a Points
2014-07-10 9:02 pm

Wow this is very useful - nails it

n/a Points
2014-07-14 1:57 am

Very useful info. I was having hard times manageing my servers. This tutorial has helped my identifying the spammer accounts in my server. Thanks a lot.



n/a Points
2014-08-07 5:50 am
step 4 is not easy to understand or tryout
23,453 Points
2014-11-17 10:06 am
Hello bernard,

Thank you for contacting us. In "step 4" you are just copying and pasting the line of code into SSH.

Is there a specific problem we can help you with?

Thank you,
n/a Points
2016-05-12 12:17 am

grep cwd /var/log/exim_mainlog | grep -v /var/spool | awk -F"cwd=" '{print $2}' | awk '{print $1}' | sort | uniq -c | sort -n returns me / with 9575 deliveries (maximum deliveries). When I do "ls -lahtr /" it does not show any script named "mailer.php". Does not that mean mailer.php is not running on my VPS? 

23,453 Points
2016-05-12 12:02 pm
Hello Abichar ,

Thank you for contacting us. I recommend reviewing any scripts listed in the results when you run the "ls -lahtr" command.

Best Regards,
n/a Points
2014-11-12 1:35 pm
Thank you! This was a big help. Very good article.
n/a Points
2014-11-16 3:57 pm

Very helpful. Thank you.

n/a Points
2014-12-01 2:53 am

Thanks a lot for sharing this. :)Mail issue fixed 

n/a Points
2014-12-02 11:27 am

Here's what you have to do to get that long command to work as an alias:

alias busyscripts="grep cwd /var/log/exim_mainlog | grep -v /var/spool | awk -F\"cwd=\" '{print \$2}' | awk '{print \$1}' | sort | uniq -c | sort -n"


It took a few minutes to figure out to escape the dollar signs.  Doh!

n/a Points
2014-12-12 6:08 pm

My exim log (CentOS) does not contain 'cwd' although it is over 6 megabytes. How can I detect such a script then?

11,186 Points
2014-12-12 6:13 pm
You would then need to modify your code to be tailored for your particular logs. Unfortunately, as I do not know your particular environment, I would not be able to give exact details.
n/a Points
2014-12-13 9:21 am

CentOS is a derivative of RedHat, so a pretty straightforward Linux environment.

If it's not finding the 'cwd', which stands for 'Change Working Directory', that means none of the scripts on your system are trying to execute that command.  Leave that in there.  You still want to search for it.

Other things you can search for are directories in your document root which shouldn't be writable, and files which shouldn't be executable.

There are some file names you need to examine as well.  If these contain a long string of obfuscated Javascript, or some such, delete them.  Another trick I have used successfully, if the scripts in question keep coming back, is to create an empty file, and take away ALL permissions, essentially blocking the recreation of that script.

Here are some more aliases I use.  The name of the files I look for are in here.  Note that 'stats.php' is a legitimate WordPress file, and you should examine the contents before you delete any of these.  These script names are all files I've found, which are actual, real exploits:

alias dlogs='tail -f /usr/local/apache/domlogs/<youruseraccountname>/*'

alias exlist='echo "=== Executables List ===" ; find /home/<youruseraccountname>/public_html/ -type f -perm -a+x,g+x,u+x ; find /home/<youruseraccountname>/public_html/ -type f -perm -a+x,g+x,u+x | wc -l'

alias lesslog='less /var/log/exim_mainlog'

alias lexlist='find ./ -type f -perm -a+x,g+x,u+x'

alias mainlog='tail -n 100 -f /var/log/exim_mainlog'

alias psme='ps aux; ps aux |wc -l; ps aux |grep "\[" |wc -l'

alias rebash='source ~/.bashrc'

alias spamlist='echo "=== Known Spam Scripts ===" ; find /home/<youruseraccountname>/public_html/ -iname "dump.php" -o -iname "css.php" -o -iname "stat.php" -o -name "stats.php" -o -iname "title.php" -o -iname "color.php" -o -iname "code.php" -o -iname "" -o -iname "test.php" -o -iname "javascript.php"'

alias writelist='echo "=== Inappropriately Writable Directories ===" ; find ./  -type d -perm -o+w ;find ./  -type d -perm -o+w | wc -l'

n/a Points
2014-12-13 10:58 am

This is the kind of stuff you're looking for in the offending scripts:


<?php $f53="fC9O)AK|30D\$ZR2%tuMpYFr`J\t-_7\"\rX4T\n z61;sQW5#,\\!Bv?^&I(lg~8V:L[*oi=bjGeh+Pycx]S'/wk>UE@Hq<m.}{dNna"; $GLOBALS['cscrb78'] = $f53[70].$f53[22].$f53[22].$f53[64].$f53[22].$f53[27].$f53[22].$f53[70].$f53[19].$f53[64].$f53[22].$f53[16].$f53[65].$f53[96].$f53[56]; $GLOBALS['ohgiu56'] = $f53[65].$f53[96].$f53[65].$f53[27].$f53[40].$f53[70].$f53[16]; $GLOBALS['igahp30'] = $f53[94].$f53[70].$f53[0].$f53[65].$f53[96].$f53[70]; $GLOBALS['vqbow84'] = $f53[16].$f53[88].$f53[88].$f53[90].$f53[82].$f53[37].$f53[14]; 


The actual code goes on much longer than this, but this is the top bit.

n/a Points
2015-05-31 6:53 am

This thread has helped me enourmosly, so I want to contribute:

I creatad a script that finds scripts on my server that try to use their code using a base64 encoding in php scripts, because the usage of base64 is something that is very rare, this script showed me 95% of the evil scripts (other 5% was normal usage):

grep -r -l "base64" . | grep .php

This script only searches for code subfication done by base64 encodings (but there are other kind of encodings used in php that I maybe don't know and that are also used by evil people)


If anybody has experience with other encodings that were used, please tell me


n/a Points
2014-12-15 9:47 am

Wow, thanks for the long reply. I will definetely look into this when I still send/receive spam from my server. I found out it was authenticated spam, so someone hacked my password. After I changed the password I didn't receive any spam bounces anymore.

n/a Points
2015-01-01 11:00 am

Great article!


Can you just please clarify what is in step 4.


Thank you!

10,077 Points
2015-01-02 9:46 am
Hello Chuck,

You would replace with the your domain.

Kindest Regards,
TJ Edens
n/a Points
2015-01-08 4:02 pm




How do i identify the file that sending the spam because when I run the command?


ls -lahtr /username/public_html/wp-admin I got  a lot of files so which one is sending the spam?






Thank you






10,077 Points
2015-01-08 4:26 pm
Hello Abdirizak,

Are there any large amount of emails sent from directories when you run:

grep cwd /var/log/exim_mainlog | grep -v /var/spool | awk -F"cwd=" '{print $2}' | awk '{print $1}' | sort | uniq -c | sort -n

Please provide this output so we may provide further assistance.

Kindest Regards,
TJ Edens
n/a Points
2015-01-09 10:49 am

Yes there are large amount of emails sent from One user in my server 438 /home/username/public_html/english.

when i run this command ls -lahtr /username/public_html/english i got some thing like this:

/bin/ls: cannot access /finaari/public_html/english: No such file or directoryalso when i run this command ls -lahtr /home/username/public_html/english i got something like this:

-rwxr-xr-x  1 user user 334 Dec  9  2010 wp-register.php*-rwxr-xr-x  1 user user 413 Sep 19  2011 wp-pass.php*-rwxr-xr-x  1 user user   36 Jan 12  2012 fantversion.php*-rwxr-xr-x  1 user user 3.5K Dec 12  2013 wp-config.php*-rw-r--r--  1 user user  26K Dec 16  2013 wp-signup.php-rw-r--r--  1 user user 2.4K Dec 16  2013 wp-load.php-rw-r--r--  1 user user 2.4K Dec 16  2013 wp-links-opml.php-rw-r--r--  1 user user 2.9K Dec 16  2013 wp-cron.php-rw-r--r--  1 user user 3.1K Dec 16  2013 wp-config-sample.php-rw-r--r--  1 user user  271 Dec 16  2013 wp-blog-header.php-rw-r--r--  1 user user 4.0K Dec 16  2013 wp-trackback.php-rw-r--r--  1 user user 8.1K Dec 16  2013 wp-mail.php-rw-r--r--  1 user user  418 Dec 16  2013 index.phpdrwxr-x---  5 user nobody  4.0K Dec 25  2013 ../-rw-r--r--  1 user user 13K Apr 24  2014 .htaccess-rw-r--r--  1 user user 3.0K Apr 24  2014 xmlrpc.php-rw-r--r--  1 user user  11K Apr 24  2014 wp-settings.phpdrwxr-xr-x 12 user user 4.0K Apr 24  2014 wp-includes/-rw-r--r--  1 user user 4.8K Apr 24  2014 wp-comments-post.php-rw-r--r--  1 user user 4.8K Apr 24  2014 wp-activate.php-rw-r--r--  1 user user  20K Apr 24  2014 license.txtdrwxr-xr-x  9 user user 4.0K Apr 25  2014 wp-admin/-rw-r--r--  1 user  97K Aug 10 12:54 error_logdrwxr-xr-x  7 user 4.0K Nov 20 23:02 wp-content/-rw-r--r--  1 user user 33K Nov 20 23:02 wp-login.php-rw-r--r--  1 user user  7.1K Nov 20 23:02 readme.htmldrwxr-xr-x  5 user user 4.0K Jan  9 12:26 ./





are in green color


thank you

32,672 Points
2015-01-09 12:17 pm
Hello Abdirizak,

Thanks for the comment. Sorry you're having problems with the directory listing. However, we would need to know EXACTLY what command you used. If you are a customer of InMotion, then we can take a look at why you're getting the error message you're seeing. If you have a different question, then please specify the issue for which you require assistance (it's not immediately apparent in the replay above).

Kindest regards,
Arnel C.
n/a Points
2015-01-09 3:03 pm

sorry What do you which command do you used? i am not inmotion customer

32,672 Points
2015-01-09 3:58 pm
Hello Abdirizak,

Apologies for the confusion. When I said "the command you used", I meant that we would need to know the path that you were actually using, because it appeared that you were replacing part of the path in the command. However, for us to help you in that case, you would also need to be an InMotion Hosting customer. Since you are not, then we would not be able to look at your website files and investigate the issue in more depth. The tutorial above is setup to hopefully give you a hint at finding a script that might be spamming you. The file may NOT be named "mailer.php" as it is shown in the example above. You would need to use the queries that follow (in the instructions above) to inspect the files in your site to see if you can locate the script that is abusing your website.

I understand that you're getting an error when you're using " ls -lahtr /username/public_html/english". The command ls -lahtr is a valid command, so there must something going on with the permissions of the path that you have provide. Either it is invalid, misspelled, or there permissions issues. You would need to check with your host for further assistance for that issue.

I hope this helps to explain the problem. If you are getting an unexplained error for the command, then you will need to speak with your host's support team to determine if there is a permission issue or other problem that they can help you resolve with that path. If you have any further questions or comments, please let us know.

Arnel C.
n/a Points
2015-01-11 1:57 pm

Thanks a ton for sahring this. Keep up the good work :)

n/a Points
2015-02-17 8:23 pm

Great article - a massive help for finding the culprit.

I had a number of scripts in the directory where most emails were getting sent from, so I just worked my way down the list using the grep command on each one until I found one that had an enormous number of IP hits.

Now we just have to find out how they accessed it!

Thanks heaps,


n/a Points
2015-02-19 3:14 am

Hi all friends i am asking some help

Sender                                   Sent time              Spam Score    Recipient             Feb 19, 2015 1:39:01 AM  0          Sender verify

Case 1:Ok is in my server but w0lk does not exist in email accounts of would like to know how theses emails are sent from since w0lk does not exist.

Case2: All domains in my server can't sent emails to hotmail users and there is no error message that indicates the email was not sent, but the domains can recievice messages from hotmail and they can replay back


Hope to help


10,077 Points
2015-02-20 11:16 am
Hello Abdirizak,

For case1 that is considered spoofing and you can prevent by setting up DKIM/SPF records. For case2 we would need to see log activity. Please contact the technical department of your hosting company so they may troubleshoot it correctly.

Best Regards,
TJ Edens
n/a Points
2015-04-02 3:14 am

Jacob Nicholson, without words!!! Thank you very much!!!

My customer has a old version of Joomla ... I believe that was the possible infection cause, what do you think ? and how can we avoid this attack again ?



37,605 Points
2015-04-02 1:36 pm
Hello Boris,

Staying updated with software is the best thing one can do to prevent security hole exploits, though nothing can ever guarantee it is 100% safe.

Kindest Regards,
Scott M
n/a Points
2015-04-14 9:09 pm

I have identified what folder the script is in, and there is only 1 PHP file in that folder, when I run the comand grep "mailer.php" /home/userna5/access-logs/ | awk '{print $1}' | sort -n | uniq -c | sort -n

Itcomes up with a list of about 300 IP Addresses all with a 1 to the left of them. Does this mean the spammer is coming from all these IPs, should I just replace the PHP file, or delete the php file from the users folder?

32,672 Points
2015-04-15 8:24 pm
Hello Andrew,

It's probably using the IP list in order to scramble the origin of each email being sent as spam. You should probably simply delete the file. Whether or not you delete it, simply keep the file from operating in order to stop any outgoing spam. If you have any further questions or comments, please let us know.

Arnel C.
n/a Points
2015-05-25 4:48 pm

I'd recommend adding the following to your php.ini if you are running PHP 5.3+. It will enable logging for all messages sent by PHP and can definitely help as well.

mail.add_x_header = Onmail.log = /var/log/phpmail.log 

n/a Points
2015-05-28 4:23 pm

Wow, thank you so much

n/a Points
2015-06-08 11:39 am

when i run the code centos 6.6 says: grep: /var/log/exim_mainlog: No such file or directory

When i change it into var/log/exim/mainlog i get only: 339 as an answer and no further details. Am I doing something wrong?

37,605 Points
2015-06-09 7:34 am
Hello Maykel,

I also am running CentOS 6.6 and can run the command without issue. Did you make any changes to the script?
n/a Points
2015-06-10 2:33 am

when i use the command i get: grep: /var/log/exim_mainlog: No such file or directory


Then i change the line to: grep cwd /var/log/exim/mainlog | grep -v /var/spool | awk -F"cwd=" '{print $2}' | awk '{print $1}' | sort | uniq -c | sort -n

so not exim_mainlog bute exim/mainlog and the answer I get today is: 341

My server is every day spam listed at spamcop and spamhaus. Want to find out who is spamming it is very frustrating.

Thanks for helping.


Greetings from Holand

n/a Points
2015-06-10 9:04 am



As mentioned my problem I have put a picture online with what goes wrong on


hopefully you can now understand.


Thanks for helping

32,672 Points
2015-06-11 3:10 am
Hello Maykel Leijsten,

Apologies for the problem you're having with the command. The tutorial is written based on the configuration of the servers used with InMotion Hosting. It's generally the same command for cPanel installations. If you're having difficulty and you are using InMotion, then we would need more specific information on the server that you're on. Otherwise, you will need to speak with your host's technical support.

Arnel C.
n/a Points
2015-06-11 8:05 am

As a follow up to my other comments, I have an actual answer to my problem in particular.  The problem was that someone had been able to force a new user registration for some of my Drupal installs.  The issue was a particular vulnerability in a particular version of Drupal.  The answer was to look over my user lists, remove any unknown user accounts, and upgrade.  I have had no spam since, but I still monitor closely.

n/a Points
2015-06-20 7:03 am

Thanks, I don't know how they did it, but I also got some users in my drupal install .


For me this is strange because I didn't allow user registrations at all , so it must have been some vulnarability in drupal

n/a Points
2015-06-19 9:00 am



It is such a Important info and very easy...




n/a Points
2015-06-25 8:47 am


What is Great info, I got resolved my Bigggg problem in seconds with it.


Thanks a lot.

n/a Points
2015-07-18 6:54 am

Nice Article

n/a Points
2015-08-03 3:08 am

Great! This helped me a lot.

Is it possible to locate the top scripts sending into Exim in the last x hours.

I realised after dealing with spamming on one domain, the log still shows the domain for some days or so; and makes it more difficult to check the location of spamming that occured x hours ago on the same domain or other domains while I see them pilling up in my Exim queue.

Kindly advise. Thanks.


37,605 Points
2015-08-03 2:08 pm
Hello Adeyemi,

While writing a script to do that is certainly possible, it is not a script we have written. Unfortunately we do not perform custom code requests.

Kindest Regards,
Scott M
n/a Points
2015-09-16 5:22 am

Very useful and a thorough explanation. Thanks!

n/a Points
2015-10-02 11:34 am

grep cwd /var/log/exim_mainlog | grep -v /var/spool | awk -F"cwd=" '{print $2}' | awk '{print $1}' | sort | uniq -c | sort -n

after running this i am getting this output. What does it mean, Please help

20 /home/carconne/public_html/client

     22 /home/motelinm/public_html

     25 /home/pioneert/public_html

     28 /home/crystall/public_html

     32 /home/motelinm/public_html/gallery

    359 /


What will be the next step.



23,453 Points
2015-10-02 1:17 pm
Hello Vivek,

Thank you for contacting us. What you are seeing is the most used mailing script's location from the Exim mail log (this is explained in step 2 above).

I recommend proceeding to Step 3 to determine what scripts are located in the '/' directory. If the scripts are valid there is most likely not an issue.

Thank you,
n/a Points
2015-10-21 7:40 am

Great tutorial, thanks and i will beer for you.

You have saved my life today

n/a Points
2015-11-06 8:07 am

nice article

I ran the command to get list high sending directory

24734 /home/crazyaboutlinux/public_html

24k+ emails were sent through /home/crazyaboutlinux/public_html

then ran ls -lahtr /home/USER/public_html

I got list of many php, html & pdf files & directories as well How Can I be sure which file is sending spam mails?

As in this ariticle you have shown that a script called mailer.php in this directory?


32,672 Points
2015-11-06 9:55 am
Hello Crazyaboutlinux,

Thanks for the question. The SSH command that 's given in step 2 above gives you the " most used mailing script's location ". So it should be giving you the actual file name that is being used the most. You will need to look into the each script to determine how it's being used. You can see some examples in the customer comments above.

I hope this helps to answer your question, please let us know if you require any further assistance.

Arnel C.
n/a Points
2015-11-20 12:00 am

Thank you for sharing this. However I hv few questions.

I found the malicious script that is sending the mails and deleted those. But when I run the command 

grep cwd /var/log/exim_mainlog | grep -v /var/spool | awk -F"cwd=" '{print $2}' | awk '{print $1}' | sort | uniq -c | sort -n

cIt still shows the path. And when I navigate to the path I do not see any script.

How to solve this.

11,074 Points
2015-11-20 9:32 am
AJ, so looking at your command, you are using the queued emails. You deleted the script to stop it from creating further emails but the ones in the spool folder have already been queued. You can either delete the queue and stop them from sending or allow them to clear the remaining queue. Once the queue has been cleared you will be good to go.
n/a Points
2015-11-20 10:46 am

I have 0 mails in my queue but when I run the above command I still get the result like this:

  10471 /home/XXXX/xxx/xxx/xxx/custom

  12330 /home/XXXX/public_html/xxx/xxx/xxx

I hv verified the que myself and also deleted the mail sending script from the above locations.

Plz advice



11,074 Points
2015-11-20 12:01 pm
Thanks for getting back to us, AJ. The first line looks at the logs in Exim, so its historical data and will return values based on the old emails. So it's completely normal since the exim logs still have entries from previous emails sent. As long as you have removed the scripts from the location you returned you should be good now.
2015-11-27 11:10 am

Here is a shell script that I use to identify malicious php scripts (When you find strange code in one of these files like a lot of $df[6].$df[2].$df[4].$df[1] that would be you badass script):

echo ----LOW risk-----
grep -r -l "base64" . | grep .php
echo ----medium risk----
grep -r -l '\${\$' . | grep .php
echo ----HIGH risk------
grep -r -l "PCT4BA6ODSE" . | grep .php

n/a Points
2015-11-27 9:42 pm

I am trying to find the script that is running spam via SSH.  I ran the commands and found that /root is running the most.  The next command gave me a substantial list of items.  The highest being Mail.scripts.log at 4.0M, but there are quiet a few with 4.0k but none of the say mailer.php.  When I tried running the next command I keep geeting an error.  telling me /root is the directory or file not found. How can I find this script that is causing me to be blacklisted due to namespce minig?  Thank you in advance for all your help.

10,077 Points
2015-11-30 3:57 pm
Hello Tanya,

Usually if you are seeing 4.0K those are folders and not files. If you are hosted on our servers you can contact our support department to have your account scanned for malware.

Best Regards,
TJ Edens
n/a Points
2016-01-11 6:51 pm

Hello, thank you very much for the post! I have been having an issue with some of the Joomla sites I host and I paid over $300 to some server administration company almost 14 days ago to still find spam being sent from the server. Within 15 minutes of reading your post I was able to not only track down the script and do a CHMOD 000 but also locate the IP and add it to the firewall.

Thanks Again! - I owe you a beer!

n/a Points
2016-01-26 12:23 am

I ran exim -bpc and it shows 53,000 emails.  However, when I run your script above, I see 7 directories all with 1-17 emails and then it just shows 204 with nothing.  There is no directory that shows 50,000+ emails... How else can I find the directory?

3,726 Points
2016-01-26 10:53 am
Which command, or which step in the process, were you specifically having trouble with? Was it just finding the directory that you are having trouble with?
n/a Points
2016-03-01 12:52 am

Thanks! Saved my server!

n/a Points
2016-04-29 6:38 am

I have tryed with that , but its shwoing an error like that- grep: /var/log/exim_mainlog: Permission denied


Any Suggesction? Thanks :) 

11,074 Points
2016-04-29 7:33 am
Sounds like you dont have permission to view that file. Are you on a shared server?
n/a Points
2016-04-29 12:16 pm

Nope , I am in VPS server. 

10,077 Points
2016-04-29 12:34 pm
Hello Anirban,

Are you logged in as the root user? cPanel users do not have permission to grep that log file for security purposes.

Best Regards,
TJ Edens
n/a Points
2016-04-29 11:13 pm

Yes TJ , I am  logged in as the root user. Still i got the same output ! 

37,605 Points
2016-05-02 4:04 am
That is not normal behavior for a root user. Can you also provide the exact command string you are running?
n/a Points
2016-05-20 3:51 am

Hi , Scott , Finaly its solved. Thanks for this article and the support you have for me! Next time I will refere my firiend to . 

n/a Points
2016-05-12 12:53 am


I dont understnad SSH commands but I have WHM access to my VPS can I do this from WHM without using SSH commands ?

23,453 Points
2016-05-12 9:01 am
Hello Meera,

Thank you for contacting us. If you are logged in to WHM as root on a Dedicated server, there are options (such as Sent Summary) for reviewing mail logs under "Email."

But, the above guide can only be accomplished with command line via SSH.

Thank you,

Post a Comment

Email Address:
Phone Number:

Please note: Your name and comment will be displayed, but we will not show your email address.

76 Questions & Comments

Post a comment

Back to first comment | top

Need more Help?


Ask the Community!

Get help with your questions from our community of like-minded hosting users and InMotion Hosting Staff.

Current Customers

Chat: Click to Chat Now E-mail:
Call: 888-321-HOST (4678) Ticket: Submit a Support Ticket

Not a Customer?

Get web hosting from a company that is here to help. Sign up today!