Kalo te dokumentacioni
C#

client.Imports

Çdo metodë në këtë hapësirë emrash: nënshkrimi, parametrat, çfarë kthen dhe një shembull.

Metodat

Bring an old mailbox across from a Google Takeout, .mbox, .eml, .zip or .tgz export, with progress and a list of what did not come through.

Imports.ListAsync

List one page of mailbox imports

Lejetthreads:readKalon nëpër rezultate faqe pas faqeje
Nënshkrimi
Task<Page> ListAsync(    string? addressId = null,    int? limit = null,    string? cursor = null,    string? apiKey = null,    CancellationToken cancellationToken = default)

Returns one page of the imports in the workspace, newest first. Nothing is dropped from the history, so following nextCursor while hasMore is true reaches the very first import, and Imports.ListAllAsync and Imports.IterateAsync do that walk for you. Each carries its status, the bytes read so far out of the total, and running counts of messages seen, imported, skipped as duplicates, left out by your options and not imported.

A key limited to particular addresses sees only imports into those addresses.

Parametrat

addressIdstring?

Only imports into this address.

limitint?

Rows per page, a whole number from 1 to 100. The server defaults to 25.

cursorstring?

The nextCursor from the previous page, an import id. One that names no import this key can see is a 400 invalid_cursor.

apiKeystring?

Overrides the client's API key for this call only.

cancellationTokenCancellationToken

Cancels the request.

Kthen

A Page of import objects, with items, hasMore and nextCursor.

Shembull

var page = await client.Imports.ListAsync(addressId: "addr_5d1c9e3a7b2f4e60a8c1d3b9", limit: 10); foreach (var import in page){    Console.WriteLine($"{import["id"]} {import["status"]}: {import["counts"]?["imported"]} imported, {import["counts"]?["duplicate"]} duplicates");}

Shënime

  • A GET is retried automatically on network failure and on 408, 429, 500, 502, 503 and 504 responses, up to the client's MaxRetries.

E disponueshme edhe në

API
GET /imports
TypeScript
imports.list()
Python
imports.list()
Ruby
imports.list
PHP
imports->list
Go
Imports.List
Java
imports().list
CLI
openemail imports list

Imports.ListAllAsync

Collect every mailbox import into one object

Lejetthreads:readKalon nëpër rezultate faqe pas faqeje
Nënshkrimi
Task<IReadOnlyList<JsonObject>> ListAllAsync(    string? addressId = null,    int? limit = null,    string? cursor = null,    string? apiKey = null,    CancellationToken cancellationToken = default)

Follows nextCursor from page to page and returns every import in the workspace, newest first, narrowed to one address when addressId: is given. A key limited to particular addresses sees only imports into those addresses.

Parametrat

addressIdstring?

Only imports into this address.

limitint?

Page size per request, from 1 to 100, defaulting to 25 on the server.

cursorstring?

An import id to start after, skipping everything newer.

apiKeystring?

Overrides the client's API key for every page of this walk.

cancellationTokenCancellationToken

Cancels the request.

Kthen

A list of import objects holding every import across all pages.

Shembull

var imports = await client.Imports.ListAllAsync(); Console.WriteLine(imports.Count);

Shënime

  • A failure on any page throws out of the whole call, and none of the pages already read are returned.

E disponueshme edhe në

API
GET /imports
TypeScript
imports.listAll()
Python
imports.list_all()
Ruby
imports.list_all
PHP
imports->listAll
Go
Imports.ListAll
Java
imports().listAll

Imports.IterateAsync

Stream mailbox imports one at a time

Lejetthreads:readKalon nëpër rezultate faqe pas faqeje
Nënshkrimi
IAsyncEnumerable<JsonObject> IterateAsync(    string? addressId = null,    int? limit = null,    string? cursor = null,    string? apiKey = null,    CancellationToken cancellationToken = default)

Returns an IAsyncEnumerable<JsonObject> that yields imports one at a time, newest first, and requests the next page only once the current one is used up. Breaking out of the foreach stops the requests.

Parametrat

addressIdstring?

Only imports into this address.

limitint?

Page size per request, from 1 to 100, defaulting to 25 on the server.

cursorstring?

An import id to start after, skipping everything newer.

apiKeystring?

Overrides the client's API key for every page of this walk.

cancellationTokenCancellationToken

Cancels the request.

Kthen

