add source

This commit is contained in:
t0is 2025-07-25 12:27:46 +02:00
parent 0b3c452be9
commit 6a72593dd0

View File

@ -150,8 +150,8 @@ def main():
logger.info(f"Starting fetch for mailbox: {support_address}")
# Prepare upsert, now including file_path
insert_email = ("INSERT INTO emails "
"(mail_id, thread_id, subj, date_sent, user_id, sent, file_path) "
"VALUES (?, ?, ?, ?, ?, ?, ?) "
"(mail_id, thread_id, subj, source, date_sent, user_id, sent, file_path) "
"VALUES (?, ?, ?, ?, ?, ?, ?, ?) "
"ON DUPLICATE KEY UPDATE subj=VALUES(subj), updated_at=NOW(), file_path=VALUES(file_path)")
service = get_gmail_service(token_path)
@ -192,6 +192,7 @@ def main():
msg['id'],
msg.get('threadId'),
headers.get('Subject'),
support_address,
dt,
user_id,
sent_flag,