Skip to content

Missing email body when using sendmail #18024

Closed
@ben-kenney

Description

@ben-kenney

Gitea Version

1.15.7

Git Version

No response

Operating System

alpine linux (using the official gitea docker image)

How are you running Gitea?

Through the official gitea docker image

Database

PostgreSQL

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

https://gist.github.com/ben-kenney/8fc6715ffd2a6c5721469772957dba2e

Description

I've configured my gitea to use sendmail. I receive email notifications but they are all missing the message body and only contain the subject line.

When I log into my gitea docker container and manually check to see if sendmail is working, I can confirm that sendmail does work BUT it requires a blank line between the subject and the message body, like this:

$ sendmail -S mail.host.com [email protected]
Subject: this is the subject

The message body only appears if it follows a blank line.

The blank line before the message body appears to be important otherwise sendmail will not inlcude the message body, this is documented elsewhere (sorry I couldn't find anything more official than the linked response).

I'm curious to know if this could be the reason why I'm not able to see the email messages from gitea.

I think that emails such as this test email from gitea should likely need \n\n in front of the message body when using sendmail.

return gomail.Send(Sender, NewMessage([]string{email}, "Gitea Test Email!", "Gitea Test Email!").ToMessage())

Screenshots

Here's a screenshot of the email that I received from gitea after posting a test comment (note that the message body is blank).

gitea_email

Metadata

Metadata

Assignees

No one assigned

    Labels

    issue/needs-feedbackFor bugs, we need more details. For features, the feature must be described in more detail

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions