CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviMail (Moderator: Piotr Szotkowski) »
  • [solved] CiviMail cron fills up root directory with junk files
Pages: [1]

Author Topic: [solved] CiviMail cron fills up root directory with junk files  (Read 2504 times)

curious-trick

  • I’m new here
  • *
  • Posts: 29
  • Karma: 0
[solved] CiviMail cron fills up root directory with junk files
July 25, 2009, 11:33:58 am
SUMMARY

CiviCRM's CiviMail component creates a file (name of file = name of the script and the parameters used to call it) in my root (maybe home?) directory every time cron calls civimail.cronjob.php or CiviMailProcessor.php . This is a problem because my root directory now has 2000 junk files in it, and that causes a few problems with my browser and will soon violate my host's terms of service. Also, one of the files reports a CiviMail error. Read on for full report. I'm trying to take the server live by Tuesday July 28, so I really appreciate any tips to sort this out.


CONTEXT

Using Drupal 6.x in a subdirectory on HostMonster and CiviCRM 2.2.6. The site isn't live yet, so the domain isn't set (i.e. mydomain.com still points to my old production server).


EMAILS SENT BY CRON DAEMON

civimail.cronjob.php functions correctly when called by cron (according to the email that it sends), and it gives this as part of the log it emails me:

Code: [Select]
21:00:02 (0.00 B/s) - `civimail.cronjob.php?name=[my-username]&pass=[my-password]&key=[my-key].370' saved [0/0]
The
Code: [Select]
.370 appended to the end is absent from some emails and different in other emails.

CiviMailProcessor.php functions correctly according to the email, and includes this line:

Code: [Select]
14:30:07 (262.28 B/s) - `CiviMailProcessor.php?name=[my-username]&pass=[my-password]&key=[my-key]' saved [1330]
The
Code: [Select]
[1330] is the same on every email.


FILES CREATED IN ROOT DIRECTORY

Each of the CiviMail cron scripts creates a file in my root directory (not in
Code: [Select]
/public_html nor
Code: [Select]
/cms). The names of the files are:
Code: [Select]
civimail.cronjob.php?name=[my-username]&pass=[my-password]&key=[my-key]
Code: [Select]
CiviMailProcessor.php?name=[my-username]&pass=[my-password]&key=[my-key]
The file created by civimail.cronjob.php is empty. The file created by CiviMailProcessor.php contains the following:

Code: [Select]
connecting to mail.[mydomain].com, authenticating as website@[mydomain].com and selecting INBOX
<br />
<b>Fatal error</b>:  Uncaught exception 'ezcMailTransportException' with message 'An error occured while sending or receiving mail. Failed to connect to the server: mail.[mydomain].com:143.' in /[home]/[user]/public_html/cms/sites/all/modules/civicrm/packages/ezc/Mail/src/transports/transport_connection.php:97
Stack trace:
#0 /[home]/[user]/public_html/cms/sites/all/modules/civicrm/packages/ezc/Mail/src/transports/imap/imap_transport.php(358): ezcMailTransportConnection-&gt;__construct('mail.[mydomain-incomplete]...', 143, Object(ezcMailImapTransportOptions))
#1 /[home]/[user]/public_html/cms/sites/all/modules/civicrm/CRM/Mailing/MailStore/Imap.php(60): ezcMailImapTransport-&gt;__construct('mail.[mydomain-incomplete]...', NULL, Array)
#2 /[home]/[user]/public_html/cms/sites/all/modules/civicrm/CRM/Mailing/MailStore.php(61): CRM_Mailing_MailStore_Imap-&gt;__construct('mail.[mydomain-incomplete]...', 'website@[mydomain-incomplete]...', '[my-email-webmail-password]', false, NULL)
#3 /[home]/[user]/public_html/cms/sites/all/modules/civicrm/bin/CiviMailProcessor.php(60): CRM_Mailing_MailSt in <b>/[home]/[user]/public_html/cms/sites/all/modules/civicrm/packages/ezc/Mail/src/transports/transport_connection.php</b> on line <b>97</b><br />


STOPPING CREATION OF THE FILES

Is there a way to turn off the "saved" setting that's mentioned in the emails from cron? I cannot find anything relevant on the CiviCRM documentation here:
http://wiki.civicrm.org/confluence/display/CRMDOC/CiviMail+Mailer+Settings


DELETING THE FILES

I tried this cron command to automate deletion of the junk files:

Code: [Select]
rm CiviMailProcessor.php?name=[my-username]&pass=[my-password]&key=[my-key]
and got this email:

