Skip to content

Commit

Permalink
Merge pull request #14 from l-with/add-syncjob
Browse files Browse the repository at this point in the history
add resource syncjob
  • Loading branch information
l-with authored Jul 23, 2022
2 parents f855040 + 81b2659 commit 4e49754
Show file tree
Hide file tree
Showing 11 changed files with 595 additions and 5 deletions.
3 changes: 2 additions & 1 deletion docs/data-sources/mailbox.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ description: |-

# mailcow_mailbox (Data Source)

Provides details about a domain in mailcow. This data source is useful if you want to use a non-terraform managed domain.
Provides details about a mailbox in mailcow.
This data source is useful if you want to use a non-terraform managed mailbox.

## Example Usage
```terraform
Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ This is under development. You will certainly find bugs and limitations. In thos
<!-- schema generated by tfplugindocs -->
## Schema

### Required
### Optional

- `api_key` (String, Sensitive) The mailcow API key, can optionally be passed as `MAILCOW_API_KEY` environmental variable
- `host_name` (String) The name of the mailcow host, can optionally be passed as `MAILCOW_HOST_NAME` environmental variable
54 changes: 54 additions & 0 deletions docs/resources/syncjob.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
page_title: "mailcow_syncjob Resource - terraform-provider-mailcow"
subcategory: ""
description: |-
---

# mailcow_syncjob (Resource)

Provides a syncjob in mailcow.
This can be used to create, modify, and delete syncjobs.

## Example Usage
```terraform
resource "mailcow_syncjob" "syncjob" {
username = "[email protected]"
host1 = "example.com"
user1 = "[email protected]"
password1 = "secret-password"
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `host1` (String) the smtp server where mails should be synced from (--host1)
- `password1` (String, Sensitive) the password of the mailbox on the host (--password1)
- `user1` (String) user to login on remote host (--user1)
- `username` (String) user to login on local host (--user2)

### Optional

- `active` (Boolean) is sync job active or not
- `automap` (Boolean) try to automap folders ("Sent items", "Sent" => "Sent" etc.) (--automap)
- `custom_params` (String) custom parameters
- `delete1` (Boolean) delete from source when completed (--delete1)
- `delete2` (Boolean) delete messages on destination that are not on source (--delete2)
- `delete2duplicates` (Boolean) delete duplicates on destination (--delete2duplicates)
- `enc1` (String) the encryption method used to connect to the target mailserver (SSL,TLS,PLAIN)
- `exclude` (String) exclude objects (regex) (--exclude)
- `maxage` (Number) only sync messages up to this age in days (--maxage)
- `maxbytespersecond` (String) max speed transfer limit for the sync (--maxbytespersecond)
- `mins_interval` (Number) the interval in which messages should be synced (minutes)
- `port1` (Number) the smtp port of the target mail server (--port1)
- `skipcrossduplicates` (Boolean) skip duplicate messages across folders (first come, first serve) (--skipcrossduplicates)
- `subfolder2` (String) sync into subfolder on destination (empty = do not use subfolder) (--subfolder2)
- `subscribeall` (Boolean) subscribe all folders (--subscribeall)
- `timeout1` (Number) timeout for connection to remote host (--timeout1)
- `timeout2` (Number) timeout for connection to local host (--timeout2)

### Read-Only

- `id` (String) The ID of this resource.
6 changes: 6 additions & 0 deletions examples/resources/mailcow_syncjob/resource.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
resource "mailcow_syncjob" "syncjob" {
username = "[email protected]"
host1 = "example.com"
user1 = "[email protected]"
password1 = "secret-password"
}
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ go 1.18
require (
github.com/hashicorp/terraform-plugin-docs v0.13.0
github.com/hashicorp/terraform-plugin-sdk/v2 v2.18.0
github.com/l-with/mailcow-go v0.0.45-beta
github.com/l-with/mailcow-go v0.0.47-beta
)

require (
Expand Down Expand Up @@ -63,7 +63,7 @@ require (
github.com/zclconf/go-cty v1.10.0 // indirect
golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d // indirect
golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e // indirect
golang.org/x/oauth2 v0.0.0-20220718184931-c8730f7fcb92 // indirect
golang.org/x/oauth2 v0.0.0-20220722155238-128564f6959c // indirect
golang.org/x/sys v0.0.0-20220627191245-f75cf1eec38b // indirect
golang.org/x/text v0.3.7 // indirect
google.golang.org/appengine v1.6.7 // indirect
Expand Down
6 changes: 6 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,10 @@ github.com/l-with/mailcow-go v0.0.44-beta h1:GEHrWe7x4H1W80RD8QkdmbNv9ZtGPywHPV0
github.com/l-with/mailcow-go v0.0.44-beta/go.mod h1:paN3tojCwB3bSJ/pwGspVvGIiRmBT3ihQrpkSFWTFhQ=
github.com/l-with/mailcow-go v0.0.45-beta h1:bRh6lfWbKB0AHmTihS0oudB2KfgPX/Hc7aVlmlcQaTI=
github.com/l-with/mailcow-go v0.0.45-beta/go.mod h1:paN3tojCwB3bSJ/pwGspVvGIiRmBT3ihQrpkSFWTFhQ=
github.com/l-with/mailcow-go v0.0.46-beta h1:NoHGSzAsx4tnT07H0QTZ+dS+jvIwIv7lEGXWFMV8DsY=
github.com/l-with/mailcow-go v0.0.46-beta/go.mod h1:VPHxh/5DnSVhlImbkgl+KAE08q+xWTVclJqKVFfSyFI=
github.com/l-with/mailcow-go v0.0.47-beta h1:AhqEFNlgtKaBlSdPGjeLNctB38Wtp+53a3kPCKOwBIw=
github.com/l-with/mailcow-go v0.0.47-beta/go.mod h1:VPHxh/5DnSVhlImbkgl+KAE08q+xWTVclJqKVFfSyFI=
github.com/matryer/is v1.2.0/go.mod h1:2fLPjFQM9rhQ15aVEtbuwhJinnOqrmgXPNdZsdwlWXA=
github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
Expand Down Expand Up @@ -512,6 +516,8 @@ golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5/go.mod h1:DAh4E804XQdzx2j
golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE=
golang.org/x/oauth2 v0.0.0-20220718184931-c8730f7fcb92 h1:oVlhw3Oe+1reYsE2Nqu19PDJfLzwdU3QUUrG86rLK68=
golang.org/x/oauth2 v0.0.0-20220718184931-c8730f7fcb92/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg=
golang.org/x/oauth2 v0.0.0-20220722155238-128564f6959c h1:q3gFqPqH7NVofKo3c3yETAP//pPI+G5mvB7qqj1Y5kY=
golang.org/x/oauth2 v0.0.0-20220722155238-128564f6959c/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
Expand Down
1 change: 1 addition & 0 deletions mailcow/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ func Provider() *schema.Provider {
"mailcow_domain": resourceDomain(),
"mailcow_mailbox": resourceMailbox(),
"mailcow_dkim": resourceDkim(),
"mailcow_syncjob": resourceSyncjob(),
},
DataSourcesMap: map[string]*schema.Resource{
"mailcow_domain": dataSourceDomain(),
Expand Down
Loading

0 comments on commit 4e49754

Please sign in to comment.