https://github.com/alfiosalanitri/imapsync-docker
A minimal Docker image to synchronize emails between two IMAP mailboxes using imapsync
https://github.com/alfiosalanitri/imapsync-docker
docker imapsync sysadmin-tool
Last synced: 22 days ago
JSON representation
A minimal Docker image to synchronize emails between two IMAP mailboxes using imapsync
- Host: GitHub
- URL: https://github.com/alfiosalanitri/imapsync-docker
- Owner: alfiosalanitri
- License: mit
- Created: 2025-06-06T07:34:49.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2025-06-06T09:40:52.000Z (12 months ago)
- Last Synced: 2025-06-21T11:10:04.586Z (11 months ago)
- Topics: docker, imapsync, sysadmin-tool
- Language: Shell
- Homepage:
- Size: 6.84 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# imapsync-docker
π οΈ A minimal Docker image to synchronize emails between two IMAP mailboxes using `imapsync`.
Published on GitHub Container Registry:
π `ghcr.io/alfiosalanitri/imapsync-docker`
---
## π Features
- Based on Alpine for a lightweight image
- Includes imapsync and required dependencies
- Simple `.env`-based configuration
- Ready for CI/CD with versioned tags
---
## π¦ Usage
```bash
cp .env.example .env
```
2. **Edit `.env` with your mailbox credentials**:
```ini
USER_1=user@host1.it
PASSWORD_1=yourpassword
HOST_1=imap.host1.it
SSL_1=yes
USER_2=user@host2.it
PASSWORD_2=yourpassword
HOST_2=imap.host2.it
SSL_2=yes
```
| Variable | Required | Description |
| ------------ | -------- | ------------------------------------- |
| `HOST_1` | β
| Source IMAP server hostname or IP |
| `USER_1` | β
| Source mailbox login |
| `PASSWORD_1` | β
| Source mailbox password |
| `SSL_1` | β | Set to `yes` to enable SSL for source |
| `HOST_2` | β
| Target IMAP server hostname or IP |
| `USER_2` | β
| Target mailbox login |
| `PASSWORD_2` | β
| Target mailbox password |
| `SSL_2` | β | Set to `yes` to enable SSL for target |
3. **Run**:
```bash
docker run --rm --env-file .env ghcr.io/alfiosalanitri/imapsync-docker:latest
```
### π Usage Notes
When running on Arch Linux with rootless Docker, hostname resolution (e.g. mail.example.com) may not work due to systemd-resolved or DNS configuration in the user namespace.
β
As a workaround, use the serverβs IP address instead of its DNS name in HOST_1 and HOST_2.
---
## π οΈ Build Locally
```bash
docker build -t imapsync-docker .
docker run --rm --env-file .env imapsync-docker
```
---
> Recommended for production use.
---
## 𧬠Release Workflow
1. Commit your changes.
2. Run the release script with a semver tag:
```bash
./release.sh v1.0.0
```
This will:
- Commit (if needed)
- Tag the commit
- Push the tag
- Trigger GitHub Actions to publish the image as:
- `ghcr.io/alfiosalanitri/imapsync-docker:v1.0.0`
- `...:latest`
---
## π Files
- `Dockerfile`: Builds the imapsync container.
- `entrypoint.sh`: Sync logic.
- `.env.example`: Example env file.
- `release.sh`: Automates release & tagging.
- `.github/workflows/publish.yml`: Publishes images to GHCR.
---
## π Security Notes
Never commit your .env file.
For production use, consider using Docker secrets or environment injection tools.
---
## π Built With
[imapsync](https://imapsync.lamiral.info/) β IMAP synchronization utility
[Alpine Linux](https://alpinelinux.org/) β small base image
[Docker Compose](https://docs.docker.com/compose/) β simple orchestration
---
## π License
This project is licensed under the MIT License β see the [LICENSE](./LICENSE) file for details.
---
## π€ Contributing
Feel free to open issues or submit pull requests to improve functionality, automation, or performance.
---
## π‘ Inspiration
Originally created to simplify email migrations and backups for developers and sysadmins using Docker.