ImapAttachmentToS3Operator

Amazon

Transfers a mail attachment from a mail server into s3 bucket.

View on GitHub

Last Updated: Oct. 23, 2022

Access Instructions

Install the Amazon provider package into your Airflow environment.

Import the module into your DAG file and instantiate it with your desired params.

Parameters

imap_attachment_nameRequiredThe file name of the mail attachment that you want to transfer.
s3_bucketRequiredThe targeted s3 bucket. This is the S3 bucket where the file will be downloaded.
s3_keyRequiredThe destination file name in the s3 bucket for the attachment.
imap_check_regexIf set checks the imap_attachment_name for a regular expression.
imap_mail_folderThe folder on the mail server to look for the attachment.
imap_mail_filterIf set other than ‘All’ only specific mails will be checked. See imaplib.IMAP4.search() for details.
s3_overwriteIf set overwrites the s3 key if already exists.
imap_conn_idThe reference to the connection details of the mail server.
aws_conn_idAWS connection to use.

Documentation

Transfers a mail attachment from a mail server into s3 bucket.

See also

For more information on how to use this operator, take a look at the guide: Imap Attachment To Amazon S3 transfer operator

Was this page helpful?