Commit Graph

19 Commits

Author SHA1 Message Date
Ompragash Viswanathan 5b0a93b192 fix: use WithTLSPolicy instead of WithTLSPortPolicy to preserve user-configured SMTP port
WithTLSPortPolicy calls SetTLSPortPolicy, which checks `c.port == DefaultPort`
(25) to decide whether the port was explicitly set or left as default. When a
user configures port 25 — common for internal relay hosts that accept plaintext
SMTP — the guard condition evaluates true and the library silently overrides the
port to 587 (DefaultPortTLS) with a fallback to 25.

This causes a two-stage failure in environments where port 587 is unreachable:

  1. The primary dial to host:587 blocks for the full 15-second connection
     timeout (go-mail DefaultTimeout) waiting on a firewalled port.
  2. The fallback dial to host:25 fires with an already-expired context,
     producing a misleading "lookup <host>: i/o timeout" DNS error rather
     than the actual root cause (port 587 unreachable).

The previous mail library (gopkg.in/mail.v2) used the port value directly
without any policy-based override, so this regression surfaced only after
migrating to github.com/wneessen/go-mail.

WithTLSPolicy applies the same STARTTLS negotiation semantics (NoTLS or
TLSOpportunistic) without mutating the port, which is the correct choice
when the caller has already provided an explicit port via WithPort.
2026-02-17 19:30:07 +05:30
Ompragash Viswanathan 99df93e082 fix int to float 2025-10-14 17:49:17 +05:30
Ebtasam Faridy 1865866bee feat:[CI-18739]: fixing float error casued by template update 2025-10-14 16:13:52 +05:30
Ompragash Viswanathan 514809ac1a feat: migrate to Go 1.24 with modern dependencies and Go modules 2025-10-14 01:18:59 +05:30
architmallik7 00423fe0b9 fix 2024-05-03 19:15:41 +05:30
architmallik7 e56738efed Added Map for storing email 2024-05-03 17:43:16 +05:30
Michael de Wit 7340d3d417 Flip starttls flag to fix #58 2021-11-01 18:56:45 +01:00
glaszig 16b20ece7a allow disabling starttls
- use more up-to-date gomail fork
- add starttls option
2021-10-29 18:10:24 -03:00
lishuangtai 027b1d4ab6 Extended from configuration to support utf8 name 2021-10-21 09:57:04 +08:00
Lukas Bachschwell c139365a67 Add options to load recipients from file
Signed-off-by: Lukas Bachschwell <lukas@lbsfilm.at>
2020-12-01 13:51:43 +01:00
harald 5203727773 Extended configuration to allow to set the hostname of the smtp client.
The value  configured by 'clienthostname' is used by the gomail client
as hostname in the HELO command.
2019-11-06 17:57:05 +01:00
Matthias Wimmer 44396c108b Make attachments optional (#31)
Don't fail if a attachment file doesn't exist.
2019-09-06 22:43:01 +02:00
Michael Schlies 17393400a4 Support multiple attachments (#29)
* Support multiple attachments
* Support single attachment syntax in addition to multiple
* Re-add import Goland removed while optimizing imports for me.
2019-08-23 18:06:45 +02:00
somax 20edd9c7e3 fix: invalid address 2018-02-27 19:00:49 +08:00
Michael de Wit 982dc51fc6 Add ability to attach a file to the sent mail(s) 2017-08-31 11:14:08 +02:00
Michael de Wit f8088a6429 Exit with error code 1 if a recipient address is incorrect (#16) 2017-07-12 15:48:45 +02:00
Michael de Wit ca0f94098b Fix an issue where a mail would be sent to the same recipient twice 2017-01-24 14:39:13 +01:00
Michael de Wit 0888ac7f7e Add all Drone env variables to template context 2017-01-17 10:58:35 +01:00
Michael de Wit f128c947ab Refactor plugin to be compatible with Drone 0.5 (#13)
* Refactor plugin to be compatible with Drone 0.5

* Add vendor files

* Re-add logo.svg, make loading environment from .env file optional, and use drone-go/template

* Fix README

* Fix issue with date formatting, update the DOCS, and improve types

* Add working directory and volume mount to README example
2017-01-16 13:20:59 +01:00