hostInfoType
as defined
in the email schema: http://www.zorba-xquery.com/modules/email
.
For example:
<email:hostInfo> <email:hostName>imap.example.com</email:hostName> <email:userName>myuser</email:userName> <email:password>mypassword</email:password> </email:hostInfo>The
hostInfoType
only needs to be in the email schema namespace
(http://www.zorba-xquery.com/modules/email
). It does not need
to be validated since it's validated by the module.
copy
($host-info as element(email:hostInfo), $mailbox-from as xs:string, $mailbox-to as xs:string, $messages as xs:long+, $uid as xs:boolean?) as empty-sequence()
Copies messages between mailboxes. |
create
($host-info as element(email:hostInfo), $mailbox-name as xs:string) as empty-sequence()
Creates a new mailbox for the given user. |
delete
($host-info as element(email:hostInfo), $mailbox-name as xs:string) as empty-sequence()
Deletes a mailbox for the given user. |
expunge
($host-info as element(email:hostInfo), $mailbox as xs:string) as empty-sequence()
Permanently deletes all messages of the given mailbox that have the "deleted" flag set. |
fetch-envelope
($host-info as element(email:hostInfo), $mailbox as xs:string, $message-number as xs:long, $uid as xs:boolean?) as element(email:envelope)
Fetches the envelope of a message. |
fetch-flags
($host-info as element(email:hostInfo), $mailbox as xs:string, $message-number as xs:long, $uid as xs:boolean?) as element(email:flags)
Fetches the flags of a message. |
fetch-from
($host-info as element(email:hostInfo), $mailbox as xs:string, $message-number as xs:long) as xs:string
Fetches the 'from' string of a message. |
fetch-message-sequence-number
($host-info as element(email:hostInfo), $mailbox as xs:string, $message-number as xs:long) as xs:long
Fetches the message sequence number for a given unique identifier. |
fetch-message
($host-info as element(email:hostInfo), $mailbox as xs:string, $message-number as xs:long, $uid as xs:boolean) as element(email:message)
Fetches a whole message. |
fetch-subject
($host-info as element(email:hostInfo), $mailbox as xs:string, $message-number as xs:long) as xs:string
Fetches the subject for a message. |
fetch-uid
($host-info as element(email:hostInfo), $mailbox as xs:string, $message-number as xs:long) as xs:long
Fetches the unique identifier for a given message sequence number. |
list
($host-info as element(email:hostInfo), $mailbox-ref as xs:string, $pattern as xs:string, $only-subscribed as xs:boolean) as element(email:mailbox)*
Lists IMAP folders for the specified user on the host that match the pattern. |
move
($host-info as element(email:hostInfo), $mailbox-from as xs:string, $mailbox-to as xs:string, $messages as xs:long+, $uid as xs:boolean?) as empty-sequence()
Moves messages between mailboxes. |
rename
($host-info as element(email:hostInfo), $mailbox-old as xs:string, $mailbox-new as xs:string) as empty-sequence()
Renames a mailbox. |
search
($host-info as element(email:hostInfo), $mailbox as xs:string, $criteria as xs:string, $uid as xs:boolean?) as xs:long*
Searches a mailbox for messages that match the given criteria. |
set-flags
($host-info as element(email:hostInfo), $mailbox as xs:string, $message-number as xs:long, $flags as element(email:flags), $uid as xs:boolean?) as empty-sequence()
Sets the flags for a given message. |
status
($host-info as element(email:hostInfo), $mailbox as xs:string) as element(email:status)
Returns the status of the given mailbox. |
subscribe
($host-info as element(email:hostInfo), $mailbox as xs:string) as empty-sequence()
Subscribes the user to the specified mailbox. |
unsubscribe
($host-info as element(email:hostInfo), $mailbox as xs:string) as empty-sequence()
Unsubscribes the user from the specified mailbox. |
declare %an:sequential function imap:copy($host-info as element(email:hostInfo), $mailbox-from as xs:string, $mailbox-to as xs:string, $messages as xs:long+, $uid as xs:boolean?) as empty-sequence()
$uid
, the messages are either specified
through their sequence number or through their unique id. Both mailboxes must exist.
$messages
are treated as sequence numbers. Else as unique identifiers.declare %an:sequential function imap:create($host-info as element(email:hostInfo), $mailbox-name as xs:string) as empty-sequence()
declare %an:sequential function imap:delete($host-info as element(email:hostInfo), $mailbox-name as xs:string) as empty-sequence()
declare %an:sequential function imap:expunge($host-info as element(email:hostInfo), $mailbox as xs:string) as empty-sequence()
declare %an:nondeterministic function imap:fetch-envelope($host-info as element(email:hostInfo), $mailbox as xs:string, $message-number as xs:long, $uid as xs:boolean?) as element(email:envelope)
$uid
either as message sequence number or unique identifier).$message-number
is treated as sequence number. Else as unique identifier.envelope
of the requested message. The result is validated against the schema: http://www.zorba-xquery.com/modules/email
.declare %an:nondeterministic function imap:fetch-flags($host-info as element(email:hostInfo), $mailbox as xs:string, $message-number as xs:long, $uid as xs:boolean?) as element(email:flags)
$message-number
is treated as sequence number. Else as unique identifier.flags
of the specified message. The result is validated against the schema: http://www.zorba-xquery.com/modules/email
.declare %an:nondeterministic function imap:fetch-from($host-info as element(email:hostInfo), $mailbox as xs:string, $message-number as xs:long) as xs:string
declare %an:nondeterministic function imap:fetch-message-sequence-number($host-info as element(email:hostInfo), $mailbox as xs:string, $message-number as xs:long) as xs:long
declare %an:nondeterministic function imap:fetch-message($host-info as element(email:hostInfo), $mailbox as xs:string, $message-number as xs:long, $uid as xs:boolean) as element(email:message)
$message-number
is treated as sequence number. Else as unique identifier.message
with the given $message-number
. The result is validated against the schema: http://www.zorba-xquery.com/modules/email
.declare %an:nondeterministic function imap:fetch-subject($host-info as element(email:hostInfo), $mailbox as xs:string, $message-number as xs:long) as xs:string
declare %an:nondeterministic function imap:fetch-uid($host-info as element(email:hostInfo), $mailbox as xs:string, $message-number as xs:long) as xs:long
declare %an:nondeterministic function imap:list($host-info as element(email:hostInfo), $mailbox-ref as xs:string, $pattern as xs:string, $only-subscribed as xs:boolean) as element(email:mailbox)*
mailbox
elements. The result elements are validated against the schema: http://www.zorba-xquery.com/modules/email
.declare %an:sequential function imap:move($host-info as element(email:hostInfo), $mailbox-from as xs:string, $mailbox-to as xs:string, $messages as xs:long+, $uid as xs:boolean?) as empty-sequence()
$uid
, the messages are either specified through
their sequence number or through their unique id. Both mailboxes must exist.
$messages
are treated as sequence numbers. Else as unique identifiers.declare %an:sequential function imap:rename($host-info as element(email:hostInfo), $mailbox-old as xs:string, $mailbox-new as xs:string) as empty-sequence()
declare %an:nondeterministic function imap:search($host-info as element(email:hostInfo), $mailbox as xs:string, $criteria as xs:string, $uid as xs:boolean?) as xs:long*
$uid
, the function will either
return matching sequence numbers or unique identifiers.
declare %an:sequential function imap:set-flags($host-info as element(email:hostInfo), $mailbox as xs:string, $message-number as xs:long, $flags as element(email:flags), $uid as xs:boolean?) as empty-sequence()
$flags
.
$uid
). <email:flags> <email:seen/> <email:deleted/> <email:flagged/> <email:answered/> <email:draft/> </email:flags>
. Setting "flagged" only and unsetting all other at once can be done by passing: <email:flags> <email:flagged/> </email:flags>
.$message-number
is treated as sequence number. Else as unique identifier.declare %an:nondeterministic function imap:status($host-info as element(email:hostInfo), $mailbox as xs:string) as element(email:status)
messages
: the number of messages in the mailboxrecent
: the number of messages flagged as recentunseen
: the number of messages flagged as unseenuidnext
: the next unique identifier that will be assigned to a messageuidvalidity
: a value that, together with the uidnext
value
forms a 64 bit number that must be unique for the serverstatus
of the specified $mailbox
. The result is validated against the schema: http://www.zorba-xquery.com/modules/email
.declare %an:sequential function imap:subscribe($host-info as element(email:hostInfo), $mailbox as xs:string) as empty-sequence()
declare %an:sequential function imap:unsubscribe($host-info as element(email:hostInfo), $mailbox as xs:string) as empty-sequence()