call the function sanitize_address with arguments email_message.from_email and email_message.encoding, substitute the result for from_email.
from_email = sanitize_address ( email_message . from_email , email_message . encoding )