#] #] ********************* #] loaddefs link d_Qndfs 'virus - remove emails with virus.ndf' - scans dir of emails, moves contaminated #] finds the one with virus(es) # www.BillHowell.ca 29Mar2021 initial, # based on : # 'email - split Thunderbird email folder.ndf' # 'emails - generic optrs.ndf' # view this file in a text editor, with [constant width font, tab = 3 spaces], no line-wrap # 29Mar2021 - unfinished and becaouseo f bash script, probably un-needed f_emailsWithVirus := 'virus - find emails with virus.ndf' ; loaddefs_start f_emailsWithVirus ; #**************************** # List of operators, generated with : # $ cat "$d_Qndfs""virus - find emails with virus.ndf" | grep "^#]" | sed 's/^#\]/ /' # #*********** # Setup (kind of like header info) loaddefs link d_Qndfs 'emails - generic optrs.ndf' ; d_virus := '/media/bill/Virus_samples/' ; #***************************** #] +-----+ #] Virus optrs IF flag_debug THEN write '+-----+' ; ENDIF ; IF flag_debug THEN write 'Virus optrs' ; ENDIF ; IF flag_debug THEN write 'loading scan_emails' ; ENDIF ; #] scan_emails IS OP d_emailTxts - run clamscan on email text files in d_emailTxts # follows or folder_split_emails in 'emails - generic optrs.ndf' IF flag_break THEN BREAK ; ENDIF ; scan_emails IS OP d_emailTxts { LOCAL finn keyStr last_3lines p_fldrSrc p_splitFolder ; NONLOCAL email_filter_phrase FAQFolderList folderCountsALL keyCountsALL keyStrsALL d_log p_log p_emlOner p_fldrTwix p_fldrTmp ; % ; host link 'bash "' d_bin 'virus - clamscan.sh' '"$d_temp""emails/"' '"/media/bill/Virus_samples/infected/"' ; % ; } # loaddefs link d_Qndfs 'virus - find emails with virus.ndf' IF flag_debug THEN write 'loading save_emails' ; ENDIF ; #] save_emails IS - run clamscan on email files, # based on emailSplit_folder in 'email - split Thunderbird email folder.ndf' IF flag_break THEN BREAK ; ENDIF ; save_emails IS { LOCAL finn keyStr last_3lines p_fldrSrc p_splitFolder ; NONLOCAL email_filter_phrase FAQFolderList folderCountsALL keyCountsALL keyStrsALL d_log p_log p_emlOner p_fldrTwix p_fldrTmp ; % ; } #**************************** # Instructions # 1. loaddefs link d_Qndfs 'virus - find emails with virus.ndf' # 2. re-scan rebuilt email folders # loaddefs_ended f_emailsWithVirus ; # enddoc