Compare commits

..

1 Commits

Author SHA1 Message Date
Abhinav Raut
772152c40c fix: filter out empty email message ids for setting email references headers.
chore: adds debug logs.
2025-03-06 12:24:18 +05:30
2 changed files with 5 additions and 1 deletions

View File

@@ -372,7 +372,8 @@ SELECT
source_id
FROM conversation_messages
WHERE conversation_id = $1
AND type in ('incoming', 'outgoing')
AND type in ('incoming', 'outgoing') and private = false
and source_id > ''
ORDER BY id DESC
LIMIT $2;

View File

@@ -115,11 +115,13 @@ func (e *Email) Send(m models.Message) error {
// Set In-Reply-To header
if m.InReplyTo != "" {
email.Headers.Set(headerInReplyTo, "<"+m.InReplyTo+">")
e.lo.Debug("In-Reply-To header set", "message_id", m.InReplyTo)
}
// Set message id header
if m.SourceID.String != "" {
email.Headers.Set(headerMessageID, fmt.Sprintf("<%s>", m.SourceID.String))
e.lo.Debug("Message-ID header set", "message_id", m.SourceID.String)
}
// Set references header
@@ -127,6 +129,7 @@ func (e *Email) Send(m models.Message) error {
for _, ref := range m.References {
references += "<" + ref + "> "
}
e.lo.Debug("References header set", "references", references)
email.Headers.Set(headerReferences, references)
// Set email content