#!hs2 #!load mailhdr.hsm # declare variables VarSet( $inboxpath, HamPath + "mails\listserv\" ) Var( $orgsubject, $orgmid, $orgdate, $orgfrom, $orgto, $orgorganization, $orgsender, $orgreplyto, $orgfirstbody, $left, $right ) # Make file-list of *.msg-files in the account given in ctrl-main.hsc VarSet( $existfiles, ListAlloc ) ListFiles( $existfiles, $inboxpath + "*.msg" , true ) # Walk through every file (while Filename) VarSet( $i, 0 ) while( $i < ListCount( $existfiles ) ) # Get filename to work with VarSet( $filename, ListGet( $existfiles, $i ) ) # call function 'mailhdr_extract' to get header-fields mailhdr_extract($orgfrom,$orgto,$orgsubject,$orgdate,$orgmid,$orgreplyto,$orgsender,$orgorganization,$orgfirstbody) # call function 'mailheadr_splitsubject' to split subject to $right and $left mailhdr_splitsubject($left,$right) # give out all variables dump # delete 'used' file - disabled here for testing # FileDelete( $filename ) # take next file from list and end while-loop inc( $i ) endwhile # free RAM ListFree( $existfiles ) quit