aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJordan <me@jordan.im>2023-02-05 23:14:29 -0700
committerJordan <me@jordan.im>2023-02-05 23:14:29 -0700
commit8289fa9dba760089d7839f8103d81877822a6f68 (patch)
tree77d9f264602c091d7fc5bde756a77dd528847075
parent805b4e4e6f7716b730a7fc0b5ff8540660c30b8c (diff)
downloadpigeon-8289fa9dba760089d7839f8103d81877822a6f68.tar.gz
pigeon-8289fa9dba760089d7839f8103d81877822a6f68.zip
pigeon: populate message content from EML over JSON
-rw-r--r--message.eml.example2
-rw-r--r--pigeon.go3
-rw-r--r--pigeon.json.example3
3 files changed, 2 insertions, 6 deletions
diff --git a/message.eml.example b/message.eml.example
index 041a56e..9f463c1 100644
--- a/message.eml.example
+++ b/message.eml.example
@@ -5,4 +5,4 @@ Date: {{.Date}}
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
-{{.Message}}
+Message content goes here.
diff --git a/pigeon.go b/pigeon.go
index c169129..0ba8139 100644
--- a/pigeon.go
+++ b/pigeon.go
@@ -27,7 +27,6 @@ type Config struct {
SMTPServer string `json:"smtp-server"`
SMTPEmail string `json:"smtp-email"`
SMTPPass string `json:"smtp-pass"`
- Message string `json:"message"`
Cooldown string `json:"cooldown"`
IgnoreAlias bool `json:"ignore-alias"`
}
@@ -38,7 +37,6 @@ type Email struct {
FromEmail string
Subject string
Date string
- Message string
}
type worker struct {
@@ -229,7 +227,6 @@ func (w *worker) handleUpdate(update *client.MailboxUpdate) {
FromName: w.config.FromName,
Subject: w.config.Subject,
Date: time.Now().Format(time.RFC1123Z),
- Message: w.config.Message,
}
if prevSend, exists := w.seen.emails[eml.ToEmail]; exists {
log.Println("Address exists, checking time...")
diff --git a/pigeon.json.example b/pigeon.json.example
index dcd91e6..5f37875 100644
--- a/pigeon.json.example
+++ b/pigeon.json.example
@@ -9,6 +9,5 @@
"smtp-email": "john@example.com",
"smtp-pass": "password",
"cooldown": "24h",
- "ignore-alias": true,
- "message": "Hello,\r\n\r\nSorry I missed you!\r\n\r\nJohn",
+ "ignore-alias": true
}