Imap Attachment to Amazon S3¶
The ImapAttachmentToS3Operator
transfers an email attachment via IMAP
protocol from an email server to an Amazon S3 Bucket.
Prerequisite Tasks¶
To use these operators, you must do a few things:
Create necessary resources using AWS Console or AWS CLI.
Install API libraries via pip.
pip install 'apache-airflow[amazon]'Detailed information is available Installation of Apache Airflow®
Operators¶
Imap Attachment To Amazon S3 transfer operator¶
To save an email attachment via IMAP protocol from an email server to an Amazon S3 Bucket you can use
ImapAttachmentToS3Operator
task_transfer_imap_attachment_to_s3 = ImapAttachmentToS3Operator(
task_id="transfer_imap_attachment_to_s3",
imap_attachment_name=imap_attachment_name,
s3_bucket=s3_bucket,
s3_key=s3_key,
imap_mail_folder=imap_mail_folder,
imap_mail_filter="All",
)