Skip to content

Commit c9b3471

Browse files
committed
Done #8
1 parent 13555b3 commit c9b3471

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

index.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ exports.handler = (event) => {
5050

5151
}).then(function(container) {
5252

53-
return delete_the_email(container);
53+
return container; //delete_the_email(container);
5454

5555
}).then(function(container) {
5656

@@ -280,7 +280,13 @@ function extract_data(container)
280280
let from_account = tmp_from[0];
281281

282282
//
283-
// 6. Create the path where the email needs to be moved
283+
// 6. S3 objects have a limit of how they they can be named
284+
// so we remove everything but...
285+
//
286+
container.subject = container.subject.replace(/[^a-zA-Z0-9 &@:,$=+?;]/g, "_");
287+
288+
//
289+
// 7. Create the path where the email needs to be moved
284290
// so it is properly organized.
285291
//
286292
let path = "Inbox/"
@@ -299,7 +305,7 @@ function extract_data(container)
299305
+ "email.eml";
300306

301307
//
302-
// 7. Save the path for the next promise.
308+
// 8. Save the path for the next promise.
303309
//
304310
container.path = path;
305311

0 commit comments

Comments
 (0)