An IAsyncEnumerable<JsonObject> that yields one import per step.

Shembull

await foreach (var import in client.Imports.IterateAsync(addressId: "addr_5d1c9e3a7b2f4e60a8c1d3b9")){    if ((string?)import["status"] == "failed")    {        Console.WriteLine($"{import["id"]} failed: {import["lastError"]}");    }}

Shënime

  • The generator is lazy, so an abandoned loop costs only the pages you consumed.

E disponueshme edhe në

API
GET /imports
TypeScript
imports.iterate()
Python
imports.iterate()
Ruby
imports.iterate
PHP
imports->iterate
Go
Imports.Iterate
Java
imports().iterate

Imports.GetAsync

Read one mailbox import

Lejetthreads:read
Nënshkrimi
Task<JsonObject> GetAsync(    string id,    string? apiKey = null,    CancellationToken cancellationToken = default)

Returns one import with its status, byte progress and counts. Poll it while status is queued or running. It settles on completed, failed or cancelled.

An id from another workspace answers exactly like one that never existed, with 404.

Parametrat

idstringE detyrueshme

Import id, imp_ followed by 24 hex characters.

apiKeystring?

Overrides the client's API key for this call only.

cancellationTokenCancellationToken

Cancels the request.

Kthen

A JsonObject with id, addressId, address, status, options, files, formats, chunkBytes, totalBytes, processedBytes, counts, labelsCreated, labelsSkipped, lastError, uploadDeleted, createdAt, startedAt and finishedAt.

Shembull

var import = await client.Imports.GetAsync("imp_4f8a2c6e1b9d3a7f5c0e2b84"); Console.WriteLine($"{import["status"]} {import["lastError"]}");

Shënime

  • lastError is set only when status is failed.

E disponueshme edhe në

API
GET /imports/{id}
TypeScript
imports.get()
Python
imports.get()
Ruby
imports.get
PHP
imports->get
Go
Imports.Get
Java
imports().get
CLI
openemail imports get

Imports.CreateAsync

Create a mailbox import and get its upload plan

Lejetthreads:write
Nënshkrimi
Task<JsonObject> CreateAsync(    IReadOnlyDictionary<string, object?> body,    string? apiKey = null,    CancellationToken cancellationToken = default)

Creates an import into one address of the workspace and returns it with status set to uploading. Each file is uploaded in parts of chunkBytes bytes, import["files"][i]["chunks"] of them, through Imports.UploadChunkAsync, and Imports.StartAsync then queues the import.

The import reads Google Takeout archives, .mbox files from Apple Mail, Thunderbird and most desktop apps, .eml files, and .zip or .tgz archives holding any of those, up to 100 GB a file and 50 files an import. Threads, dates and labels come across. Imported mail is quiet: it runs no rules, forwards, notifications, summaries or webhooks.

Imports.ImportFilesAsync does create, upload and start in one call.

Parametrat

addressIdstringE detyrueshme

The address the mail belongs to. It must be an address this workspace owns and this key may act for.

fileslistE detyrueshme

Each file as a dictionary with name and bytes, its size, 1 to 50 of them, each at most 100 GB.

options.keepInboxbool

Default true: mail that was in the old inbox lands in Inbox with its unread state. False files everything under Archive.

options.includeSpambool

Default false.

options.includeTrashbool

Default false.

apiKeystring?

Overrides the client's API key for this call only.

cancellationTokenCancellationToken

Cancels the request.

Kthen

A JsonObject for the import with status set to uploading, chunkBytes and each file's chunks.

Shembull

var import = await client.Imports.CreateAsync(new Body{    ["addressId"] = "addr_5d1c9e3a7b2f4e60a8c1d3b9",    ["files"] = new[] { new Body { ["name"] = "mailbox.mbox", ["bytes"] = new FileInfo("mailbox.mbox").Length } },    ["options"] = new Body { ["keepInbox"] = true, ["includeSpam"] = false },}); Console.WriteLine($"{import["id"]} takes {import["files"]?[0]?["chunks"]} parts of {import["chunkBytes"]} bytes");

Shënime

  • An address with an import already queued or running is 409 already_running.

  • Not retried automatically.

E disponueshme edhe në

API
POST /imports
TypeScript
imports.create()
Python
imports.create()
Ruby
imports.create
PHP
imports->create
Go
Imports.Create
Java
imports().create
CLI
openemail imports create

Imports.UploadStateAsync

