#!/usr/bin/env python # -*- coding: utf-8 -*- import re archivo = open("mail.txt", "r") resultado = open("destino.txt","a") emails = list(set([linea.strip() for linea in archivo])) body_regex = re.compile(''' ^(?!\.) # name may not begin with a dot ( [-a-z0-9!\#$%&'*+/=?^_`{|}~] # all legal characters except dot | (?