Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 35 additions & 48 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,55 +88,46 @@ jobs:
- name: Create bin directory
run: mkdir -p bin

- name: Build all tools
- name: Build binary
env:
GOARCH: ${{ matrix.goarch }}
run: |
go build -ldflags="-s -w" -o bin/msgraphtool${{ matrix.ext }} ./cmd/msgraphtool
go build -ldflags="-s -w" -o bin/smtptool${{ matrix.ext }} ./cmd/smtptool
go build -ldflags="-s -w" -o bin/imaptool${{ matrix.ext }} ./cmd/imaptool
go build -ldflags="-s -w" -o bin/pop3tool${{ matrix.ext }} ./cmd/pop3tool
go build -ldflags="-s -w" -o bin/jmaptool${{ matrix.ext }} ./cmd/jmaptool
go build -ldflags="-s -w" -o bin/gomailtest${{ matrix.ext }} ./cmd/gomailtest

- name: Verify build output (Windows)
if: matrix.os == 'windows-latest'
run: |
$tools = @("msgraphtool", "smtptool", "imaptool", "pop3tool", "jmaptool")
foreach ($tool in $tools) {
$binary = "bin\$tool${{ matrix.ext }}"
if (Test-Path $binary) {
Write-Host "✓ $tool build successful"
Get-Item $binary | Select-Object Name, Length
} else {
Write-Error "✗ $tool build failed"
exit 1
}
$binary = "bin\gomailtest${{ matrix.ext }}"
if (Test-Path $binary) {
Write-Host "✓ gomailtest build successful"
Get-Item $binary | Select-Object Name, Length
} else {
Write-Error "✗ gomailtest build failed"
exit 1
}

- name: Verify build output (Linux/macOS)
if: matrix.os != 'windows-latest'
run: |
for tool in msgraphtool smtptool imaptool pop3tool jmaptool; do
if [ -f "bin/$tool${{ matrix.ext }}" ]; then
echo "✓ $tool build successful"
ls -lh "bin/$tool${{ matrix.ext }}"
else
echo "✗ $tool build failed"
exit 1
fi
done
if [ -f "bin/gomailtest${{ matrix.ext }}" ]; then
echo "✓ gomailtest build successful"
ls -lh "bin/gomailtest${{ matrix.ext }}"
else
echo "✗ gomailtest build failed"
exit 1
fi

- name: Create ZIP archive (Windows)
if: matrix.os == 'windows-latest'
run: |
Compress-Archive -Path bin\msgraphtool${{ matrix.ext }},bin\smtptool${{ matrix.ext }},bin\imaptool${{ matrix.ext }},bin\pop3tool${{ matrix.ext }},bin\jmaptool${{ matrix.ext }},README.md,IMAPTOOL_README.md,JMAPTOOL_README.md,MSGRAPHTOOL_README.md,POP3TOOL_README.md,SMTP_TOOL_README.md,EXAMPLES.md,LICENSE -DestinationPath ${{ matrix.zip_name }}
Compress-Archive -Path bin\gomailtest${{ matrix.ext }},README.md,IMAPTOOL_README.md,JMAPTOOL_README.md,MSGRAPHTOOL_README.md,POP3TOOL_README.md,SMTP_TOOL_README.md,EXAMPLES.md,LICENSE -DestinationPath ${{ matrix.zip_name }}
Write-Host "Created ZIP archive: ${{ matrix.zip_name }}"
Get-Item ${{ matrix.zip_name }} | Select-Object Name, Length

- name: Create ZIP archive (Linux/macOS)
if: matrix.os != 'windows-latest'
run: |
cd bin && zip ../${{ matrix.zip_name }} msgraphtool${{ matrix.ext }} smtptool${{ matrix.ext }} imaptool${{ matrix.ext }} pop3tool${{ matrix.ext }} jmaptool${{ matrix.ext }} && cd ..
cd bin && zip ../${{ matrix.zip_name }} gomailtest${{ matrix.ext }} && cd ..
zip -u ${{ matrix.zip_name }} README.md IMAPTOOL_README.md JMAPTOOL_README.md MSGRAPHTOOL_README.md POP3TOOL_README.md SMTP_TOOL_README.md EXAMPLES.md LICENSE
echo "Created ZIP archive: ${{ matrix.zip_name }}"
ls -lh ${{ matrix.zip_name }}
Expand All @@ -158,12 +149,8 @@ jobs:

### What's Included

Each ZIP archive contains 5 tools:
- **msgraphtool** - Microsoft Graph API tool for Exchange Online
- **smtptool** - SMTP connectivity and TLS testing
- **imaptool** - IMAP server testing with XOAUTH2 support
- **pop3tool** - POP3 server testing with XOAUTH2 support
- **jmaptool** - JMAP protocol testing
Each ZIP archive contains a single unified binary:
- **gomailtest** - Unified CLI for all protocols (smtp, imap, pop3, jmap, msgraph subcommands)

Plus documentation:
- **README.md** - Main documentation
Expand All @@ -176,68 +163,68 @@ jobs:
**Windows (amd64):**
1. Download `gomailtesttool-windows-amd64.zip`
2. Extract the ZIP file
3. Run any tool directly (e.g., `smtptool.exe -help`)
3. Run: `gomailtest.exe --help`

**Linux (amd64):**
1. Download `gomailtesttool-linux-amd64.zip`
2. Extract: `unzip gomailtesttool-linux-amd64.zip`
3. Make executable: `chmod +x *tool`
4. Run: `./smtptool -help`
3. Make executable: `chmod +x gomailtest`
4. Run: `./gomailtest --help`

**macOS (Apple Silicon/arm64):**
1. Download `gomailtesttool-macos-arm64.zip`
2. Extract: `unzip gomailtesttool-macos-arm64.zip`
3. Make executable: `chmod +x *tool`
4. Run: `./smtptool -help`
3. Make executable: `chmod +x gomailtest`
4. Run: `./gomailtest --help`

**Note for macOS:** If you see "cannot be opened because the developer cannot be verified":
- Right-click the binary and select "Open", or
- Run: `xattr -d com.apple.quarantine *tool`
- Run: `xattr -d com.apple.quarantine gomailtest`

### Quick Start Examples

**SMTP Testing:**
```bash
# Test connectivity
./smtptool -action testconnect -host smtp.example.com -port 25
./gomailtest smtp testconnect -host smtp.example.com -port 25

# TLS diagnostics
./smtptool -action teststarttls -host smtp.example.com -port 587
./gomailtest smtp teststarttls -host smtp.example.com -port 587
```

**IMAP Testing:**
```bash
# Test connection
./imaptool -action testconnect -host imap.gmail.com -imaps
./gomailtest imap testconnect -host imap.gmail.com -imaps

# List folders with OAuth2
./imaptool -action listfolders -host imap.gmail.com -imaps \
./gomailtest imap listfolders -host imap.gmail.com -imaps \
-username user@gmail.com -accesstoken "ya29..."
```

**POP3 Testing:**
```bash
# Test connection
./pop3tool -action testconnect -host pop.gmail.com -pop3s
./gomailtest pop3 testconnect -host pop.gmail.com -pop3s

# List mail
./pop3tool -action listmail -host pop.gmail.com -pop3s \
./gomailtest pop3 listmail -host pop.gmail.com -pop3s \
-username user@gmail.com -password "app-password"
```

**JMAP Testing:**
```bash
# Discover session
./jmaptool -action testconnect -host jmap.fastmail.com
./gomailtest jmap testconnect -host jmap.fastmail.com

# Get mailboxes
./jmaptool -action getmailboxes -host jmap.fastmail.com \
./gomailtest jmap getmailboxes -host jmap.fastmail.com \
-username user@fastmail.com -accesstoken "token"
```

**Microsoft Graph:**
```bash
./msgraphtool -tenantid "..." -clientid "..." -secret "..." \
./gomailtest msgraph -tenantid "..." -clientid "..." -secret "..." \
-mailbox "user@example.com" -action getinbox
```

Expand Down
Loading