[GH-ISSUE #31] Search broken #28

Closed
opened 2026-03-15 12:11:31 +03:00 by kerem · 6 comments
Owner

Originally created by @yonas on GitHub (Jan 11, 2023).
Original GitHub issue: https://github.com/axllent/mailpit/issues/31

INFO[2023/01/10 22:48:43] [smtp] starting on 0.0.0.0:1025              
INFO[2023/01/10 22:48:43] [http] starting server on http://0.0.0.0:8025/ 
ERRO[2023/01/10 22:52:10] sql: Scan error on column index 5, name "FromJSON": converting NULL to string is unsupported 

go version go1.19.4 freebsd/amd64
mailpit version: 47a556d05e

Originally created by @yonas on GitHub (Jan 11, 2023). Original GitHub issue: https://github.com/axllent/mailpit/issues/31 ``` INFO[2023/01/10 22:48:43] [smtp] starting on 0.0.0.0:1025 INFO[2023/01/10 22:48:43] [http] starting server on http://0.0.0.0:8025/ ERRO[2023/01/10 22:52:10] sql: Scan error on column index 5, name "FromJSON": converting NULL to string is unsupported ``` go version go1.19.4 freebsd/amd64 mailpit version: 47a556d05e68f4ce59548ea423b11dcad9ea2830
kerem 2026-03-15 12:11:31 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@axllent commented on GitHub (Jan 11, 2023):

Thanks for the report.

This was briefly an issue before v1.2.8 which should have been fixed in early November last year.

Could you please provide me some more information @yonas ...

Do you currently have old emails in your database what may have been capture before v1.2.8?

If some of your captured mail was from < v1.2.8 then there isn't anything I can do about it unfortunately as the data was stored as a null when there was no From address, rather than an empty JSON object (this breaks the SQL JSON search which is the error you are seeing) :-( If it was captured in v1.3.5 recently, can you please provide me with a copy of the full email (even if you change the values) so I can test please - assuming you can work out which one it is?

<!-- gh-comment-id:1378470724 --> @axllent commented on GitHub (Jan 11, 2023): Thanks for the report. This was briefly an issue _before_ v1.2.8 which should have been [fixed](https://github.com/axllent/mailpit/commit/ba24d145ffcbf8920889f27d85087b3498c0df4e) in early November last year. Could you please provide me some more information @yonas ... Do you currently have old emails in your database what may have been capture before v1.2.8? If some of your captured mail was from < v1.2.8 then there isn't anything I can do about it unfortunately as the data was stored as a `null` when there was no From address, rather than an empty JSON object (this breaks the SQL JSON search which is the error you are seeing) :-( If it was captured in v1.3.5 recently, can you please provide me with a copy of the full email (even if you change the values) so I can test please - assuming you can work out which one it is?
Author
Owner

@yonas commented on GitHub (Jan 11, 2023):

Hi @axllent

Do you currently have old emails in your database what may have been capture before v1.2.8?

No, this is a fresh install.

<!-- gh-comment-id:1379423728 --> @yonas commented on GitHub (Jan 11, 2023): Hi @axllent > Do you currently have old emails in your database what may have been capture before v1.2.8? No, this is a fresh install.
Author
Owner

@axllent commented on GitHub (Jan 11, 2023):

@yonas Do you happen to know what email is causing this, and if so, are you able to provide me a copy of the raw email itself?

<!-- gh-comment-id:1379499494 --> @axllent commented on GitHub (Jan 11, 2023): @yonas Do you happen to know what email is causing this, and if so, are you able to provide me a copy of the raw email itself?
Author
Owner

@yonas commented on GitHub (Jan 11, 2023):

@axllent

Here's a copy of the email. I sent it manually via telnet.

Received: from  (localhost [127.0.0.1])
        by build.lan (Mailpit) with SMTP
        for <sarah@np.com>; Wed, 11 Jan 2023 16:52:03 -0500 (EST)
Subject: test 1

hello world
$ telnet localhost 1026
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 build.lan Mailpit ESMTP Service ready
ehlo
250-build.lan greets 
250-SIZE 0
250 ENHANCEDSTATUSCODES
mail from:<john.doe@np.com>
250 2.1.0 Ok
rcpt to:<sarah@np.com>
250 2.1.5 Ok
data
354 Start mail input; end with <CR><LF>.<CR><LF>
Subject: test 1

hello world
.
250 2.0.0 Ok: queued
quit
221 2.0.0 build.lan Mailpit ESMTP Service closing transmission channel
Connection closed by foreign host.
<!-- gh-comment-id:1379534959 --> @yonas commented on GitHub (Jan 11, 2023): @axllent Here's a copy of the email. I sent it manually via telnet. ``` Received: from (localhost [127.0.0.1]) by build.lan (Mailpit) with SMTP for <sarah@np.com>; Wed, 11 Jan 2023 16:52:03 -0500 (EST) Subject: test 1 hello world ``` ``` $ telnet localhost 1026 Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. 220 build.lan Mailpit ESMTP Service ready ehlo 250-build.lan greets 250-SIZE 0 250 ENHANCEDSTATUSCODES mail from:<john.doe@np.com> 250 2.1.0 Ok rcpt to:<sarah@np.com> 250 2.1.5 Ok data 354 Start mail input; end with <CR><LF>.<CR><LF> Subject: test 1 hello world . 250 2.0.0 Ok: queued quit 221 2.0.0 build.lan Mailpit ESMTP Service closing transmission channel Connection closed by foreign host. ```
Author
Owner

@axllent commented on GitHub (Jan 12, 2023):

Thanks for the feedback! From what I can tell, all emails should contain a From: header - however the RFC documentation is very difficult to read and isn't crystal clear (to me) as to what exactly it should contain. Anyway, I was able to replicate the issue on my end following your instructions and have just pushed a fix for it to correctly index a missing From header. You'll find the fix in the latest release (v1.3.6).

<!-- gh-comment-id:1379758613 --> @axllent commented on GitHub (Jan 12, 2023): Thanks for the feedback! From what I can tell, all emails should contain a `From:` header - however the RFC documentation is very difficult to read and isn't crystal clear (to me) as to what exactly it should contain. Anyway, I was able to replicate the issue on my end following your instructions and have just pushed a fix for it to correctly index a missing From header. You'll find the fix in the latest release (v1.3.6).
Author
Owner

@yonas commented on GitHub (Jan 12, 2023):

Thanks @axllent , it works! 🥳

<!-- gh-comment-id:1381062388 --> @yonas commented on GitHub (Jan 12, 2023): Thanks @axllent , it works! :partying_face:
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/mailpit#28
No description provided.