Main image
19th January
2011
written by Ranjeesh

The other day at work we had a request from the client to send an e-blast (mass e-mail) to all the email addresses listed in our database (~55k emails).

In the past this was done using a procedure in the oracle database which used one of our smtp mail servers and oracle UTL_SMTP package. But due to a missing smtp mail server we could not run the procedure. We tried changing the mail server ip from a non-working one to a working one, but this didnt work. We kept getting an error that said

ORA-24247 network access denied by access control list (ACL)

As this was a time critical task and we did not have time to figure out where the missing server went, I created a PHP script that retrieves the email addresses from the oracle database and sends the message to all of them one by one using the mail() method in PHP. This when tested worked great. I estimated the script runtime to be 4 hours. I started the script at 630 PM and came back next morning and it was still running!

The script had already sent 50 – 300 messages to each recipient by then. To stop the php script I stopped the PHP page which was running all night. This did NOT stop the script in the backend. To stop the mailing process I went through google and figured out that the mail() process used the sendmail service on the redhat server. So I manually stopped the sendmail service which stopped the mails from sending.

I then asked the network administrator to check if there were any mails in the SMTP server queue. There were 1000s of messages in queue. I requested him to stop all the messages in the queue but the messages with RETRY status could not be stopped. There was a unapplied patch that needed to be run to make this work. At least the mails was not sending the mail but stuck at the queue.

After 3 days when I restarted the sendmail service on the server, it resumed sending the messages to all the recipients in the queue. This increased concerns. I then researched a little bit more and came to know that the sendmail service in redhat has its own mail queue which can be viewed using the mailq command in linux or using the sendmail –v -q command. There were 181k messages in queue waiting to be sent. All the queueud messages were stored in the folder /var/spool/mqueue. (Reference)

To delete all the messages in queue I ran the command rm /var/spool/mqueue but this didn’t work and gave me an error. “/bin/rm: Argument list too long” . This was probably due to the limitations of rm command to have a length of arguments as a max of 1024. The alternate command (reference) to delete all the 181k files is “find . -name ‘*’ | xargs rm”. This deletes all the files in the current directory regardless of the number of files.

This way the spooled messages were cleared from the queue but the problem the database procedure not able to access the mail server still existed. So I went through various google articles referring to the ORA-24247 error. I came to know that this error was due to an extra security layer in oracle 11g. There is an XML table in  the oracle 11g database that tells the packages about particular accessible server ips. This article helped me out in understanding the extra security ACL list information and updating it to serve my purpose.

This way I fixed the oracle script access to the smtp server and solved the mailq problem with the e-blast messaging project. Just shared it to help others fix this problem if the come across it.

39 Comments

  1. 03/08/2011

    Purchase@Acai.Online” rel=”nofollow”>…

    Buynow…

  2. 06/08/2011

    Cheap@Generic.Accutane” rel=”nofollow”>.…

    Buygeneric drugs…

  3. 09/08/2011

    Buy@Acomplia.Online” rel=”nofollow”>.…

    Buynow it…

  4. 09/08/2011

    Buy@Discount.Acomplia” rel=”nofollow”>.…

    Buygeneric meds…

  5. 09/08/2011

    Order@Cheap.Acomplia” rel=”nofollow”>.…

    Buyno prescription…

  6. 11/08/2011

    Order@Generic.Actos” rel=”nofollow”>..

    Buygeneric meds qmo…

  7. RAY
    12/08/2011

    Cheap@Generic.Actos.15mg.30mg” rel=”nofollow”>.

    Buygeneric drugs zfk…

  8. 12/08/2011

    Order@Cheap.Acular” rel=”nofollow”>..

    Buygeneric pills zdg…

  9. 12/08/2011

    Purchase@Adalat.Online” rel=”nofollow”>.

    Buyno prescription luw…

  10. 13/08/2011

    Purchase@Cheap.Abana” rel=”nofollow”>…

    Buywithout prescription xiu…

  11. 13/08/2011

    Purchase@Generic.Abilify” rel=”nofollow”>..

    Buygeneric drugs krg…

  12. 14/08/2011

    Cheap@Acai.Without.Prescription” rel=”nofollow”>…

    Buydrugs without prescription jlg…

  13. 15/08/2011

    Buy@Discount.Energy.Boost” rel=”nofollow”>.

    Buygeneric drugs itj…

  14. 16/08/2011

    Buy@Discount.Accutane” rel=”nofollow”>.

    Buygeneric drugs nih…

  15. 16/08/2011

    Order@Cheap.Accutane” rel=”nofollow”>..

    Buyno prescription tao…

  16. 17/08/2011

    Buy@Accutane.10mg.20mg” rel=”nofollow”>…

    Buynow it zdg…

  17. 21/08/2011

    Buy@Cheap.Actonel” rel=”nofollow”>…

    Buydrugs without prescription vrg…

  18. 21/08/2011

    Cheap@Actonel.Online” rel=”nofollow”>..

    Buydrugs without prescription faj…

  19. 21/08/2011

    Get@Actonel.Online” rel=”nofollow”>..

    Buygeneric drugs ajd…

  20. 23/08/2011

    Purchase@Advair.Online” rel=”nofollow”>..

    Buyno prescription jui…

  21. 23/08/2011

    Buy@Generic.Advair” rel=”nofollow”>.

    Buygeneric drugs ouw…

  22. 23/08/2011

    Buy@Advair.Without.Prescription” rel=”nofollow”>.

    Buygeneric drugs hwi…

  23. 23/08/2011

    Order@Advair.Without.Prescription” rel=”nofollow”>.

    Buyit now ojb…

  24. 23/08/2011

    Cheap@Generic.Advair” rel=”nofollow”>.

    Buydrugs without prescription xab…

  25. 25/08/2011

    Purchase@Cheap.Albenza” rel=”nofollow”>…

    Buyit now knc…

  26. 28/08/2011

    accutane@verdict.buy” rel=”nofollow”>..

    Buydrugs without prescription…

  27. 28/08/2011

    allopurinol@atrial.fibrillation” rel=”nofollow”>.

    Buygeneric pills…

  28. 17/10/2011

    norvasc and theophylline

    Buy_drugs without prescription…

  29. 17/10/2011

    c-section scar pain symptoms pregnancy

    Buy_generic drugs…

  30. 18/10/2011

    over the counter birth control

    Buy_generic meds…

  31. RAY
    20/10/2011

    birth control pills for pms symptoms

    Buy_drugs without prescription…

  32. 03/11/2011

    sandwich elisa for hepatitis b

    Buy_generic meds…

  33. 04/11/2011

    colon cancer lymph node

    Buy_without prescription…

  34. 04/11/2011

    cipro for sinus infection

    Buy_generic meds…

  35. 05/11/2011
  36. 08/11/2011

    seed implant for prostate cancer

    Buy_drugs without prescription…

  37. 10/11/2011

    adult male wheezing new onset

    Buy_drugs without prescription…

  38. 16/11/2011
  39. JIM
    17/11/2011

    children during the depression

    Buy_drugs without prescription…

Leave a Reply