Web Hosting Forums

Results 1 to 3 of 3

This is a discussion on How to automate emptying spam box? in the Hosting Talk & Chit-chat forum
I would like to run a daily cron job to empty my spam box. This used to be simple when the spam box was a ...

  1. #1
    JPC Member
    Join Date
    Oct 2005
    Posts
    1

    How to automate emptying spam box?

    I would like to run a daily cron job to empty my spam box. This used to be simple when the spam box was a single file, but since the newer version, messages are stored in a database of some sort. Does anyone have a script to do this, maybe using an IMAP Perl module?

    Thanks,
    Ross Oliver

  2. #2
    Community Leader jason's Avatar
    Join Date
    Sep 2001
    Location
    Rochester, NY
    Posts
    5,884
    The new system just uses a directory with one file for each message instead of a single file with all messages.

    My five minute analysis of the setup is that the spam folder is located at /home/ACCTUSERNAME/mail/DOMAINNAME/MAILUSERNAME/.spam.

    Inside the .spam directory will be two subdirectories: cur and new. cur appears to hold any messages that your mail client has already downloaded and new appers to have mail that has just come into the server and hasn't been touched by the client yet.

    In your cron job just delete the individual files in .spam/cur and .spam/new.

    Hope this helps.

    --Jason
    Jason Pitoniak
    Interbrite Communications
    www.interbrite.com www.kodiakskorner.com

  3. #3
    Yeah, I know a LOT! Vin DSL's Avatar
    Join Date
    Mar 2003
    Location
    Arizona Uplands
    Posts
    10,661
    Quote Originally Posted by jason View Post
    My five minute analysis of the setup is that the spam folder is located at /home/ACCTUSERNAME/mail/DOMAINNAME/MAILUSERNAME/.spam
    Correct! (mostly)

    I just wanted to see if anyone was getting it yet...

    This is the code I use to empty my spam folder[s]:

    Code:
    cd  /home/ACCTUSERNAME/mail/DOMAINNAME/MAILUSERNAME/.Spam/cur && rm
    BTW, plz be uber-careful with the 'rm' command. It's a killer, literally!

    I would suggest doing testing/debugging using:

    Code:
    cd  /home/ACCTUSERNAME/mail/DOMAINNAME/MAILUSERNAME/.Spam/cur && ls
    No harm, no foul...
    DISCLAIMER Any resemblance between the views expressed above and those of the owners and operators of this system is purely coincidental. Any resemblance between these views and my own are non-deterministic. The existence of Vin DSL is questionable. The existence of views in the absence of anyone to hold them is problematic. The existence of the reader is left as an exercise in the second-order coefficient.

    No Guts, No Story! VinDSL 2010

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •