{
    "__documentation": {
        "__format": "Las reglas siguen el siguiente formato:",
        "action": "Tipo de acción: replace, remove_line, remove_block, add_before, add_after",
        "pattern": "Patrón a buscar - puede ser texto o regex",
        "priority": "Orden de ejecución (menor número = mayor prioridad)",
        "replacement": "Texto que reemplazará al patrón (puede estar vacío)",
        "type": "Cómo interpretar el patrón: string, regex, left, right, substring"
    },
    "__examples": {
        "add_after": "Agrega después: inserta el replacement después de la línea con el patrón",
        "add_before": "Agrega antes: inserta el replacement antes de la línea con el patrón",
        "remove_block": "Elimina bloque: elimina desde el inicio hasta el fin del patrón con .....",
        "remove_line": "Elimina línea: elimina la línea completa si encuentra el patrón",
        "replace": "Reemplaza texto: reemplaza cada coincidencia por el replacement"
    },
    "rules": [
        {
            "__comment": "Reemplaza non-breaking space por espacio normal",
            "action": "replace",
            "pattern": " ",
            "priority": 1,
            "replacement": " ",
            "type": "string"
        },
        {
            "__comment": "Elimina marcador de mensaje original",
            "action": "remove_line",
            "pattern": "--- Messaggio originale ---",
            "priority": 2,
            "replacement": "***",
            "type": "substring"
        },
        {
            "__comment": "Elimina firma de dispositivo móvil",
            "action": "remove_line",
            "pattern": "(?m)^Sent from my.*$",
            "priority": 2,
            "replacement": "",
            "type": "regex"
        },
        {
            "__comment": "Elimina aviso medioambiental",
            "action": "remove_line",
            "pattern": "(?m)^Please take care of the environment.*$",
            "priority": 2,
            "replacement": "",
            "type": "regex"
        },
        {
            "__comment": "Elimina aviso de mensaje automático",
            "action": "remove_line",
            "pattern": "(?m)^This message is from an.*$",
            "priority": 2,
            "replacement": "",
            "type": "regex"
        },
        {
            "__comment": "Elimina aviso de confidencialidad en italiano",
            "action": "remove_line",
            "pattern": "eventuali allegati sono confidenziali",
            "priority": 2,
            "replacement": "",
            "type": "substring"
        },
        {
            "__comment": "Elimina aviso de confidencialidad en inglés",
            "action": "remove_line",
            "pattern": "any attachments are confidential",
            "priority": 2,
            "replacement": "",
            "type": "substring"
        },
        {
            "__comment": "Elimina solicitud de LinkedIn",
            "action": "remove_line",
            "pattern": "Please sign up on our Linkedin",
            "priority": 2,
            "replacement": "",
            "type": "left"
        },
        {
            "__comment": "Elimina aviso de no compartir contenido",
            "action": "remove_line",
            "pattern": "di non copiare o condividere i contenuti con nessuno",
            "priority": 2,
            "replacement": "",
            "type": "substring"
        },
        {
            "__comment": "Elimina líneas de email individual",
            "action": "remove_line",
            "pattern": "(?m)^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$",
            "priority": 2,
            "replacement": "",
            "type": "regex"
        },
        {
            "__comment": "Elimina líneas con múltiples emails",
            "action": "remove_line",
            "pattern": "(?m)(?:^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}\\s*(?:;\\s*)?$|^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}\\s*;\\s*[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}.*$)",
            "priority": 2,
            "replacement": "",
            "type": "regex"
        },
        {
            "__comment": "Elimina línea de teléfono",
            "action": "remove_line",
            "pattern": "Phone:",
            "priority": 2,
            "replacement": "",
            "type": "left"
        },
        {
            "__comment": "Elimina línea de móvil",
            "action": "remove_line",
            "pattern": "Mobile:",
            "priority": 2,
            "replacement": "",
            "type": "left"
        },
        {
            "__comment": "Elimina línea de CC",
            "action": "remove_line",
            "pattern": "Cc:",
            "priority": 2,
            "replacement": "",
            "type": "left"
        },
        {
            "__comment": "Elimina línea de destinatario (italiano)",
            "action": "remove_line",
            "pattern": "A:",
            "priority": 2,
            "replacement": "",
            "type": "left"
        },
        {
            "__comment": "Elimina línea de destinatario",
            "action": "remove_line",
            "pattern": "To:",
            "priority": 2,
            "replacement": "",
            "type": "left"
        },
        {
            "__comment": "Agrega separador antes del asunto",
            "action": "add_before",
            "pattern": "Subject: ",
            "priority": 3,
            "replacement": "***",
            "type": "left"
        },
        {
            "__comment": "Elimina firma corporativa",
            "action": "remove_block",
            "pattern": "Strada Isolanda.....Website:www.vetromeccanica.it",
            "priority": 4,
            "replacement": "",
            "type": "string"
        },
        {
            "__comment": "Elimina aviso legal largo",
            "action": "remove_block",
            "pattern": "IMPORTANT NOTICE: This message may.....without retaining any copy",
            "priority": 4,
            "replacement": "",
            "type": "string"
        },
        {
            "__comment": "Elimina aviso confidencialidad (inglés ALPLA)",
            "action": "remove_line",
            "pattern": "This message is confidential and intended solely",
            "priority": 2,
            "replacement": "",
            "type": "substring"
        },
        {
            "__comment": "Elimina aviso de responsabilidad ALPLA (inglés)",
            "action": "remove_line",
            "pattern": "To the extent permitted by law ALPLA",
            "priority": 2,
            "replacement": "",
            "type": "substring"
        },
        {
            "__comment": "Elimina aviso confidencialidad (alemán ALPLA)",
            "action": "remove_line",
            "pattern": "Diese Nachricht ist vertraulich und nur",
            "priority": 2,
            "replacement": "",
            "type": "substring"
        },
        {
            "__comment": "Elimina aviso términos y condiciones ALPLA (alemán)",
            "action": "remove_line",
            "pattern": "Wir liefern und bestellen ausschließlich",
            "priority": 2,
            "replacement": "",
            "type": "substring"
        },
        {
            "__comment": "Elimina enlace GTC ALPLA",
            "action": "remove_line",
            "pattern": "alink.alpla.com/GTC",
            "priority": 2,
            "replacement": "",
            "type": "substring"
        },
        {
            "__comment": "Elimina aviso de seguridad EXTERNAL SENDER (caution)",
            "action": "remove_block",
            "pattern": "CAUTION: This message is from an EXTERNAL SENDER ..... know the content is safe!",
            "priority": 4,
            "replacement": "",
            "type": "string"
        },
        {
            "__comment": "Elimina disclaimer confidencialidad (alemán + inglés)",
            "action": "remove_block",
            "pattern": "Diese E-Mail enthält vertrauliche ..... strictly prohibited.",
            "priority": 4,
            "replacement": "",
            "type": "string"
        },
        {
            "__comment": "Tel:.....www.sidel.com",
            "action": "remove_block",
            "pattern": "Tel:.....www.sidel.com",
            "priority": 5,
            "replacement": "",
            "type": "string"
        },
        {
            "__comment": "Sidel Group.....www.sidel.com",
            "action": "remove_block",
            "pattern": "Sidel Group.....www.sidel.com",
            "priority": 5,
            "replacement": "",
            "type": "string"
        },
        {
            "__comment": "Sidel Group.....www.sidel.com",
            "action": "remove_block",
            "pattern": "Sidel Group.....43126 Parma, ITALY",
            "priority": 5,
            "replacement": "",
            "type": "string"
        },
        {
            "__comment": "This e-mail may contain confidential ..... strictly forbidden.",
            "action": "remove_block",
            "pattern": "This e-mail may contain confidential ..... strictly forbidden.",
            "priority": 5,
            "replacement": "",
            "type": "string"
        }
    ]
}