This repository was archived by the owner on Oct 6, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 7 files changed +61
-72
lines changed Expand file tree Collapse file tree 7 files changed +61
-72
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
- ** IMPORTANT: Please do not create a Pull Request without creating an issue first.**
1
+ ## Proposed changes
2
+ Describe the * big picture* reason for your PR.
2
3
3
- * Any change needs to be reviewed before it's merged *
4
+ ## Checklist
4
5
5
- ## Description
6
- <!-- Please provide enough information so that others can review your pull request -->
6
+ Please review the following checklist before submitting a PR:
7
7
8
- Explain the ** details** for making this change. What existing problem does the pull request solve?
8
+ - [ ] ** CONSIDER** adding a unit test to demonstrate your PR resolves an issue
9
+ - [ ] ** DO** keep PRs small for easy review
10
+ - [ ] ** DO** make sure unit tests pass
11
+ - [ ] ** DO** ensure no compiler warnings are triggered
12
+ - [ ] ** AVOID** breaking the CI builds
9
13
10
- <!-- Example: When "Adding a function to do X", explain why it is necessary to have a way to do X. -->
11
-
12
- ### Issue Number
13
- <!-- Put `closes #XXXX` in your comment to auto-close the issue that your PR fixes (if such). -->
14
-
15
- ## Test Plan ** required**
16
-
17
- Demonstrate the code is solid. ( Exact commands you ran and their output, screenshots / videos if the pull request changes UI.)
18
-
19
- <!-- Make sure tests pass on both Travis and Circle CI. -->
14
+ ## Other comments
15
+ Any other comments you might have.
20
16
21
17
## Reviewers
22
18
<!-- add reviewers -->
Original file line number Diff line number Diff line change @@ -7,12 +7,34 @@ on: [push, pull_request]
7
7
env :
8
8
CARGO_TERM_COLOR : always
9
9
10
+
10
11
jobs :
11
12
build-and-run-tests :
12
13
runs-on : ubuntu-latest
14
+ environment : development
15
+ strategy :
16
+ matrix :
17
+ rust :
18
+ - stable
13
19
steps :
14
- - uses : actions/checkout@v2
15
- - name : Build
16
- run : cargo build --verbose
17
- - name : Run tests
18
- run : cargo test --verbose
20
+ - uses : actions/checkout@v2
21
+ - uses : actions-rs/toolchain@v1
22
+ with :
23
+ profile : minimal
24
+ toolchain : ${{ matrix.rust }}
25
+ override : true
26
+ components : rustfmt, clippy
27
+ - uses : actions-rs/cargo@v1
28
+ with :
29
+ command : build
30
+ - uses : actions-rs/cargo@v1
31
+ with :
32
+ command : test
33
+ - uses : actions-rs/cargo@v1
34
+ with :
35
+ command : fmt
36
+ args : --all -- --check
37
+ - uses : actions-rs/cargo@v1
38
+ with :
39
+ command : clippy
40
+ args : -- -D warnings
Original file line number Diff line number Diff line change @@ -50,10 +50,8 @@ impl PrivatEmailConfig {
50
50
/// Create new PrivatEmailConfig struct from environment variables.
51
51
pub fn new_from_env ( ) -> Self {
52
52
let b_list = env:: var ( "BLACK_LIST" ) . unwrap_or_default ( ) ;
53
- let black_list = b_list
54
- . split ( "," )
55
- . map ( |x| String :: from ( x. replace ( " " , "" ) ) )
56
- . collect ( ) ;
53
+ let black_list =
54
+ b_list. split ( ',' ) . map ( |x| x. replace ( " " , "" ) ) . collect ( ) ;
57
55
58
56
PrivatEmailConfig {
59
57
from_email : env:: var ( "FROM_EMAIL" )
@@ -72,10 +70,8 @@ impl PrivatEmailConfig {
72
70
B : ToString ,
73
71
{
74
72
let b_list_vec = black_list. to_string ( ) ;
75
- let b_list: Vec < String > = b_list_vec
76
- . split ( "," )
77
- . map ( |x| String :: from ( x. replace ( " " , "" ) ) )
78
- . collect ( ) ;
73
+ let b_list: Vec < String > =
74
+ b_list_vec. split ( ',' ) . map ( |x| x. replace ( " " , "" ) ) . collect ( ) ;
79
75
PrivatEmailConfig {
80
76
from_email : from_email. to_string ( ) ,
81
77
to_email : to_email. to_string ( ) ,
Original file line number Diff line number Diff line change @@ -188,7 +188,7 @@ pub(crate) async fn privatemail_handler(
188
188
let subject: String = ses_mail. mail . common_headers . subject . to_string ( ) ;
189
189
190
190
// parse email content
191
- let parsed_mail = parse_mail ( & ses_mail. content . as_bytes ( ) ) . unwrap ( ) ;
191
+ let parsed_mail = parse_mail ( ses_mail. content . as_bytes ( ) ) . unwrap ( ) ;
192
192
let mail_content = parsed_mail. subparts [ 1 ] . get_body_raw ( ) . unwrap ( ) ;
193
193
let msg_body = charset:: decode_latin1 ( & mail_content) . to_string ( ) ;
194
194
trace ! ( "HTML content: {:#?}" , mail_content) ;
Original file line number Diff line number Diff line change @@ -56,6 +56,7 @@ data "aws_iam_policy_document" "ses_email_forward_policy_document" {
56
56
57
57
actions = [
58
58
" ses:SendEmail" ,
59
+ " ses:SendRawEmail" ,
59
60
]
60
61
61
62
resources = [
Load Diff Large diffs are not rendered by default.
You can’t perform that action at this time.
0 commit comments