See which parts of the upload have arrived

Lejetthreads:write
Nënshkrimi
Task<JsonObject> UploadStateAsync(    string id,    string? apiKey = null,    CancellationToken cancellationToken = default)

For each file, the indexes of the parts already stored, so an interrupted upload sends only what is missing. Empty once the import has left the uploading state.

Parametrat

idstringE detyrueshme

Import id, imp_ followed by 24 hex characters.

apiKeystring?

Overrides the client's API key for this call only.

cancellationTokenCancellationToken

Cancels the request.

Kthen

A JsonObject with received, one sorted list of part indexes per file.

Shembull

var import = await client.Imports.GetAsync("imp_4f8a2c6e1b9d3a7f5c0e2b84");var id = import["id"]!.GetValue<string>();var state = await client.Imports.UploadStateAsync(id);var received = (state["received"]?[0]?.AsArray() ?? []).Select(chunk => (int?)chunk).ToHashSet();var chunkBytes = (int?)import["chunkBytes"] ?? 0;var chunks = (int?)import["files"]?[0]?["chunks"] ?? 0; await using var mailbox = File.OpenRead("mailbox.mbox"); for (var chunk = 0; chunk < chunks; chunk++){    if (received.Contains(chunk))    {        continue;    }     var part = new byte[chunkBytes];     mailbox.Position = (long)chunk * chunkBytes;     using var bytes = new MemoryStream(part, 0, await mailbox.ReadAsync(part));     await client.Imports.UploadChunkAsync(id, 0, chunk, bytes);} await client.Imports.StartAsync(id);

E disponueshme edhe në

API
GET /imports/{id}/upload
TypeScript
imports.uploadState()
Python
imports.upload_state()
Ruby
imports.upload_state
PHP
imports->uploadState
Go
Imports.UploadState
Java
imports().uploadState
CLI
openemail imports upload-state

Imports.UploadChunkAsync

Upload one part of an import file

Lejetthreads:write
Nënshkrimi
Task<JsonObject> UploadChunkAsync(    string id,    int file,    int chunk,    Stream data,    string? apiKey = null,    CancellationToken cancellationToken = default)

Stores one part of file file: the bytes from chunk * chunkBytes up to the next part. Every part is exactly chunkBytes long except the last, and a part of the wrong length is 400 bad_chunk. Sending a part again replaces it, so a failed part can simply be retried.

Parametrat

idstringE detyrueshme

Import id, imp_ followed by 24 hex characters.

fileintE detyrueshme

The file index, in the order given to Imports.CreateAsync.

chunkintE detyrueshme

The part index, from 0.

dataStreamE detyrueshme

The part as a readable Stream. All of it is sent, so pass the part alone rather than the whole file.

apiKeystring?

Overrides the client's API key for this call only.

cancellationTokenCancellationToken

Cancels the request.

Kthen

A JsonObject echoing file, chunk and the bytes stored.

Shembull

await using var mailbox = File.OpenRead("mailbox.mbox"); var import = await client.Imports.CreateAsync(new Body{    ["addressId"] = "addr_5d1c9e3a7b2f4e60a8c1d3b9",    ["files"] = new[] { new Body { ["name"] = "mailbox.mbox", ["bytes"] = mailbox.Length } },});var id = import["id"]!.GetValue<string>();var part = new byte[(int?)import["chunkBytes"] ?? 0]; for (var chunk = 0; chunk < ((int?)import["files"]?[0]?["chunks"] ?? 0); chunk++){    using var bytes = new MemoryStream(part, 0, await mailbox.ReadAsync(part));     var stored = await client.Imports.UploadChunkAsync(id, 0, chunk, bytes);     Console.WriteLine($"Part {stored["chunk"]}: {stored["bytes"]} bytes");} await client.Imports.StartAsync(id);

Shënime

  • Retried automatically on network failure and on 408, 429, 500, 502, 503 and 504 responses, since a repeated part replaces itself.

E disponueshme edhe në

API
PUT /imports/{id}/files/{file}/chunks/{chunk}
TypeScript
imports.uploadChunk()
Python
imports.upload_chunk()
Ruby
imports.upload_chunk
PHP
imports->uploadChunk
Go
Imports.UploadChunk
Java
imports().uploadChunk
CLI
openemail imports upload-chunk

Imports.StartAsync

Queue an import once its files are uploaded

