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) »
  • Bounce mailbox filling up
Pages: [1]

Author Topic: Bounce mailbox filling up  (Read 1653 times)

anton

  • I post occasionally
  • **
  • Posts: 30
  • Karma: 1
Bounce mailbox filling up
April 26, 2010, 09:58:34 am
I'm using CiviMail Processor to catch and filter all bounces in a designated mailbox.

This works well, however all the bounces appear in the CiviMail/processed folder of the mailbox and stay there, filling up the mailbox and causing the hosting account to go over quota. This causes problems, namely that once the quota is exceeded, the CiviMail job stops (not good in the middle of a mailing) and leaves users of the hosting account unable to access e-mail etc. I have to clean it out manually to sort it.

From what I have seen, these e-mails never actually get deleted. Can this really be the case? I'd really like to do something about it and the only thing I can think of is to run an hourly cron job that deletes everything in the mailbox, however I don't know if this would negatively affect the bounce handling (CiviMailProcessor.php runs every 10 minutes).

Any ideas, or have I got the configuration all wrong? I'm really confused and the documentation for the processor isn't very clear.

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: Bounce mailbox filling up
April 26, 2010, 12:53:27 pm

1. would be great if you could contribute a cron script that goes in and cleans "emails older than XXX days" from the processed folder where XXX is a configurable variable

2. might be good to get a much larger mailbox. disk space is quite cheap these days :)

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

anton

  • I post occasionally
  • **
  • Posts: 30
  • Karma: 1
Re: Bounce mailbox filling up
April 27, 2010, 04:21:36 am
Unfortunately
Code: [Select]
rm -rf * is about the limit of my shell prowess.

We have more than one site on the hosting account and it runs nearly to capacity, but CiviMail Processor does seem to be a bit of a disk space hog. Freeing space is tricky and upgrading the package is expensive unfortunately.

So you're saying that the script never cleans up the mailbox, the bounced mail just keeps accumulating?

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: Bounce mailbox filling up
April 27, 2010, 07:46:55 am
Quote from: anton on April 27, 2010, 04:21:36 am
So you're saying that the script never cleans up the mailbox, the bounced mail just keeps accumulating?

yes. you might want to consider hiring someone from http://civicrm.org/professional/ to write the cron script. Please do contribute back the script if you get it written so others can benefit

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

anton

  • I post occasionally
  • **
  • Posts: 30
  • Karma: 1
Re: Bounce mailbox filling up
April 27, 2010, 07:50:13 am
Will do. I know someone that may be able to do it but for now I think I'll have to do it my way.

bcobin

  • I post frequently
  • ***
  • Posts: 337
  • Karma: 9
    • InterCreative Media
  • CiviCRM version: 4.3.3
  • CMS version: Drupal 7.22
  • MySQL version: 5.5.9
  • PHP version: 5.3
Re: Bounce mailbox filling up
September 24, 2010, 01:17:41 pm
I just had a client site go down on account of this - over 500,000 files!

Subscribing here in case anyone has created a cron job that will clean out the mailbox - for now, I've deleted the 2010 folders previous to September and I suppose I'll need to check in periodically and clean these out manually.

anton

  • I post occasionally
  • **
  • Posts: 30
  • Karma: 1
Re: Bounce mailbox filling up
September 25, 2010, 12:10:18 am
The cron job I made didn't work (I think the mailboxes count as a hidden file and I can only presume that it doesn't delete them) so let me know if you find a solution!

Leo

  • I’m new here
  • *
  • Posts: 5
  • Karma: 0
  • CiviCRM version: 4.1
  • CMS version: Drupal 7.12
Re: Bounce mailbox filling up
September 25, 2010, 10:58:53 am
Hi,

Google pulled this up.
http://www.linuxquestions.org/questions/linux-general-1/shell-script-to-remove-old-files-based-on-date-7368/

If you are using a unix/linux system and the Maildir format (each email is a separate file), then commands like this might do it. It should remove all files in the two CiviMail folders that are over 5 days old. But read the whole message about what this does, especially the bit about testing first! Replace 'rm -f' with 'ls -al' and see what shows up.

Hope that helps.


Code: [Select]
find /home/mailbox_user/Maildir/.CiviMail.processed/new/ -mtime +5 -type f -exec rm -f {} \;
find /home/mailbox_user/Maildir/.CiviMail.ignored/new/ -mtime +5 -type f -exec rm -f {} \;


anton

  • I post occasionally
  • **
  • Posts: 30
  • Karma: 1
Re: Bounce mailbox filling up
September 27, 2010, 05:12:37 am
Thanks Leo, I'll take a look at it.

bcobin

  • I post frequently
  • ***
  • Posts: 337
  • Karma: 9
    • InterCreative Media
  • CiviCRM version: 4.3.3
  • CMS version: Drupal 7.22
  • MySQL version: 5.5.9
  • PHP version: 5.3
Re: Bounce mailbox filling up
September 27, 2010, 08:24:05 am
Thanks for finding this, Leo - I'm logging in via Terminal (Mac) and entering the following command:

Code: [Select]
find /home/[site]/sites/default/files/civicrm/custom/CiviMail.processed/ -mtime +5 -type f -exec ls -al
I get the following error message:

find: missing argument to `-exec'

(I'm using the "ls" command, which I assume will simply list the files in question without doing anything.)

I figured that Terminal would be the best way to verify the script works as expected, but I'm clearly out of my depth here. So any additional guidance anyone could supply here would be appreciated!

Also, while I'm at it, it would be great to get the proper formatting to set this up as a cron job, assuming we can get this to work.

Thanks to all... as always!

anton

  • I post occasionally
  • **
  • Posts: 30
  • Karma: 1
Re: Bounce mailbox filling up
September 27, 2010, 08:36:24 am

Try looking up the manpage for the find command and see what it says about the -exec switch:

Code: [Select]
man find

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviMail (Moderator: Piotr Szotkowski) »
  • Bounce mailbox filling up

This forum was archived on 2017-11-26.