TheChyeahhh opened a new pull request, #67748:
URL: https://github.com/apache/airflow/pull/67748

   ## Description
   
   When using `ImapHook.download_mail_attachments`, attachments with identical 
filenames are silently overwritten, causing data loss. This PR adds an 
`overwrite_file` parameter to control how filename collisions are handled.
   
   ### Changes
   
   1. **New `overwrite_file` parameter** on `download_mail_attachments` 
(default: `True` to preserve existing behavior)
   2. When `overwrite_file=False`, duplicate filenames are saved with unique 
suffixes (`_1`, `_2`, etc.) before the file extension
   3. New helper method `_make_unique_filename` for clean suffix generation
   4. Unit tests for all scenarios: default behavior, explicit `True`, `False`, 
multiple duplicates, and files without extensions
   
   ### Related
   
   Closes #65870


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to