Lejetthreads:write
Nënshkrimi
Task<JsonObject> StartAsync(    string id,    string? apiKey = null,    CancellationToken cancellationToken = default)

Checks that every part of every file has arrived, recognises each file's format and queues the import. A file still missing parts is 412 missing_chunks, and a file that is not an archive or a mailbox is 400 unsupported_file. Calling it on an import that has already left uploading returns it unchanged.

Parametrat

idstringE detyrueshme

Import id, imp_ followed by 24 hex characters.

apiKeystring?

Overrides the client's API key for this call only.

cancellationTokenCancellationToken

Cancels the request.

Kthen

A JsonObject for the import with status set to queued.

Shembull

try{    var import = await client.Imports.StartAsync("imp_4f8a2c6e1b9d3a7f5c0e2b84");     Console.WriteLine($"{import["status"]}, read as {string.Join(", ", import["formats"]?.AsArray() ?? [])}");}catch (OpenEmailApiException error){    if (error.Code != "missing_chunks")    {        throw;    }}

E disponueshme edhe në

API
POST /imports/{id}/start
TypeScript
imports.start()
Python
imports.start()
Ruby
imports.start
PHP
imports->start
Go
Imports.Start
Java
imports().start
CLI
openemail imports start

Imports.CancelAsync

Cancel a mailbox import

Lejetthreads:write
Nënshkrimi
Task<JsonObject> CancelAsync(    string id,    string? apiKey = null,    CancellationToken cancellationToken = default)

Stops an import at its next checkpoint. Mail already imported stays in the mailbox. A finished import is 409 not_cancellable.

Parametrat

idstringE detyrueshme

Import id, imp_ followed by 24 hex characters.

apiKeystring?

Overrides the client's API key for this call only.

cancellationTokenCancellationToken

Cancels the request.

Kthen

A JsonObject for the import with status set to cancelled.

Shembull

try{    var import = await client.Imports.CancelAsync("imp_4f8a2c6e1b9d3a7f5c0e2b84");     Console.WriteLine($"{import["status"]}, {import["counts"]?["imported"]} messages stay");}catch (OpenEmailApiException error) when (error.IsConflict){    Console.WriteLine("The import already finished");}

E disponueshme edhe në

API
POST /imports/{id}/cancel
TypeScript
imports.cancel()
Python
imports.cancel()
Ruby
imports.cancel
PHP
imports->cancel
Go
Imports.Cancel
Java
imports().cancel
CLI
openemail imports cancel

Imports.ListFailuresAsync

List what an import could not bring across

Lejetthreads:read
Nënshkrimi
Task<JsonObject> ListFailuresAsync(    string id,    int? after = null,    int? limit = null,    string? apiKey = null,    CancellationToken cancellationToken = default)

Each message or archive entry that did not come across, with the reason: too-large (over 50 MB), unparseable, no-date, storage-error, unreadable-entry, encrypted-entry or archive-limit. Page with after:, passing the nextCursor of the previous page.

Parametrat

idstringE detyrueshme

Import id, imp_ followed by 24 hex characters.

afterint?

The nextCursor of the previous page.

limitint?

At most 100, the default.

apiKeystring?

Overrides the client's API key for this call only.

cancellationTokenCancellationToken

Cancels the request.

Kthen

A JsonObject with data, a list of failures, and nextCursor, the number to pass as after: for the next page, or null after the last one.

Shembull

var failures = await client.Imports.ListFailuresAsync("imp_4f8a2c6e1b9d3a7f5c0e2b84", limit: 50); if (failures["nextCursor"] is not null){    var more = await client.Imports.ListFailuresAsync("imp_4f8a2c6e1b9d3a7f5c0e2b84", after: (int?)failures["nextCursor"], limit: 50);     Console.WriteLine($"{more["data"]?.AsArray().Count} more on the next page");}

E disponueshme edhe në

API
GET /imports/{id}/failures
TypeScript
imports.listFailures()
Python
imports.list_failures()
Ruby
imports.list_failures
PHP
imports->listFailures
Go
Imports.ListFailures
Java
imports().listFailures
CLI
openemail imports list-failures

Imports.DeleteUploadAsync

Delete the files uploaded for an import

Lejetthreads:write
Nënshkrimi
Task<JsonObject> DeleteUploadAsync(    string id,    string? apiKey = null,    CancellationToken cancellationToken = default)

