v51

latestOpenAPI 3.1.0raw.githubusercontent.com2026-08-01960201.2 KB
Sync jobs

Create sync job

You can create new sync job using this action. It takes a JSON object containing a domain informations.

post/api/v1/add/syncjob

Request body

parametersstring

your local mailcow mailbox

host1string

the smtp server where mails should be synced from

port1string

the smtp port of the target mail server

user1string

the username of the mailbox

passwordstring

the password of the mailbox

enc1string

the encryption method used to connect to the mailserver

mins_internalnumber

the interval in which messages should be syned

subfolder2string

sync into subfolder on destination (empty = do not use subfolder)

maxagenumber

only sync messages up to this age in days

maxbytespersecondnumber

max speed transfer limit for the sync

timeout1number

timeout for connection to remote host

timeout2number

timeout for connection to local host

excludestring

exclude objects (regex)

custom_paramsstring

custom parameters

delete2duplicatesboolean

delete duplicates on destination (--delete2duplicates)

delete1boolean

delete from source when completed (--delete1)

delete2boolean

delete messages on destination that are not on source (--delete2)

automapboolean

try to automap folders ("Sent items", "Sent" => "Sent" etc.) (--automap)

skipcrossduplicatesboolean

skip duplicate messages across folders (first come, first serve) (--skipcrossduplicates)

subscribeallboolean

subscribe all folders (--subscribeall)

activeboolean

enables or disables the sync job

Example request

{
  "username": "lisa@mailcow.tld",
  "host1": "mail.mailcow.tld",
  "port1": "143",
  "user1": "demo@mailcow.tld",
  "password1": "supersecretpw",
  "enc1": "TLS",
  "mins_interval": "20",
  "subfolder2": "/SyncIntoSubfolder",
  "maxage": "0",
  "maxbytespersecond": "0",
  "timeout1": "600",
  "timeout2": "600",
  "exclude": "(?i)spam|(?i)junk",
  "custom_params": "--dry",
  "delete2duplicates": "1",
  "delete1": "1",
  "delete2": "0",
  "automap": "1",
  "skipcrossduplicates": "0",
  "subscribeall": "0",
  "active": "1"
}

Response

OK

type'success' | 'danger' | 'error'