Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

SMTP config overwritten by wpIdentity

Đang mở
#79 1 bình luận 1 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
55/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
javascript, wordpress
Lĩnh vực
backend

Hướng nghiên cứu

Start by reproducing the SMTP configuration with and without a wordpress block, then read sendmail.js and wpidentity.js around mail.start() and startMail(). Verify that the second startup does not replace an existing SMTP transport or force SES when wpIdentity has no SMTP settings, while preserving the documented behavior for both packages.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

This was noted in a pull request in the wpcomvip/feedland private repo. I investigated and found the following.

When there's a wordpress block in config, mail.start() gets called twice: once during core startup (using the complete merged config), and once by wpIdentity.startMail() (using only config.wordpress).

How to reproduce:

  1. Set up any FeedLand instance with working top-level SMTP settings (smtpHost, smtpPort, smtpUsername, smtpPassword) — email works fine at this point.
  2. Add a wordpress block to config (client ID/secret, etc.) to enable WordPress login, without putting smtp fields inside that block.
  3. Start the server. The logs show mail.start() called once with flUseSes: false (FeedLand's own startup), then again moments later with flUseSes: true (from wpidentity.start()).
  4. Trigger any email send (signup, login confirmation) — it now goes through SES instead of SMTP, and fails if SES isn't authorized.

I tried this out in in a local install.
Test 1: SMTP configured, no wordpress block: Mail delivered via SMTP
Test 2: SMTP configured, wordpress block added without smtp fields inside it: Mail routed to SES, failed
Test 3: SMTP configured, wordpress block added with smtp fields inside it: Mail delivered via SMTP

This bug involves several packages... wordland calls daveappserver which calls davemail, then wpIdentity calls davemail again. The solution I found involves two packages:

  1. in davemail (sendmail.js, start ()) don't overwrite the settings with SES if mailTransport is already defined
  2. in wpIdentity ( wpidentity.js, startMail ()) don't call mail.start() with "flUseSes: true" when wpIdentity itself has no SMTP settings, just use the mail config the host app already set up

I put the diffs below. The fix works for me with wordland locally, but can't say if it's the best or the correct fix. I'm unsure what happens in a different app where wpIdentity is not used together with daveappserver.

mail — sendmail.js

 function start (options) { //1/23/23 by DW
      var flUseSes = (options.flUseSes === undefined) ? true : utils.getBoolean (options.flUseSes);
+     if (flUseSes && (mailTransport !== undefined)) {
+             return;
+             }
      config.flUseSes = flUseSes; //so davemail routines know whether to use SMTP or SES
      if (!flUseSes) { //using SMTP
              const nodemailerOptions = {

wpIdentity — wpidentity.js

      function startMail () { //12/2/25 by DW
-             var options;
-             if (config.smtpHost === undefined) {
-                     options = {
-                             flUseSes: true
-                             };
-                     }
-             else {
-                     options = {
+             if (config.smtpHost !== undefined) {
+                     mail.start ({
                              flUseSes: false,
                              smtpHost: config.smtpHost,
                              port: config.smtpPort,
                              username: config.smtpUsername,
                              password: config.smtpPassword
-                             };
+                             });
                      }
-             mail.start (options);
              }
Ngôn ngữ chính
HTML
Star
11
Fork
4
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của scripting/feedlandInstall

Tất cả issue của scripting/feedlandInstall

Issue tương tự

Thêm issue về Backend & API Design

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.