Removes the uploaded archive. Mail already imported stays in the mailbox. An import still uploading is cancelled at the same time, and one that is queued or running is 409 still_running.

Parametrat

idstringE detyrueshme

Import id, imp_ followed by 24 hex characters.

apiKeystring?

Overrides the client's API key for this call only.

cancellationTokenCancellationToken

Cancels the request.

Kthen

A JsonObject for the import with uploadDeleted set to true.

Shembull

var import = await client.Imports.DeleteUploadAsync("imp_4f8a2c6e1b9d3a7f5c0e2b84"); Console.WriteLine($"{((bool?)import["uploadDeleted"] == true ? "The uploaded files are gone" : "The files are still stored")}, status {import["status"]}");

E disponueshme edhe në

API
DELETE /imports/{id}/upload
TypeScript
imports.deleteUpload()
Python
imports.delete_upload()
Ruby
imports.delete_upload
PHP
imports->deleteUpload
Go
Imports.DeleteUpload
Java
imports().deleteUpload
CLI
openemail imports delete-upload

Imports.ImportFilesAsync

Create, upload and start an import in one call

Lejetthreads:write
Nënshkrimi
Task<JsonObject> ImportFilesAsync(    IReadOnlyDictionary<string, object?> input,    string? apiKey = null,    CancellationToken cancellationToken = default)

Creates the import, uploads every file part by part and starts it, reporting progress through onProgress. Pass each file's data as a readable Stream. Parts are sliced from it, so a seekable Stream is read one part at a time and never held in memory whole.

It returns once the import is queued. Poll Imports.GetAsync to follow it.

Parametrat

addressIdstringE detyrueshme

The address the mail belongs to.

fileslistE detyrueshme

Each file as a dictionary with name and data. A file whose data is not one of the byte sources above throws an ArgumentException before anything is sent.

optionsdictionary

keepInbox, includeSpam and includeTrash, as for Imports.CreateAsync.

onProgressdictionary

Called after each part with two integers: the bytes uploaded so far and the total.

apiKeystring?

Overrides the client's API key for every request of this call.

cancellationTokenCancellationToken

Cancels the request.

Kthen

A JsonObject for the import with status set to queued.

Shembull

await using var takeout = File.OpenRead("takeout.tgz");await using var mailbox = File.OpenRead("mailbox.mbox"); var import = await client.Imports.ImportFilesAsync(new Body{    ["addressId"] = "addr_5d1c9e3a7b2f4e60a8c1d3b9",    ["files"] = new[]    {        new Body { ["name"] = "takeout.tgz", ["data"] = takeout },        new Body { ["name"] = "mailbox.mbox", ["data"] = mailbox },    },    ["options"] = new Body { ["keepInbox"] = false },    ["onProgress"] = (Action<long, long>)((uploaded, total) => Console.WriteLine($"{uploaded} of {total} bytes uploaded")),}); Console.WriteLine($"{import["id"]} is {import["status"]}");

Shënime

  • If a part still fails after its retries, the exception is thrown and the import is left in uploading. Imports.UploadStateAsync then tells you which parts to send before calling Imports.StartAsync.

E disponueshme edhe në

API
POST /imports
TypeScript
imports.importFiles()
Python
imports.import_files()
Ruby
imports.import_files
PHP
imports->importFiles
Go
Imports.ImportFiles
Java
imports().importFiles
CLI
openemail imports import-files

Imports.DiscoverMailboxAsync

Find the mail server for an address

Lejetthreads:write
Nënshkrimi
Task<JsonObject> DiscoverMailboxAsync(    string email,    string? apiKey = null,    CancellationToken cancellationToken = default)

Looks up where the mailbox behind an address lives, so an import can connect to it. It tries the providers OpenEmail knows, then who receives mail for the domain, then Mozilla's public list of mail settings, then the domain's own _imaps._tcp record. Nothing is stored and no sign-in is attempted.

server is null when nothing was found: ask for the host and port and pass them to CheckMailboxAsync. signIn says what the mailbox takes. app-password and password are what CheckMailboxAsync and ConnectMailboxAsync send. An Outlook.com or Microsoft 365 mailbox answers microsoft, which only the Microsoft sign-in on the Migrations page of the app can open.

Parametrat

emailstringE detyrueshme

The address of the old mailbox.

cancellationTokenCancellationToken

Cancels the request.

apiKeystring?

Overrides the client API key for this call only.

