We have a Linux Server running CENTOs, Postfix, Spamassassin, Clamav and Amavis.
Spamassassin puts all the blocked spam emails at tons of /var/virusmails gunzipped files, naming them as "[url removed, login to view]" files, as for instance: "[url removed, login to view]". Because they are thousands, at the end of the day, in order to save disk space, there's a crontab Script which counts and after erase them.
Well, frequently, along the day, our helpdesk personnel, answering to phone calls, need to know if a specific email, sent to one of our users, is at this area, and if so, to tell the user in which rules the email was blocked.
So, we need a Script, probably a CGI Script, to be used only by our personnel, called at the browser, that would inspect the /var/virusmails/*.gz files, looking for the specific email(s) and list it(them) at the screen.
First, the Script will ask in a small form, the Sender email address and/or Receiver email address, and use this information to search the blocked spam emails within those /var/virusmails/*.gz files.
There's possibility, of course, of finding more than one email which match those search fields, so all of them must be listed at the screen, visually separating them by lines to make them more readable.
See one sample .gz file in attached.
1) I need the coder to fully test the Script at his computer, and if he needs something to be done as superuser at my customer's Server, tell me everything in details, so that I can do.
2) The Script must be fully commented.
Runing: Linux CENTOs, Apache, Sendmail / Postfix, SpamAssassin, Mailscaner / Amavis