[PR #355] [MERGED] Implement sendmail #15331

Closed
opened 2025-11-02 11:44:11 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/go-gitea/gitea/pull/355
Author: @couling
Created: 12/5/2016
Status: Merged
Merged: 12/25/2016
Merged by: @bkcsoft

Base: masterHead: implement-sendmail


📝 Commits (8)

  • 41461aa Implemented sendmail. This piggybacks on existing configuration to keep the change simple
  • 6f30061 Changed privicy of new sendSMTP and sendSendmail functions
  • fcfedd2 Fixed Lint errors
  • 7f2f1ee Seperated SMTP and sendmail into their own senders
  • 38bf2ec Making new structs private as they should not be used externally now
  • 1222109 Added sendmail setting to ini file
  • 491d81f Minor code cleanup
  • 33c7574 Fixed conflict between sendmail and gitea-master branches

📊 Changes

4 files changed (+73 additions, -10 deletions)

View changed files

📝 conf/app.ini (+4 -0)
📝 models/mail.go (+1 -1)
📝 modules/mailer/mailer.go (+54 -6)
📝 modules/setting/setting.go (+14 -3)

📄 Description

Implemented sendmail as an alternative to SMTP.
A number of gogs users have requested the ability to use sendmail as an alternative to SMTP: https://github.com/gogits/gogs/issues/997
For some users setting up SMTP accounts for gogs is a lot more trouble than it's worth.

To keep this change simple I've not added any addational configuration parameter. Instead I've reused the SMTP host. If this contains a "/" then it will be interpreted as the location of the sendmail binary. This is safe because hostnames can't contain slashes.

Other fields such as username and password will be ignored for sendmail.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/go-gitea/gitea/pull/355 **Author:** [@couling](https://github.com/couling) **Created:** 12/5/2016 **Status:** ✅ Merged **Merged:** 12/25/2016 **Merged by:** [@bkcsoft](https://github.com/bkcsoft) **Base:** `master` ← **Head:** `implement-sendmail` --- ### 📝 Commits (8) - [`41461aa`](https://github.com/go-gitea/gitea/commit/41461aaa462e21b353fac2ab6a981ee1e96de472) Implemented sendmail. This piggybacks on existing configuration to keep the change simple - [`6f30061`](https://github.com/go-gitea/gitea/commit/6f3006165d35c0a940cbe4cf94da1fb7c141ee15) Changed privicy of new sendSMTP and sendSendmail functions - [`fcfedd2`](https://github.com/go-gitea/gitea/commit/fcfedd24ba6d906be915758f1b6629d41f0a67dd) Fixed Lint errors - [`7f2f1ee`](https://github.com/go-gitea/gitea/commit/7f2f1ee76880a1ba848b6e324fc8fd6159b2f02f) Seperated SMTP and sendmail into their own senders - [`38bf2ec`](https://github.com/go-gitea/gitea/commit/38bf2ec9f0f2d563e0aa55a639987a9459bf87fa) Making new structs private as they should not be used externally now - [`1222109`](https://github.com/go-gitea/gitea/commit/12221096e6864699971893d318512dbbd95ff25d) Added sendmail setting to ini file - [`491d81f`](https://github.com/go-gitea/gitea/commit/491d81f12f0664c0de1dd6d0d3b10408a9d77ed2) Minor code cleanup - [`33c7574`](https://github.com/go-gitea/gitea/commit/33c75742dcf0b9ea12f0e83906365965992d1eb8) Fixed conflict between sendmail and gitea-master branches ### 📊 Changes **4 files changed** (+73 additions, -10 deletions) <details> <summary>View changed files</summary> 📝 `conf/app.ini` (+4 -0) 📝 `models/mail.go` (+1 -1) 📝 `modules/mailer/mailer.go` (+54 -6) 📝 `modules/setting/setting.go` (+14 -3) </details> ### 📄 Description Implemented `sendmail` as an alternative to SMTP. A number of gogs users have requested the ability to use `sendmail` as an alternative to SMTP: https://github.com/gogits/gogs/issues/997 For some users setting up SMTP accounts for gogs is a lot more trouble than it's worth. To keep this change simple I've not added any addational configuration parameter. Instead I've reused the SMTP host. If this contains a "/" then it will be interpreted as the location of the sendmail binary. This is safe because hostnames can't contain slashes. Other fields such as username and password will be ignored for sendmail. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2025-11-02 11:44:11 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#15331