https://github.com/libdns/mailinabox
https://github.com/libdns/mailinabox
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/libdns/mailinabox
- Owner: libdns
- License: mit
- Created: 2023-10-16T22:21:36.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-05-17T20:21:02.000Z (about 1 year ago)
- Last Synced: 2025-05-17T20:29:41.299Z (about 1 year ago)
- Language: Go
- Size: 2.93 KB
- Stars: 2
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[Mail-In-A-Box](https://mailinabox.email/) custom DNS API provider
=======================
[](https://pkg.go.dev/github.com/libdns/mailinabox)
This package implements the [libdns interfaces](https://github.com/libdns/libdns) for [Mail-In-A-Box](https://mailinabox.email/) custom DNS API,
allowing you to manage DNS records.
```go
import (
"context"
"fmt"
"github.com/libdns/mailinabox"
)
func GetSubDomains() []string {
zone := "[your mailinabox root domain]." // <- note the trailing .
provider := &mailinabox.Provider{
APIURL: "https://[your mailinabox box]/admin",
EmailAddress: "[create a special account on your box for managing domains]",
Password: "[password of the special dns account]",
TOTPSecret: "[TOTP secret for multifactor authentication]",
}
records, err := provider.GetRecords(context.TODO(), zone)
if err != nil {
fmt.Printf("Error fetching records: %s", err)
return nil
}
subDomains := make([]string, len(records))
for i, record := range records {
subDomains[i] = record.Name
}
return subDomains
}
```