Kthen

A JsonObject with provider, signIn, server, source, username and whether contacts and calendars can come across too.

Shembull

var settings = await client.Imports.DiscoverMailboxAsync("[email protected]"); Console.WriteLine(settings["server"] is null ? "Ask for the host and port" : $"{settings["provider"]} takes {settings["signIn"]} at {settings["server"]?["host"]}");

Shënime

  • Something that is not an email address is a 400 mailbox_address_invalid.

  • Too many lookups in an hour is a 429 mailbox_checks_limited.

  • A GET is retried automatically on network failure and on 408, 500, 502, 503 and 504 responses, up to the client MaxRetries, and on a 429 only when it carries a Retry-After of a minute or less.

E disponueshme edhe në

API
GET /imports/mailbox-settings
TypeScript
imports.discoverMailbox()
Python
imports.discover_mailbox()
Ruby
imports.discover_mailbox
PHP
imports->discoverMailbox
Go
Imports.DiscoverMailbox
Java
imports().discoverMailbox
CLI
openemail imports discover-mailbox

Imports.CheckMailboxAsync

Check a mailbox before importing it

Lejetthreads:write
Nënshkrimi
Task<JsonObject> CheckMailboxAsync(    IReadOnlyDictionary<string, object?> body,    string? apiKey = null,    CancellationToken cancellationToken = default)

Signs in to the old mailbox over IMAP, lists its folders and counts the messages, then signs out. Nothing is stored, the password is not kept and the old mailbox is not changed. Use it to show what an import would bring before starting one.

Leave host out to have the server looked up from the address, as DiscoverMailboxAsync does. Only port 993 with TLS, or port 143 with STARTTLS, is accepted. Each person may make 10 sign-in attempts an hour across CheckMailboxAsync, ConnectMailboxAsync and ResumeAsync, and every refused sign-in reads the same, whatever the reason.

Parametrat

emailstringE detyrueshme

The address of the old mailbox.

passwordstringE detyrueshme

The password of the old mailbox, or an app password where DiscoverMailboxAsync answers signIn: app-password.

hoststring

The IMAP host, such as imap.example.com. It has to be a public host. Left out, the server is looked up from the address.

portint

993 or 143, read only with host. Left out, it follows security: 993 for tls and 143 for starttls.

securitystring

tls or starttls, read only with host. Left out, it follows port, and is tls when both are left out.

usernamestring

The name to sign in with. Left out, it is the username that DiscoverMailboxAsync answers, usually the address.

cancellationTokenCancellationToken

Cancels the request.

apiKeystring?

Overrides the client API key for this call only.

Kthen

A JsonObject with the server and username that worked, up to 200 folders with their role, messages and whether an import with the default options reads them, and the total messages an import would read.

Shembull

var check = await client.Imports.CheckMailboxAsync(new Body{    ["email"] = "[email protected]",    ["password"] = Environment.GetEnvironmentVariable("OLD_MAILBOX_PASSWORD"),}); Console.WriteLine($"{check["messages"]} messages in {check["folders"]?.AsArray().Count} folders");

Shënime

E disponueshme edhe në

API
POST /imports/mailbox/check
TypeScript
imports.checkMailbox()
Python
imports.check_mailbox()
Ruby
imports.check_mailbox
PHP
imports->checkMailbox
Go
Imports.CheckMailbox
Java
imports().checkMailbox
CLI
openemail imports check-mailbox

Imports.ConnectMailboxAsync

Import a live mailbox

Lejetthreads:write
Nënshkrimi
Task<JsonObject> ConnectMailboxAsync(    IReadOnlyDictionary<string, object?> body,    string? apiKey = null,    CancellationToken cancellationToken = default)

Starts copying an old mailbox into one address, straight from its mail server. It signs in once to check the password, keeps the password sealed until the import finishes and for 30 days at most, and queues the import. Poll GetAsync for progress.

The old mailbox is only ever read. Folders become labels, read and starred state come across, and a message the address already holds is skipped, so running an import twice adds nothing. A Gmail mailbox is read from All Mail, with its labels. An import waits by itself when the old provider slows it down, such as Gmail's daily download limit, and carries on from the same folder afterwards: status is parked and remote.resumeAt says when. If the password stops working, status is needs-password until ResumeAsync sends a new one.