Code: [Select]
rm: cannot remove `CiviMailProcessor.php?name=[my-username]&pass=[my-password]&key=[my-key]': No such file or directory
Seems that I'm calling rm incorrectly. I'll see if the path is wrong, or I'll find a way to delete by pattern. This is just a temporary measure anyways -- I mention it in case it's a clue to the puzzle.

TIA ~ Patrick   :)
« Last Edit: July 27, 2009, 09:48:11 pm by curious-trick »

curious-trick

  • I’m new here
  • *
  • Posts: 29
  • Karma: 0
Re: CiviMail cron fills up root directory with junk files
July 25, 2009, 01:17:44 pm
Quote
I tried this cron command to automate deletion of the junk files

Found an answer to the rm file not found issue: the command worked, but there's only one file with that name and the others are name.number. So, I'll try to use the find command to remove all the junk files.

 ~ Patrick

curious-trick

  • I’m new here
  • *
  • Posts: 29
  • Karma: 0
Re: CiviMail cron fills up root directory with junk files
July 25, 2009, 01:41:04 pm
Alright, got the rm command sorted out, so at least my host won't bug me about having too many files in my root directory, and the web-based file browser won't freeze anymore since there are 2000 fewer files in the root dir.
Code: [Select]
rm -v *ivi*ail*.php?name=*
 ~ Patrick

curious-trick

  • I’m new here
  • *
  • Posts: 29
  • Karma: 0
Re: wget options and email settings
July 27, 2009, 12:17:12 pm
I posted a bug report here:
http://issues.civicrm.org/jira/browse/CRM-4789

and got this response:

Quote
Donald A. Lobo added a comment - 27/Jul/09 03:26 PM
1. please discuss on forums
2. you can tweak the options in curl/wget to prevent logging of information

I looked at the wget man page and then added the -a option to send output to a logfile, and that didn't stop the creation of new files. Any idea how to use wget options to prevent logging of info in a file and keep logging info via email?

Any thoughts on the file created by CiviMailProcessor.php? It said it failed to connect my mail host on port 143. I will look into CiviCRM / CiviMail and Hostmonster settings.

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: CiviMail cron fills up root directory with junk files
July 27, 2009, 04:11:17 pm

you might want to try using curl. personally we find it a bit easier to use and understand. Please do publish your findings back on the forum.

a failed connection typically means bad/wrong settings. You might want to double check the settings and also check with the hosting provider

lobo


A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

curious-trick

  • I’m new here
  • *
  • Posts: 29
  • Karma: 0
junk file creation solved / stopped with curl
July 27, 2009, 09:23:50 pm
switched from wget to curl, and my initial issue is SOLVED! Thank you lobo! No more junk files accumulating in my root directory, so no more need for the rm cron job. Here's the code -- it saves the most recent log so that I can diagnose CiviMailProcessor.php errors:
Code: [Select]
curl -v -o curl-log.txt --stderr - 'http://www.<mydomain>.com/cms/sites/all/modules/civicrm/bin/CiviMailProcessor.php?name=<admin-username>&pass=<admin-password>&key=<my-key>'

ken

  • I live on this forum
  • *****
  • Posts: 916
  • Karma: 53
    • City Bible Forum
  • CiviCRM version: 4.6.3
  • CMS version: Drupal 7.36
  • MySQL version: 5.5.41
  • PHP version: 5.3.10
Re: [solved] CiviMail cron fills up root directory with junk files
July 28, 2009, 10:47:54 pm
I wrote some scripts that use wget and posted them to the forum (see http://forum.civicrm.org/index.php/topic,8124.0.html).

Sounds like you've moved on from wget to curl, but there's some error-checking logic there which might reduce the number of emails you get (you'll only get an email if there is an error).

If you use and modify for curl, please post the resulting script on the forum.

Ken

MulderDSM

  • I post occasionally
  • **
  • Posts: 100
  • Karma: 0
  • CiviCRM version: 4.6.0
  • CMS version: Joomla 3.4.1
Re: junk file creation solved / stopped with curl
January 17, 2011, 07:15:57 am
Quote from: curious-trick on July 27, 2009, 09:23:50 pm
switched from wget to curl, and my initial issue is SOLVED! Thank you lobo! No more junk files accumulating in my root directory, so no more need for the rm cron job. Here's the code -- it saves the most recent log so that I can diagnose CiviMailProcessor.php errors:
Code: [Select]
curl -v -o curl-log.txt --stderr - 'http://www.<mydomain>.com/cms/sites/all/modules/civicrm/bin/CiviMailProcessor.php?name=<admin-username>&pass=<admin-password>&key=<my-key>'

I have the same issue, where do I stick this line? Is it a new CRON Job or does in go into a PHP file somewhere?

curious-trick

  • I’m new here
  • *
  • Posts: 29
  • Karma: 0
Re: junk file creation solved / stopped with curl
January 17, 2011, 05:01:26 pm
Quote from: MulderDSM on January 17, 2011, 07:15:57 am
I have the same issue, where do I stick this line? Is it a new CRON Job or does in go into a PHP file somewhere?
It's a cron job.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviMail (Moderator: Piotr Szotkowski) »
  • [solved] CiviMail cron fills up root directory with junk files

This forum was archived on 2017-11-26.