Dateien nach "/" hochladen
This commit is contained in:
@@ -1,137 +1,70 @@
|
|||||||
# SMTPGraphRelay V1.5 – Log-Rotation
|
# SMTPGraphRelay 1.5.0
|
||||||
|
|
||||||
V1.5 erweitert V1.4 um automatische Log-Rotation und Log-Aufbewahrung.
|
Ab dieser Version gibt es **keinen `payload`-Ordner mehr**.
|
||||||
|
|
||||||
## Standardverhalten
|
Alle Release-Dateien liegen genau einmal nebeneinander:
|
||||||
|
|
||||||
Ohne Änderungen an `config.json` gelten:
|
|
||||||
|
|
||||||
```text
|
```text
|
||||||
MaxFileSizeMB = 10
|
SMTPGraphRelay-v1.5.0\
|
||||||
RetentionDays = 30
|
├── Setup-SMTPGraphRelay.ps1
|
||||||
CleanupHours = 12
|
├── SMTPGraphRelay.ps1
|
||||||
|
├── Test-SMTPGraphRelay.ps1
|
||||||
|
├── Renew-SMTPGraphRelayCertificate.ps1
|
||||||
|
└── version.json
|
||||||
```
|
```
|
||||||
|
|
||||||
Das aktive Log bleibt:
|
## Warum
|
||||||
|
|
||||||
|
Der Manager kopiert bei Neuinstallation, Repair und Update immer die Dateien,
|
||||||
|
die direkt neben `Setup-SMTPGraphRelay.ps1` liegen.
|
||||||
|
|
||||||
|
Dadurch gibt es keine zweite Kopie von `SMTPGraphRelay.ps1`, die bei neuen
|
||||||
|
Versionen versehentlich veraltet bleiben könnte.
|
||||||
|
|
||||||
|
## Update
|
||||||
|
|
||||||
|
Ein neues Release wird künftig einfach als neuer Ordner/ZIP gebaut:
|
||||||
|
|
||||||
```text
|
```text
|
||||||
logs\SMTPGraphRelay.log
|
SMTPGraphRelay-v1.6.0.zip
|
||||||
```
|
```
|
||||||
|
|
||||||
Sobald es 10 MB erreicht, wird es z. B. umbenannt in:
|
Darin liegen jeweils genau die aktuellen Dateien.
|
||||||
|
|
||||||
|
Dann:
|
||||||
|
|
||||||
|
```powershell
|
||||||
|
.\Setup-SMTPGraphRelay.ps1
|
||||||
|
```
|
||||||
|
|
||||||
|
und Menüpunkt:
|
||||||
|
|
||||||
```text
|
```text
|
||||||
logs\SMTPGraphRelay-20260813-231500.log
|
[3] Relay aktualisieren
|
||||||
```
|
```
|
||||||
|
|
||||||
Danach wird automatisch eine neue `SMTPGraphRelay.log` begonnen.
|
Der Manager liest `version.json` und zeigt:
|
||||||
|
|
||||||
Archiv-Logs, die älter als 30 Tage sind, werden automatisch entfernt.
|
```text
|
||||||
|
Paketversion: 1.6.0
|
||||||
## Optionale Konfiguration
|
Installierte Version: 1.5.0
|
||||||
|
|
||||||
Die bestehende Config funktioniert unverändert.
|
|
||||||
|
|
||||||
Optional kann auf Root-Ebene ergänzt werden:
|
|
||||||
|
|
||||||
```json
|
|
||||||
"Logging": {
|
|
||||||
"MaxFileSizeMB": 10,
|
|
||||||
"RetentionDays": 30,
|
|
||||||
"CleanupHours": 12
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Beim Update wird die vorhandene `SMTPGraphRelay.ps1` weiterhin mit Zeitstempel
|
||||||
|
gesichert. `config.json`, Queue, Logs, Zertifikat, Entra-App und Exchange-RBAC
|
||||||
|
bleiben erhalten.
|
||||||
|
|
||||||
|
## version.json
|
||||||
|
|
||||||
Beispiel:
|
Beispiel:
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"Smtp": {
|
"Version": "1.5.0",
|
||||||
"ListenAddress": "0.0.0.0",
|
"Product": "SMTPGraphRelay",
|
||||||
"Port": 2525,
|
"MinimumPowerShell": "5.1",
|
||||||
"Hostname": "SMTPRELAY01",
|
"ReleaseDate": "2026-08-13"
|
||||||
"AllowedNetworks": [
|
|
||||||
"127.0.0.1/32",
|
|
||||||
"10.0.0.0/8"
|
|
||||||
],
|
|
||||||
"MaxMessageSizeMB": 25,
|
|
||||||
"ClientTimeoutSeconds": 120,
|
|
||||||
"MaxConcurrentClients": 20
|
|
||||||
},
|
|
||||||
"Graph": {
|
|
||||||
"TenantId": "...",
|
|
||||||
"ClientId": "...",
|
|
||||||
"CertificateThumbprint": "...",
|
|
||||||
"SenderMailbox": "info@example.com",
|
|
||||||
"ForceSender": true
|
|
||||||
},
|
|
||||||
"Queue": {
|
|
||||||
"PollSeconds": 10,
|
|
||||||
"MaxRetries": 8,
|
|
||||||
"RetryMinutes": [1,5,15,30,60,120,240,480]
|
|
||||||
},
|
|
||||||
"Paths": {
|
|
||||||
"Queue": "queue",
|
|
||||||
"Failed": "failed",
|
|
||||||
"Logs": "logs"
|
|
||||||
},
|
|
||||||
"Logging": {
|
|
||||||
"MaxFileSizeMB": 10,
|
|
||||||
"RetentionDays": 30,
|
|
||||||
"CleanupHours": 12
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
## Parallel-sicher
|
Die Datei wird mit installiert und dient dem Manager als Versionsmarker.
|
||||||
|
|
||||||
V1.5 verwendet weiterhin den benannten Mutex:
|
|
||||||
|
|
||||||
```text
|
|
||||||
Local\SMTPGraphRelay-Log
|
|
||||||
```
|
|
||||||
|
|
||||||
Rotation und Schreiben passieren innerhalb desselben Locks. Dadurch können parallele
|
|
||||||
SMTP-Runspaces und der Queue-/Graph-Worker nicht gleichzeitig dieselbe Logdatei
|
|
||||||
rotieren oder beschreiben.
|
|
||||||
|
|
||||||
## Update von V1.4
|
|
||||||
|
|
||||||
```powershell
|
|
||||||
Stop-ScheduledTask -TaskName "SMTPGraphRelay"
|
|
||||||
|
|
||||||
Copy-Item `
|
|
||||||
"C:\Program Files\SMTPGraphRelay\SMTPGraphRelay.ps1" `
|
|
||||||
"C:\Program Files\SMTPGraphRelay\SMTPGraphRelay-V1.4-backup.ps1"
|
|
||||||
```
|
|
||||||
|
|
||||||
Dann V1.5 als:
|
|
||||||
|
|
||||||
```text
|
|
||||||
C:\Program Files\SMTPGraphRelay\SMTPGraphRelay.ps1
|
|
||||||
```
|
|
||||||
|
|
||||||
ablegen und:
|
|
||||||
|
|
||||||
```powershell
|
|
||||||
Start-ScheduledTask -TaskName "SMTPGraphRelay"
|
|
||||||
```
|
|
||||||
|
|
||||||
Im Log sollte beim Start u. a. erscheinen:
|
|
||||||
|
|
||||||
```text
|
|
||||||
SMTPGraphRelay V1.5 gestartet ...
|
|
||||||
Log-Rotation: max. 10 MB pro Datei, Aufbewahrung 30 Tage.
|
|
||||||
```
|
|
||||||
|
|
||||||
## Hinweis
|
|
||||||
|
|
||||||
Nur archivierte Dateien im Muster
|
|
||||||
|
|
||||||
```text
|
|
||||||
SMTPGraphRelay-*.log
|
|
||||||
```
|
|
||||||
|
|
||||||
werden automatisch gelöscht.
|
|
||||||
|
|
||||||
Die aktuell aktive `SMTPGraphRelay.log` wird nie durch die Retention-Regel gelöscht.
|
|
||||||
|
|||||||
+1015
-255
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user