mail_purger.c

tmi2_fluffos_v2/lib/adm/obj/mail_purger.c · 675 B

From the archive tmi2_fluffos_v2.zip

Download the archive   « Back to the archive contents

#include <mailer.h>
#define NUKE_FILE    "/adm/etc/purged_characters"

mapping	my_groups;
mapping	*mailbox;


void nuke_mailboxes(string* names);

create(){
  mixed names;
  seteuid(getuid());
  if( file_exists( NUKE_FILE ) )
    catch(names = explode(read_file(NUKE_FILE),"\n"));
  if(names)
    nuke_mailboxes(names);
}

void nuke_mailboxes(string* names){
  int i,j;
  string mbox;

  i = sizeof(names);
  while(i--){
    reset_eval_cost();
    mbox = user_mbox_file(names[i]) + __SAVE_EXTENSION__;
    j = sizeof(mailbox);
    while(j--){
      MAILMESG_D->delete_mesg(mailbox[j]["idx"], names[i]);
      reset_eval_cost();
    }
    rm(mbox);
  }
  rm(NUKE_FILE);
}




Site Stats

Snippets: 1791
Codebases: 571