contacts and calendars bring those across too where the provider offers them, which needs contacts:write and calendar:write as well. They arrive as contacts and calendar imports of their own, listed in children. rerunOf names a finished import of the same mailbox, at most 30 days old, so only mail that arrived since is fetched. One import may run into an address at a time.

Parametrat

addressIdstringE detyrueshme

The address the mail belongs to. It must be an address this workspace owns and this key may act for.

emailstringE detyrueshme

The address of the old mailbox.

passwordstringE detyrueshme

The password of the old mailbox, or an app password where DiscoverMailboxAsync answers signIn: app-password.

hoststring

The IMAP host, such as imap.example.com. It has to be a public host. Left out, the server is looked up from the address.

portint

993 or 143, read only with host. Left out, it follows security: 993 for tls and 143 for starttls.

securitystring

tls or starttls, read only with host. Left out, it follows port, and is tls when both are left out.

usernamestring

The name to sign in with. Left out, it is the username that DiscoverMailboxAsync answers, usually the address.

options.keepInboxbool

Default true: mail that was in the old inbox lands in Inbox with its unread state. False files everything under Archive.

options.includeSpambool

Default false.

options.includeTrashbool

Default false.

contactsbool

True brings the address book across too, where the provider offers it. Needs contacts:write.

calendarsbool

True brings the calendars across too, where the provider offers them. Needs calendar:write.

rerunOfstring

The id of a finished import of the same mailbox, at most 30 days old. Only mail that arrived since is fetched.

cancellationTokenCancellationToken

Cancels the request.

apiKeystring?

Overrides the client API key for this call only.

Kthen

A JsonObject with status: queued, source: imap, the remote mailbox it reads and the children it started.

Shembull

var import = await client.Imports.ConnectMailboxAsync(new Body{    ["addressId"] = "addr_5d1c9e3a7b2f4e60a8c1d3b9",    ["email"] = "[email protected]",    ["password"] = Environment.GetEnvironmentVariable("OLD_MAILBOX_PASSWORD"),    ["options"] = new Body { ["keepInbox"] = true },    ["contacts"] = true,    ["calendars"] = true,}); Console.WriteLine($"{import["id"]} is {import["status"]}");

Shënime

E disponueshme edhe në

API
POST /imports/mailbox
TypeScript
imports.connectMailbox()
Python
imports.connect_mailbox()
Ruby
imports.connect_mailbox
PHP
imports->connectMailbox
Go
Imports.ConnectMailbox
Java
imports().connectMailbox
CLI
openemail imports connect-mailbox

Imports.ResumeAsync

Resume a waiting mailbox import

Lejetthreads:write
Nënshkrimi
Task<JsonObject> ResumeAsync(    string id,    IReadOnlyDictionary<string, object?>? body = null,    string? apiKey = null,    CancellationToken cancellationToken = default)

Carries on an import from a live mailbox that is waiting. One with status: parked is queued again at once, without a body. One with status: needs-password needs the new password, which is checked against the old mailbox before the import is queued. It picks up at the folder and message it stopped at.

An import that came from a Microsoft sign-in is resumed by signing in again on the Migrations page of the app.

Parametrat

idstringE detyrueshme

Import id, imp_ followed by 24 hex characters.

passwordstring

The new password of the old mailbox. Required when status is needs-password.

cancellationTokenCancellationToken

Cancels the request.

apiKeystring?

Overrides the client API key for this call only.

Kthen

A JsonObject with status: queued.

Shembull

var import = await client.Imports.ResumeAsync("imp_4f8a2c6e1b9d3a7f5c0e2b84", new Body{    ["password"] = Environment.GetEnvironmentVariable("OLD_MAILBOX_PASSWORD"),}); Console.WriteLine($"{import["id"]} is {import["status"]}");

Shënime

  • An import that is not waiting, or that reads uploaded files, is 409 not_resumable.

  • Leaving password out for an import that needs one is 400 password_required, and a password the mail server does not accept is 400 mailbox_login_failed.

  • A new password counts towards the 10 sign-in attempts an hour that CheckMailboxAsync and ConnectMailboxAsync share.

  • A parked import carries on by itself at remote.resumeAt, so calling this only tries sooner.

  • Not retried automatically.

E disponueshme edhe në

API
POST /imports/{id}/resume
TypeScript
imports.resume()
Python
imports.resume()
Ruby
imports.resume
PHP
imports->resume
Go
Imports.Resume
Java
imports().resume
CLI
openemail imports resume