Jump to content

[SOLVED] mail() stop auto send infinite loop


damerit

Recommended Posts

Help!! I'm running apache server and php and I had an e-mail script loop through a cycle of events. Well I have been getting 4 to 5 e-mails every 35 to 60 minutes for the last 72 hours.

 

Question? How do I stop the e-mails? I have removed the script and they seem to still be sending out. They are in a spool or que backed up somewhere but I'm not sure how or where. Can someone please assist?

 

sendmail_path /usr/sbin/sendmail -t -i  /usr/sbin/sendmail -t -i 

Link to comment
Share on other sites

I'm not sure what mail server it is. I know that when I get the mail it says "WWW daemon apache". I hope this helps.

 

These are some of my processes....

 

root      1787  0.0  0.9  8168  2444 ?        Ss  11:04  0:00 sshd: root@notty               

root      1790  0.0  0.5  4632  1300 ?        Ss  11:04  0:00 /usr/lib/ssh/sftp-server

mysql    1795  0.0  6.7  44248 17284 ?        S    11:04  0:03 /usr/sbin/mysqld --basedir=/ --da

root      2023  0.0  0.9  8384  2436 ?        Rs  11:23  0:00 sshd: root@pts/0               

root      2026  0.0  0.7  4088  1824 pts/0    Ss  11:23  0:00 -bash

postfix  2172  0.0  0.6  5104  1536 ?        S    12:17  0:00 pickup -l -t fifo -u

root      2347  0.0  0.3  2720  828 pts/0    R+  13:32  0:00 ps -aux

 

 

Link to comment
Share on other sites

I have removed the script 2 days ago and I'm still getting the e-mails. I just don't know how to stop the e-mail queue or service that is causing the e-mails to keep generating.

 

What I think happened is that when I added the code to the script file to generate an e-mail on every record that is > 30 days, the email queue has several emails stored up sending to my company's exchange and the exchange server is only allowing 4 or 5 at a time through. I just don't know why I am still getting them. I thought it would run its course but for 3 days and several thousand emails at increments of 4 or 5 every 30 minutes is stummping me.

 

I can't seem to stop them. This is a backup company server and I hate to restart it just for the email. There has to be a queue or something stored up.

 

 

 

 

Link to comment
Share on other sites

if the script is in a loop, deleting the original file won't do anything, as it is running from memory. 

 

do:

 

ps -aux |grep php

 

or

 

ps -aux |grep "nameofscript"

 

and see if it brings anything up.

 

Look at the emails you are getting too.  Is the 'sent time' in the header the same for all of them?  If it is, or it's very similar, then chances are the que is full.  If the sent time keeps up with the receive time, then i'd guess the script is running.

 

If this script was initiated through apache (IE a web interface), then chances are it is not still running, as it would have timed out by now

Link to comment
Share on other sites

I tried to kill the process and it gives me the "No such process". I'm just going to bite the bullet and restart the server. I hate to but I'm stuck.

 

Is there any advice from here.... thanks by the way

 

srv07:/ # ps aux|grep index.php

root      2924  0.0  0.2  1828  616 pts/0    S+  16:54  0:00 grep index.php

srv07:/ # kill -9 2924

-bash: kill: (2924) - No such process

srv07:/ #

Link to comment
Share on other sites

I tried to kill the process and it gives me the "No such process". I'm just going to bite the bullet and restart the server. I hate to but I'm stuck.

 

Is there any advice from here.... thanks by the way

 

srv07:/ # ps aux|grep index.php

root      2924  0.0  0.2   1828   616 pts/0    S+   16:54   0:00 grep index.php

srv07:/ # kill -9 2924

-bash: kill: (2924) - No such process

srv07:/ #

 

if the script was run through apache (opened in a web browser) it would have timed out already...meaning it's not in an infinite loop. 

 

srv07:/ # ps aux|grep index.php
root      2924  0.0  0.2   1828   616 pts/0    S+   16:54   0:00 grep index.php

 

is showing you that process 2924 is "grep index.php" not "index.php".  It's the PID of the grep command you just issued, not the script actually running.  Also, as far as I know, when a script is executed via the apache module, it doesn't show up as a separate process (unless it forks, and even then I'm not sure it would).  So in short... the chances of the script still running are slim to none.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.