mandi 60386c9be7 | ||
---|---|---|
test | ||
types | ||
.gitignore | ||
README.md | ||
go.mod | ||
go.sum | ||
godovecot.go |
README.md
godovecot
Functions
CreatePacket
See for Details
Usage
RestoreMail(a ...IPacket)
ResroreMail(a ...IPacket)
is implemented as variadic to be able to pass parameters as different types implementing the IPacket
interface:
- PacketValues
- For passing strings of the account to create
- FullPacket
- For passing directing a created xml Packet
- Packet needs to be passed by appending the slice directly
fullPacket.Packets = append(fullPacket.Packets, &newPacket)
- FilePacket
- For passing the path to a .json backup file
logIn()
The logIn is done in several steps
- Checks if serialized
server
struct is avalaible- If serialization is available
- Checks if
ApiKey
is set- If it is set the is passed to used server struct
- If not set
callApiKey()
is called to get a valid API-Key
- Checks if
- If serialization is available
- If serialization is not available
callApiKey()
is called to get a valid API-Key- Called API-Key is passed to the used
server
instance - User
server
instance is serialized to file
Information
Keys
Needs ssh keys.
To genarate keys
- On local machine
ssh-keygen -t rsa -b 4096
ssh-copy-id root@89.22.111.212
- Enter ssh-password to "register" ssh-key on server
Helping links
The module needs also to run in a Docker container. To do so the container -as a unique client- needs to have it's "own" ssh-key.
There are two ways to to that.
- Create an ssh key on first start of the program For this the steps described in the section Keys must be implemented in Go to store an ssh key to the container and to "register" this key to ther server
- Use the ssh key of the host
For using .ssh keys of the host in Docker see here:
https://medium.com/trabe/use-your-local-ssh-keys-inside-a-docker-container-ea1d117515dc
Restore
- Upload synced folder to server
- Change ownership of uploaded folder to dovecot user
chown -R popuser:popuser ververis.eu
Backup accounts
- Dialing to server with ssh
- Creating output of dovecot mail accounts including passwords
/usr/local/psa/admin/sbin/mail_auth_view
- Read in the output as .csv and parse to an array of accounts
- Save file as .json