A bzBond-server microbond to download email attachments via IMAP.
On macOs/Linux use the following command to install this Microbond:
/var/www/bzbond-server/bin/install-microbond.sh bzmb-emailattachmentdownloader https://github.com/beezwax/bzmb-emailattachmentdownloader
On Windows Server use the following command to install this Microbond:
powershell -File "C:\Program Files\bzBond-server\bin\install-microbond.ps1" bzmb-emailattachmentdownloader https://github.com/beezwax/bzmb-emailattachmentdownloader
On macOs/Linux use the following command to install this Microbond via a proxy:
/var/www/bzbond-server/bin/install-microbond.sh bzmb-emailattachmentdownloader https://github.com/beezwax/bzmb-emailattachmentdownloader http://proxy.example.com:443
On Windows Server use the following command to install this Microbond via a proxy:
powershell -File "C:\Program Files\bzBond-server\bin\install-microbond.ps1" -Proxy http://proxy.example.com:443
The bzmb-emailattachmentdownloader Microbond provides one route
In a server-side FileMaker script run bzBondRelay
script with parameters in the following format:
{
"mode": "PERFORM_JAVASCRIPT",
"route": "bzmb-emailattachmentdownloader-getAttachments",
"customMethod": "POST",
"customBody": {
// Required. The imap config object. See https://imapflow.com/module-imapflow-ImapFlow.html#ImapFlow for details
"imapConfig": object,
// Optional. The mail folder to move processed emails to
"processedFolder": "string",
// Optional. Also process read mails in the Inbox. Default is false
"includeRead": boolean,
// Optional. Do not mark emails as read or move them. Default is false
"readOnly": boolean
}
}
The attachments and filenames can be accessed in a JSON array via Get ( ScriptResult )
:
JSONGetElement ( Get ( ScriptResult ); "response.result" )
In a server-side FileMaker script run bzBondRelay
script with parameters in the following format:
{
"mode": "PERFORM_JAVASCRIPT",
"route": "bzmb-emailattachmentdownloader-getMessagesWithAttachments",
"customMethod": "POST",
"customBody": {
// Required. The imap config object. See https://imapflow.com/module-imapflow-ImapFlow.html#ImapFlow for details
"imapConfig": object,
// Optional. The mail folder to move processed emails to
"processedFolder": "string",
// Optional. Also process read mails in the Inbox. Default is false
"includeRead": boolean,
// Optional. Do not mark emails as read or move them. Default is false
"readOnly": boolean
}
}
The messages with attachments can be accessed in a JSON array via Get ( ScriptResult )
:
JSONGetElement ( Get ( ScriptResult ); "response.result" )