automatic
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"D100": "126ebae8fc65d7ae19c9fe14e755c6421152aac16b19abf7fafeaa34aa87cafe",
|
||||
"D100": "27cf97a4d10c8529669d95b2d96ca3c9b41f7e4e50091dce19cf8af117f0ac4a",
|
||||
"D101": "f72fc1c29657ea11e0238806a28f6abccf5b00e45904e1e0c9385cc64491fcaf",
|
||||
"D300": "cb7b55b568ab893024884971eac0367fb6fe487c297e355d64258dae437f6ddd",
|
||||
"D394": "c4c4e62bda30032f12c17edf9a5087b6173a350ccb1fd750158978b3bd0acb7d",
|
||||
|
||||
@@ -62,7 +62,7 @@ valabil începand cu
|
||||
01/2024 - publicat în data de 09.02.2024
|
||||
soft A
|
||||
actualizat în data de
|
||||
22.05.2026
|
||||
29.05.2026
|
||||
soft J*
|
||||
actualizat în data de
|
||||
25.05.2026
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"D100": {
|
||||
"soft_a_url": "http://static.anaf.ro/static/10/Anaf/Declaratii_R/AplicatiiDec/D100_710_XML_0126_220526.pdf",
|
||||
"soft_a_date": "22.05.2026",
|
||||
"soft_a_url": "http://static.anaf.ro/static/10/Anaf/Declaratii_R/AplicatiiDec/D100_710_XML_0126_290526.pdf",
|
||||
"soft_a_date": "29.05.2026",
|
||||
"soft_j_url": "http://static.anaf.ro/static/10/Anaf/Declaratii_R/AplicatiiDec/D100_22052026.zip",
|
||||
"soft_j_date": "22.05.2026"
|
||||
},
|
||||
|
||||
@@ -47,7 +47,7 @@ def get_owner_jid() -> str:
|
||||
return f"{owner}@s.whatsapp.net"
|
||||
|
||||
|
||||
def fetch_unread_emails() -> list[dict]:
|
||||
def fetch_unread_emails(skip_whitelist: bool = False) -> list[dict]:
|
||||
"""Preia emailurile necitite din inbox fără a salva KB notes."""
|
||||
mail = imaplib.IMAP4_SSL(IMAP_SERVER, IMAP_PORT)
|
||||
mail.login(IMAP_USER, IMAP_PASS)
|
||||
@@ -66,7 +66,7 @@ def fetch_unread_emails() -> list[dict]:
|
||||
from_addr = decode_mime_header(msg['From'])
|
||||
sender_email = extract_sender_email(from_addr)
|
||||
|
||||
if sender_email not in WHITELIST:
|
||||
if not skip_whitelist and sender_email not in WHITELIST:
|
||||
continue
|
||||
|
||||
attachment_data = {}
|
||||
@@ -197,7 +197,7 @@ def send_whatsapp_document(to: str, filename: str, data: bytes) -> bool:
|
||||
|
||||
def run_digest():
|
||||
print("Verific emailuri necitite...")
|
||||
emails = fetch_unread_emails()
|
||||
emails = fetch_unread_emails(skip_whitelist=True)
|
||||
|
||||
owner_jid = get_owner_jid()
|
||||
|
||||
|
||||
@@ -151,7 +151,7 @@ def send_whatsapp_document(to: str, filename: str, data: bytes) -> bool:
|
||||
return False
|
||||
|
||||
|
||||
def fetch_unread_emails():
|
||||
def fetch_unread_emails(skip_whitelist: bool = False):
|
||||
"""Preia emailurile necitite din inbox fără a le salva sau marca ca citite."""
|
||||
mail = imaplib.IMAP4_SSL(IMAP_SERVER, IMAP_PORT)
|
||||
mail.login(IMAP_USER, IMAP_PASS)
|
||||
@@ -171,7 +171,7 @@ def fetch_unread_emails():
|
||||
from_addr = decode_mime_header(msg['From'])
|
||||
sender_email = extract_sender_email(from_addr)
|
||||
|
||||
if sender_email not in WHITELIST:
|
||||
if not skip_whitelist and sender_email not in WHITELIST:
|
||||
continue
|
||||
|
||||
# Extract attachment data (name → bytes)
|
||||
@@ -216,7 +216,7 @@ def mark_as_seen(email_ids: list[str]) -> None:
|
||||
|
||||
def run_forward():
|
||||
print("Verific emailuri necitite...")
|
||||
emails = fetch_unread_emails()
|
||||
emails = fetch_unread_emails(skip_whitelist=True)
|
||||
|
||||
owner_jid = get_owner_jid()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user