Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support send email with SMTPSSLTransport #5018

Closed
wants to merge 2 commits into from

Conversation

dongqiaoershao
Copy link

@dongqiaoershao dongqiaoershao commented Nov 15, 2023

接入邮件服务发现只支持smtp(25端口),不支持smtps(465端口),估计可能会有一些使用者遇到类似的问题,故提个PR增加支持ssl方式,代码写得有点粗糙,希望该意见能得到采纳,感谢不吝赐教。

What's the purpose of this PR

XXXXX

Which issue(s) this PR fixes:

Fixes #

Brief changelog

XXXXX

Follow this checklist to help us incorporate your contribution quickly and easily:

  • Read the Contributing Guide before making this pull request.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Write necessary unit tests to verify the code.
  • Run mvn clean test to make sure this pull request doesn't break anything.
  • Update the CHANGES log.

Copy link

github-actions bot commented Nov 15, 2023

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

Copy link

codecov bot commented Nov 15, 2023

Codecov Report

Attention: 21 lines in your changes are missing coverage. Please review.

Comparison is base (bc55ba6) 49.27% compared to head (2c0fe61) 49.48%.
Report is 11 commits behind head on master.

Files Patch % Lines
...lo/portal/spi/defaultimpl/DefaultEmailService.java 0.00% 17 Missing ⚠️
...ollo/audit/component/ApolloAuditLogApiJpaImpl.java 33.33% 1 Missing and 1 partial ⚠️
...mework/apollo/audit/aop/ApolloAuditSpanAspect.java 96.87% 0 Missing and 1 partial ⚠️
...k/apollo/portal/component/config/PortalConfig.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #5018      +/-   ##
============================================
+ Coverage     49.27%   49.48%   +0.20%     
- Complexity     1889     1902      +13     
============================================
  Files           372      372              
  Lines         11538    11564      +26     
  Branches       1123     1129       +6     
============================================
+ Hits           5685     5722      +37     
+ Misses         5513     5502      -11     
  Partials        340      340              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@nobodyiam nobodyiam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As this is a new feature, please also update the CHANGES.md file.

@nobodyiam
Copy link
Member

By the way, please sign the Contributor License Agreement (CLA) as instructed by the CLA Assistant.

@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Nov 28, 2023
@dongqiaoershao
Copy link
Author

I have read the CLA Document and I hereby sign the CLA

msg.saveChanges();
t.sendMessage(msg, msg.getAllRecipients());
logger.debug("email response: {}", t.getLastServerResponse());
if (useSsl) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like unnecessary to declare a new variable tSsl. Could we consider streamlining the code even further, as suggested below?

String protocol = useSSl ? "smtps" : "smtp";
t = (SMTPTransport) session.getTransport(protocol);

Copy link

stale bot commented Dec 30, 2023

This pull request has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in 14 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions!

@stale stale bot added the stale label Dec 30, 2023
Copy link

stale bot commented Jan 13, 2024

This pull request has been automatically closed because it has not had activity in the last 14 days. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions!

@stale stale bot closed this Jan 13, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Jan 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
size:M This PR changes 30-99 lines, ignoring generated files. stale
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants