Is it possible to programmatically 'clean' emails?

后端 未结 6 1111
一向
一向 2021-01-03 08:36

Does anyone have any suggestions as to how I can clean the body of incoming emails? I want to strip out disclaimers, images and maybe any previous email text that may be als

6条回答
  •  天命终不由人
    2021-01-03 08:56

    Given your question "Is it possible to programmatically ‘clean’ emails?", I'd answer "No, not reliably".

    The danger you face isn't really a technological one, but a sociological one.

    It's easy enough to spot, and filter out, some aspects of the messages - like images. Filtering out signatures and disclaimers is, likewise, possible to achieve (though more of a challenge).

    The real problem is the cost of getting it wrong.

    What happens if your filter happens to remove a critical piece of the message? Can you trace it back to find the missing piece, or is your filtering desctructive? Worse, would you even notice that the piece was missing?

    There's a classic comedy sketch I saw years ago that illustrates the point. Two guys working together on a car. One is underneath doing the work, the other sitting nearby reading instructions from a service manual - it's clear that neither guy knows what he's doing, but they're doing their best.

    Manual guy, reading aloud: "Undo the bold in the centre of the oil pan ..." [turns page]

    Tool guy: "Ok, it's out."

    Manual guy: "... under no circumstances."

提交回复
热议问题