Upload email to Sent folder via IMAP
Set Variable [ $curl ; Value: MBS("CURL.New") ]
# Set URL with name of the mailbox included:
Set Variable [ $result ; Value: MBS("CURL.SetOptionURL"; $curl; CURL Test::URL & "/INBOX.Sent") ]
# We upload
Set Variable [ $result ; Value: MBS("CURL.SetOptionUpload"; $curl; 1) ]
Set Variable [ $email ; Value: CURL Test::email ]
Set Variable [ $email ; Value: MBS("Text.ReplaceNewline"; $email; 3) ]
Set Variable [ $result ; Value: MBS("CURL.SetInputText"; $curl; $email; "UTF-8") ]
# your credenticals
Set Variable [ $result ; Value: MBS("CURL.SetOptionPassword"; $curl; CURL Test::Password) ]
Set Variable [ $result ; Value: MBS("CURL.SetOptionUsername"; $curl; CURL Test::Name) ]
# Maybe use alternative IMAP port?
// Set Variable [ $r ; Value: MBS("CURL.SetOptionPort"; $curl; 143) ]
# This turns TLS on and requires connection to be encrypted
Set Variable [ $r ; Value: MBS("CURL.SetOptionUseSSL"; $curl; 3) ]
# force TLS v1.2
Set Variable [ $r ; Value: MBS("CURL.SetOptionSSLVersion"; $curl; 6) ]
# This disables certificate verification, so we accept any:
Set Variable [ $r ; Value: MBS("CURL.SetOptionSSLVerifyHost"; $curl; 0) ]
Set Variable [ $r ; Value: MBS("CURL.SetOptionSSLVerifyPeer"; $curl; 0) ]
# Better with certificates if you have some:
// Set Variable [ $r ; Value: MBS( "CURL.SetOptionCAInfo"; $curl; "/Library/FileMaker Server/certificates.pem") ]
// Set Variable [ $r ; Value: MBS("CURL.SetOptionSSLVerifyHost"; $curl; 2) ]
// Set Variable [ $r ; Value: MBS("CURL.SetOptionSSLVerifyPeer"; $curl; 1) ]
Set Variable [ $result ; Value: MBS("CURL.SetOptionVerbose"; $curl; 1) ]
# do it!
Set Field [ CURL Test::Result ; MBS("CURL.Perform"; $curl) ]
# Check result:
Set Field [ CURL Test::debug ; MBS("CURL.GetDebugAsText"; $curl) ]
Set Variable [ $result ; Value: MBS("CURL.Cleanup"; $curl) ]