diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..8baf2f7 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,113 @@ +name: Build and Release + +on: + push: + branches: [ "main" ] + tags: + - 'v*' + pull_request: + branches: [ "main" ] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: '1.21' + cache: true + + - name: Verify dependencies + run: go mod verify + + - name: Build + run: go build -v ./... + + - name: Run tests + run: go test -v ./... + + - name: Run golangci-lint + uses: golangci/golangci-lint-action@v3 + with: + version: latest + + release: + needs: build + runs-on: ubuntu-latest + if: startsWith(github.ref, 'refs/tags/v') + + steps: + - uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: '1.21' + + - name: Create release directories + run: | + mkdir -p release/src + mkdir -p release/binaries + mkdir -p release/dist + + - name: Create source archive + run: | + # Copy source files + cp -r * release/src/ + rm -rf release/src/release # Remove release directory from source + cd release + zip -r "lilmail-${GITHUB_REF#refs/tags/}-src.zip" src/ + + - name: Build binaries + run: | + platforms=("linux-amd64" "linux-arm64" "windows-amd64" "darwin-amd64" "darwin-arm64") + + for platform in "${platforms[@]}" + do + # Split platform into OS and arch + IFS=- read os arch <<< "$platform" + + # Create platform directory + mkdir -p "release/binaries/lilmail-${GITHUB_REF#refs/tags/}-${platform}" + + # Set output name based on OS + if [ "$os" = "windows" ]; then + output="release/binaries/lilmail-${GITHUB_REF#refs/tags/}-${platform}/lilmail.exe" + else + output="release/binaries/lilmail-${GITHUB_REF#refs/tags/}-${platform}/lilmail" + fi + + # Build binary + GOOS=$os GOARCH=$arch go build -o "$output" + + # Copy additional files + cp README.md "release/binaries/lilmail-${GITHUB_REF#refs/tags/}-${platform}/" + cp config.example.toml "release/binaries/lilmail-${GITHUB_REF#refs/tags/}-${platform}/" + + # Create tar.gz or zip + cd release/binaries + if [ "$os" = "windows" ]; then + zip -r "../dist/lilmail-${GITHUB_REF#refs/tags/}-${platform}.zip" "lilmail-${GITHUB_REF#refs/tags/}-${platform}" + else + tar czf "../dist/lilmail-${GITHUB_REF#refs/tags/}-${platform}.tar.gz" "lilmail-${GITHUB_REF#refs/tags/}-${platform}" + fi + cd ../.. + done + + - name: Create Release + id: create_release + uses: softprops/action-gh-release@v1 + with: + files: | + release/dist/*.tar.gz + release/dist/*.zip + release/lilmail-*-src.zip + draft: false + prerelease: false + generate_release_notes: true + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..d825d3b --- /dev/null +++ b/README.md @@ -0,0 +1,118 @@ +# LilMail 📧 + +[![Build Status](https://github.com/exolutionza/lilmail/workflows/build/badge.svg)](https://github.com/exolutionza/lilmail/actions) +[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) +[![Version](https://img.shields.io/github/v/release/yourusername/lilmail)](https://github.com/exolutionza/lilmail/releases) +[![Go Report Card](https://goreportcard.com/badge/github.com/yourusername/lilmail)](https://goreportcard.com/report/github.com/yourusername/lilmail) + +A lightweight, resource-efficient webmail client written in Go, supporting IMAP and SMTP protocols. LilMail emphasizes simplicity and minimal system requirements, with a file-based storage system that eliminates the need for a database. + +## ✨ Features + +- 🚀 **Simple Setup**: Just run the binary - no complex configuration needed +- 💡 **Minimal Resource Usage**: Designed to run on low-end hardware +- 🗄️ **No Database Required**: All data stored efficiently on disk +- 📥 **IMAP Support**: Connect to any IMAP-enabled email server +- 📤 **SMTP Integration**: Send emails through standard SMTP protocols +- 💾 **File-Based Caching**: Reliable storage without external dependencies +- 🔒 **JWT Authentication**: Secure user sessions +- 🔐 **Encryption**: Built-in encryption for sensitive data + +## 🖥️ System Requirements + +- Memory: 64MB RAM minimum +- Storage: Depends on cache size (approximately 1GB recommended) +- OS: Linux, macOS, or Windows + +## 🚀 Quick Start + +```bash +# Clone the repository +git clone https://github.com/exolutionza/lilmail.git + +# Navigate to project directory +cd lilmail + +# Run the application +go run main.go +``` + +## ⚙️ Configuration + +Create a `config.toml` file in the root directory: + +```toml +[imap] +server = "mail.example.com" +port = 993 +tls = true + +[cache] +folder = "./cache" + +[jwt] +secret = "your-secure-jwt-secret" + +[encryption] +key = "your-32-character-encryption-key" + +[smtp] +# If not specified, SMTP server will be derived from IMAP server +server = "mail.example.com" +port = 587 +use_starttls = true +``` + +### Configuration Options Explained + +- **IMAP Settings**: + - `server`: Your IMAP server address + - `port`: IMAP port (typically 993 for SSL/TLS) + - `tls`: Enable/disable TLS connection + +- **Cache Settings**: + - `folder`: Local directory for storing cached mail data + +- **JWT Settings**: + - `secret`: Secret key for JWT token generation + - ⚠️ Change this to a secure random string in production + +- **Encryption Settings**: + - `key`: 32-character key for encrypting sensitive data + - ⚠️ Change this to a secure random key in production + +- **SMTP Settings**: + - `server`: SMTP server address (optional - defaults to IMAP server) + - `port`: SMTP port (typically 587 for STARTTLS) + - `use_starttls`: Enable STARTTLS for SMTP connection + +## 📝 Usage + +1. Configure your `config.toml` file +2. Run the application: +```bash +go run main.go +``` +3. Access the webmail interface at `http://localhost:8080` (default port) + +## 🏗️ Building and Releasing + +To build the project: + +```bash +# Build for current platform +go build -o lilmail + +# Build for specific platforms +GOOS=linux GOARCH=amd64 go build -o lilmail-linux-amd64 +GOOS=windows GOARCH=amd64 go build -o lilmail-windows-amd64.exe +GOOS=darwin GOARCH=amd64 go build -o lilmail-darwin-amd64 +``` + +## 🤝 Contributing + +Contributions are welcome! Please feel free to submit a Pull Request. + +## 📄 License + +This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. \ No newline at end of file diff --git a/sessions/81977815-de24-4348-8c7f-8c914c7265a5.session b/sessions/81977815-de24-4348-8c7f-8c914c7265a5.session new file mode 100644 index 0000000..2f7c656 --- /dev/null +++ b/sessions/81977815-de24-4348-8c7f-8c914c7265a5.session @@ -0,0 +1 @@ +{"value":"DX8EAQL/gAABDAEQAAD+Acb/gAAFDWF1dGhlbnRpY2F0ZWQEYm9vbAICAAEFZW1haWwGc3RyaW5nDBUAE2ltcmFuQGRpZXNlbHMuY28uemEIdXNlcm5hbWUGc3RyaW5nDAcABWltcmFuBXRva2VuBnN0cmluZwz/2wD/2GV5SmhiR2NpT2lKSVV6STFOaUlzSW5SNWNDSTZJa3BYVkNKOS5leUoxYzJWeWJtRnRaU0k2SW1sdGNtRnVJaXdpWlcxaGFXd2lPaUpwYlhKaGJrQmthV1Z6Wld4ekxtTnZMbnBoSWl3aVpYaHdJam94TnpNeE16UTVPREU1TENKdVltWWlPakUzTXpFeU5qTTBNVGtzSW1saGRDSTZNVGN6TVRJMk16UXhPWDAuVmloZmh6NHZtU1R2YlpOTWgwTGZrYTR2cEdVY2JTeGhKZU1ueEd6RXI3dwtjcmVkZW50aWFscwZzdHJpbmcMbgBsd3hNS1EwZ2Nqc2lPMHpkRlpSSmN5dnpSK0ZCaWU3OStoSmtzM3JMK3lzQmh1aFlYelJ5WXhkaExvblJMR2NZWkVJWEZxMUc2aFYyNFQza2pObTc0bE8rU242Zzd4YkVKWXN3eENoVGFmOFdK","expires_at":"2024-11-11T20:30:19.782336153+02:00"} \ No newline at end of file diff --git a/templates/email-view.html b/templates/email-view.html deleted file mode 100644 index 1f513cc..0000000 --- a/templates/email-view.html +++ /dev/null @@ -1,152 +0,0 @@ -
- -
-

{{.Email.Subject}}

- -
-
-
- From: - {{.Email.From}} -
- -
- To: - {{.Email.To}} -
- - {{if .Email.CC}} -
- CC: - {{.Email.CC}} -
- {{end}} -
- -
-
- {{formatDate .Email.Date}} -
-
-
-
- - - {{if .Email.Attachments}} -
-

Attachments

-
- {{range .Email.Attachments}} - - - - - {{.Filename}} - - {{end}} -
-
- {{end}} - - -
- {{if .Email.IsHTML}} -
- {{.Email.Body}} -
- {{else}} -
{{.Email.Body}}
- {{end}} -
- - -
- - - - -
- - - - -
-
-
- - \ No newline at end of file diff --git a/templates/inbox.html b/templates/inbox.html index 2a8e3eb..bae6bca 100644 --- a/templates/inbox.html +++ b/templates/inbox.html @@ -20,7 +20,6 @@
-
-