summaryrefslogtreecommitdiff
path: root/meta-ibs/meta-cp2-5422/recipes-phosphor/interfaces/bmcweb/0017-update-smtp.patch
blob: 33ffdfd7b86bd16d79327a253d4cff0be70d7fd9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
From 6f909553ae9526dea232731e440b2ae4d844e000 Mon Sep 17 00:00:00 2001
From: claiff <claiff@mail.ru>
Date: Fri, 16 Sep 2022 12:15:45 +0300
Subject: [PATCH] update smtp

---
 meson.build                                   |   4 +-
 .../include/utils/smtp/add_mails_parser.hpp   |  22 ++
 .../utils/smtp/delete_mails_parser.hpp        |  22 ++
 ...ers_parser.hpp => set_settings_parser.hpp} |  10 +-
 redfish-core/lib/smtp.hpp                     | 226 +++++++++++++++---
 .../src/utils/smtp/add_mails_parser.cpp       |  22 ++
 .../utils/smtp/change_parameters_parser.cpp   |  62 -----
 .../src/utils/smtp/delete_mails_parser.cpp    |  23 ++
 .../src/utils/smtp/set_settings_parser.cpp    |  96 ++++++++
 redfish-core/ut/smtp_reader_parser_test.cpp   |   6 +-
 10 files changed, 387 insertions(+), 106 deletions(-)
 create mode 100644 redfish-core/include/utils/smtp/add_mails_parser.hpp
 create mode 100644 redfish-core/include/utils/smtp/delete_mails_parser.hpp
 rename redfish-core/include/utils/smtp/{change_parameters_parser.hpp => set_settings_parser.hpp} (63%)
 create mode 100644 redfish-core/src/utils/smtp/add_mails_parser.cpp
 delete mode 100644 redfish-core/src/utils/smtp/change_parameters_parser.cpp
 create mode 100644 redfish-core/src/utils/smtp/delete_mails_parser.cpp
 create mode 100644 redfish-core/src/utils/smtp/set_settings_parser.cpp

diff --git a/meson.build b/meson.build
index c1d253fb..d7ce2c44 100644
--- a/meson.build
+++ b/meson.build
@@ -376,7 +376,9 @@ srcfiles_bmcweb = [
   'redfish-core/src/error_messages.cpp',
   'redfish-core/src/utils/json_utils.cpp',
   'redfish-core/src/utils/smtp/send_message_parser.cpp',
-  'redfish-core/src/utils/smtp/change_parameters_parser.cpp',
+  'redfish-core/src/utils/smtp/set_settings_parser.cpp',
+  'redfish-core/src/utils/smtp/add_mails_parser.cpp',
+  'redfish-core/src/utils/smtp/delete_mails_parser.cpp',
   'redfish-core/src/utils/smtp/types/iparser.cpp',
   'src/boost_asio_ssl.cpp',
   'src/boost_asio.cpp',
diff --git a/redfish-core/include/utils/smtp/add_mails_parser.hpp b/redfish-core/include/utils/smtp/add_mails_parser.hpp
new file mode 100644
index 00000000..cd65c441
--- /dev/null
+++ b/redfish-core/include/utils/smtp/add_mails_parser.hpp
@@ -0,0 +1,22 @@
+#pragma once
+
+#include <list>
+#include <string>
+
+#include "types/iparser.hpp"
+
+namespace redfish::smtp::parser
+{
+    class AddMails : public types::IParser
+    {
+    public:
+        explicit AddMails( std::string const& function_with_parameters );
+        ~AddMails() override = default;
+
+        std::list<std::string> GetMails() const;
+
+        std::string GetMethodName() const override;
+    private:
+        std::list<std::string> mMails;
+    };
+}
diff --git a/redfish-core/include/utils/smtp/delete_mails_parser.hpp b/redfish-core/include/utils/smtp/delete_mails_parser.hpp
new file mode 100644
index 00000000..649096ee
--- /dev/null
+++ b/redfish-core/include/utils/smtp/delete_mails_parser.hpp
@@ -0,0 +1,22 @@
+#pragma once
+
+#include <list>
+#include <string>
+
+#include "types/iparser.hpp"
+
+namespace redfish::smtp::parser
+{
+    class DeleteMails : public types::IParser
+    {
+    public:
+        explicit DeleteMails( std::string const& function_with_parameters );
+        ~DeleteMails() override = default;
+
+        std::list<std::string> GetDeleteMails() const;
+
+        std::string GetMethodName() const override;
+    private:
+        std::list<std::string> mDeleteMails;
+    };
+}
diff --git a/redfish-core/include/utils/smtp/change_parameters_parser.hpp b/redfish-core/include/utils/smtp/set_settings_parser.hpp
similarity index 63%
rename from redfish-core/include/utils/smtp/change_parameters_parser.hpp
rename to redfish-core/include/utils/smtp/set_settings_parser.hpp
index ee18b57b..46db143a 100644
--- a/redfish-core/include/utils/smtp/change_parameters_parser.hpp
+++ b/redfish-core/include/utils/smtp/set_settings_parser.hpp
@@ -4,16 +4,18 @@
 
 namespace redfish::smtp::parser
 {
-    class ChangeParameters : public types::IParser
+    class SetSettings : public types::IParser
     {
     public:
-        explicit ChangeParameters( std::string const& function_with_parameters );
-        ~ChangeParameters() override = default;
+        explicit SetSettings( std::string const& function_with_parameters );
+        ~SetSettings() override = default;
 
         std::string GetUser() const;
         std::string GetPassword() const;
         std::string GetHost() const;
         std::string GetPort() const;
+        bool GetIsNeedSsl() const;
+        bool GetIsNeedAuth() const;
 
         std::string GetMethodName() const override;
     private:
@@ -23,5 +25,7 @@ namespace redfish::smtp::parser
         std::string mPassword;
         std::string mHost;
         std::string mPort;
+        bool mIsNeedSsl;
+        bool mIsNeedAuth;
     };
 }
diff --git a/redfish-core/lib/smtp.hpp b/redfish-core/lib/smtp.hpp
index 1bd798f7..dd49f982 100644
--- a/redfish-core/lib/smtp.hpp
+++ b/redfish-core/lib/smtp.hpp
@@ -5,17 +5,24 @@
 #include <iostream>
 
 #include "utils/smtp/send_message_parser.hpp"
-#include "utils/smtp/change_parameters_parser.hpp"
+#include "utils/smtp/set_settings_parser.hpp"
+#include "utils/smtp/add_mails_parser.hpp"
+#include "utils/smtp/delete_mails_parser.hpp"
 
 namespace redfish
 {
     constexpr const char* SERVICE_PATH = "xyz.openbmc_project.SMTP";
-    constexpr const char* OBJECT_PATH = "/xyz/openbmc_project/SMTP";
-    constexpr const char* INTERFACE_PATH = "xyz.openbmc_project.SMTP";
+
+    constexpr const char* OBJECT_MESSENGER_PATH = "/xyz/openbmc_project/SMTP/Messenger";
+    constexpr const char* INTERFACE_MESSENGER_PATH = "xyz.openbmc_project.Messenger";
+
+    constexpr const char* OBJECT_MANAGER_PATH = "/xyz/openbmc_project/SMTP/Manager";
+    constexpr const char* INTERFACE_SETTINGS_MANAGER_PATH = "xyz.openbmc_project.SettingsManager";
+    constexpr const char* INTERFACE_MAIL_MANAGER_PATH = "xyz.openbmc_project.MailManager";
 
     namespace smtp
     {
-        inline std::optional<std::string> GetFunctionName( std::string const& function_with_parameters )
+        inline std::string GetFunctionName( std::string const& function_with_parameters )
         {
             static constexpr char FIRST_DELIMITER = '&';
             static constexpr int ZERO_POSITION = 0;
@@ -23,15 +30,19 @@ namespace redfish
             auto position = function_with_parameters.find(FIRST_DELIMITER);
             if( position == std::string::npos )
             {
-                return {};
+                return function_with_parameters;
             }
             return function_with_parameters.substr( ZERO_POSITION, position );
         }
 
         inline void SendMail( std::string const& function_with_parameters, std::shared_ptr<bmcweb::AsyncResp> const& asyncResp )
         {
+            std::cout << "SendMail" << std::endl;
             auto parsing_result = parser::SendMessage{function_with_parameters};
-
+            std::cout << "GetMethodName" << parsing_result.GetMethodName() << std::endl;
+            std::cout << "GetFrom" << parsing_result.GetFrom() << std::endl;
+            std::cout << "GetSubject" << parsing_result.GetSubject() << std::endl;
+            std::cout << "GetText" << parsing_result.GetText() << std::endl;
             crow::connections::systemBus->async_method_call([asyncResp](const boost::system::error_code& error_code, bool result){
                     if (error_code.value() == EBADR ||
                         error_code == boost::system::errc::host_unreachable)
@@ -48,19 +59,24 @@ namespace redfish
                     }
                     asyncResp->res.jsonValue["result"] = result;
                 },
-                SERVICE_PATH, OBJECT_PATH, INTERFACE_PATH,
+                SERVICE_PATH, OBJECT_MESSENGER_PATH, INTERFACE_MESSENGER_PATH,
                 parsing_result.GetMethodName(),
                 parsing_result.GetFrom(),
-                parsing_result.GetTo(),
-                parsing_result.GetCc(),
                 parsing_result.GetSubject(),
                 parsing_result.GetText());
         }
 
-        inline void ChangeParameters( std::string const& function_with_parameters, std::shared_ptr<bmcweb::AsyncResp> const& asyncResp )
+        inline void SetSettings( std::string const& function_with_parameters, std::shared_ptr<bmcweb::AsyncResp> const& asyncResp )
         {
-            auto parsing_result = parser::ChangeParameters{function_with_parameters};
-
+            std::cout << "SetSettings" << std::endl;
+            auto parsing_result = parser::SetSettings{function_with_parameters};
+            std::cout << "GetMethodName" << parsing_result.GetMethodName() << std::endl;
+            std::cout << "GetIsNeedAuth" << parsing_result.GetIsNeedAuth() << std::endl;
+            std::cout << "GetIsNeedSsl" << parsing_result.GetIsNeedSsl() << std::endl;
+            std::cout << "GetUser" << parsing_result.GetUser() << std::endl;
+            std::cout << "GetPassword" << parsing_result.GetPassword() << std::endl;
+            std::cout << "GetHost" << parsing_result.GetHost() << std::endl;
+            std::cout << "GetPort" << parsing_result.GetPort() << std::endl;
             crow::connections::systemBus->async_method_call([asyncResp](const boost::system::error_code& error_code, bool result){
                     if (error_code.value() == EBADR ||
                         error_code == boost::system::errc::host_unreachable)
@@ -77,13 +93,129 @@ namespace redfish
                     }
                     asyncResp->res.jsonValue["result"] = result;
                 },
-                SERVICE_PATH, OBJECT_PATH, INTERFACE_PATH,
+                SERVICE_PATH, OBJECT_MANAGER_PATH,INTERFACE_SETTINGS_MANAGER_PATH,
                 parsing_result.GetMethodName(),
+                parsing_result.GetIsNeedAuth(),
+                parsing_result.GetIsNeedSsl(),
                 parsing_result.GetUser(),
                 parsing_result.GetPassword(),
                 parsing_result.GetHost(),
                 parsing_result.GetPort());
         }
+
+        inline void GetSettings( std::shared_ptr<bmcweb::AsyncResp> const& asyncResp )
+        {
+            std::cout << "GetSettings" << std::endl;
+            crow::connections::systemBus->async_method_call([asyncResp](const boost::system::error_code& error_code, std::string const& result ){
+                    if (error_code.value() == EBADR ||
+                        error_code == boost::system::errc::host_unreachable)
+                    {
+                        BMCWEB_LOG_ERROR << "host unreachable " << error_code;
+                        std::cout << "host unreachable" << std::endl;
+                        return;
+                    }
+                    if (error_code)
+                    {
+                        BMCWEB_LOG_ERROR << "respHandler DBus error " << error_code;
+                        std::cout << "respHandler DBus error" << std::endl;
+                        return;
+                    }
+                    std::cout << "result" << std::endl;
+                    auto parsing_result = parser::SetSettings{result};
+                    asyncResp->res.jsonValue["host"] = parsing_result.GetHost();
+                    asyncResp->res.jsonValue["is_need_auth"] = parsing_result.GetIsNeedAuth();
+                    asyncResp->res.jsonValue["is_need_ssl"] = parsing_result.GetIsNeedSsl();
+                    asyncResp->res.jsonValue["password"] = parsing_result.GetPassword();
+                    asyncResp->res.jsonValue["port"] = parsing_result.GetPort();
+                    asyncResp->res.jsonValue["username"] = parsing_result.GetUser();
+                },
+                SERVICE_PATH, OBJECT_MANAGER_PATH, INTERFACE_SETTINGS_MANAGER_PATH,
+                "GetSettings");
+        }
+
+        inline void GetMails( std::shared_ptr<bmcweb::AsyncResp> const& asyncResp )
+        {
+            std::cout << "GetMails" << std::endl;
+            crow::connections::systemBus->async_method_call([asyncResp](const boost::system::error_code& error_code, std::list<std::string> const& mails){
+                    if (error_code.value() == EBADR ||
+                        error_code == boost::system::errc::host_unreachable)
+                    {
+                        BMCWEB_LOG_ERROR << "host unreachable " << error_code;
+                        std::cout << "host unreachable" << std::endl;
+                        return;
+                    }
+                    if (error_code)
+                    {
+                        BMCWEB_LOG_ERROR << "respHandler DBus error " << error_code;
+                        std::cout << "respHandler DBus error" << std::endl;
+                        return;
+                    }
+                    asyncResp->res.jsonValue["mails"] = mails;
+                },
+                SERVICE_PATH, OBJECT_MANAGER_PATH, INTERFACE_MAIL_MANAGER_PATH,
+                "GetMailsToSend");
+        }
+
+        inline void AddMails( std::string const& function_with_parameters, std::shared_ptr<bmcweb::AsyncResp> const& asyncResp )
+        {
+            std::cout << "AddMails" << std::endl;
+            auto parsing_result = parser::AddMails{function_with_parameters};
+            std::cout << "parsing_result.GetMethodName() " << parsing_result.GetMethodName() << std::endl;
+            for(const auto& mail : parsing_result.GetMails())
+            {
+                std::cout << "parsing_result.GetMails() " << mail << std::endl;
+            }
+
+            crow::connections::systemBus->async_method_call([asyncResp](const boost::system::error_code& error_code, bool result){
+                    if (error_code.value() == EBADR ||
+                        error_code == boost::system::errc::host_unreachable)
+                    {
+                        BMCWEB_LOG_ERROR << "host unreachable " << error_code;
+                        std::cout << "host unreachabler" << std::endl;
+                        return;
+                    }
+                    if (error_code)
+                    {
+                        BMCWEB_LOG_ERROR << "respHandler DBus error " << error_code;
+                        std::cout << "respHandler DBus error" << std::endl;
+                        return;
+                    }
+                    asyncResp->res.jsonValue["result"] = result;
+                },
+                SERVICE_PATH, OBJECT_MANAGER_PATH, INTERFACE_MAIL_MANAGER_PATH,
+                parsing_result.GetMethodName(),
+                parsing_result.GetMails());
+        }
+
+        inline void DeleteMails( std::string const& function_with_parameters, std::shared_ptr<bmcweb::AsyncResp> const& asyncResp )
+        {
+            std::cout << "DeleteMails" << std::endl;
+            auto parsing_result = parser::DeleteMails{function_with_parameters};
+            std::cout << "parsing_result.GetMethodName()" << parsing_result.GetMethodName() << std::endl;
+            for(const auto& mail : parsing_result.GetDeleteMails())
+            {
+                std::cout << "parsing_result.GetDeleteMails() " << mail << std::endl;
+            }
+            crow::connections::systemBus->async_method_call([asyncResp](const boost::system::error_code& error_code, bool result){
+                    if (error_code.value() == EBADR ||
+                        error_code == boost::system::errc::host_unreachable)
+                    {
+                        BMCWEB_LOG_ERROR << "host unreachable " << error_code;
+                        std::cout << "host unreachabler" << std::endl;
+                        return;
+                    }
+                    if (error_code)
+                    {
+                        BMCWEB_LOG_ERROR << "respHandler DBus error " << error_code;
+                        std::cout << "respHandler DBus error" << std::endl;
+                        return;
+                    }
+                    asyncResp->res.jsonValue["result"] = result;
+                },
+                SERVICE_PATH, OBJECT_MANAGER_PATH, INTERFACE_MAIL_MANAGER_PATH,
+                parsing_result.GetMethodName(),
+                parsing_result.GetDeleteMails());
+        }
     }
 
     inline void FillResp(crow::Response& resp, const dbus::utility::DBusPropertiesMap& properties)
@@ -130,23 +262,23 @@ namespace redfish
                 return;
             }
 
-            crow::connections::systemBus->async_method_call([asyncResp](const boost::system::error_code& error_code,
-                                                                        const dbus::utility::DBusPropertiesMap& properties)
-            {
-                if (error_code)
-                {
-                    BMCWEB_LOG_DEBUG << "DBUS response error " << error_code;
-                    messages::internalError(asyncResp->res);
-                    return;
-                }
+//            crow::connections::systemBus->async_method_call([asyncResp](const boost::system::error_code& error_code,
+//                                                                        const dbus::utility::DBusPropertiesMap& properties)
+//            {
+//                if (error_code)
+//                {
+//                    BMCWEB_LOG_DEBUG << "DBUS response error " << error_code;
+//                    messages::internalError(asyncResp->res);
+//                    return;
+//                }
 
-                FillResp(asyncResp->res, properties);
-            }, SERVICE_PATH, OBJECT_PATH, "org.freedesktop.DBus.Properties",
-            "GetAll", "xyz.openbmc_project.SMTP");
+//                FillResp(asyncResp->res, properties);
+//            }, SERVICE_PATH, OBJECT_PATH, "org.freedesktop.DBus.Properties",
+//            "GetAll", "xyz.openbmc_project.SMTP");
 
-            asyncResp->res.jsonValue["@odata.type"] ="#SmtpCollection";
-            asyncResp->res.jsonValue["@odata.id"] = "/redfish/v1/Smtp";
-            asyncResp->res.jsonValue["Name"] = "Smtp Collection";
+//            asyncResp->res.jsonValue["@odata.type"] ="#SmtpCollection";
+//            asyncResp->res.jsonValue["@odata.id"] = "/redfish/v1/Smtp";
+//            asyncResp->res.jsonValue["Name"] = "Smtp Collection";
         });
     }
 
@@ -162,29 +294,47 @@ namespace redfish
                const std::string& function_with_parameters)
         {
             static constexpr std::string_view SEND_MAIL_METHOD_NAME = "SendMail";
-            static constexpr std::string_view CHANGE_PARAMETERS_METHOD_NAME = "ChangeParameters";
+
+            static constexpr std::string_view GET_SETTINGS_METHOD_NAME = "GetSettings";
+            static constexpr std::string_view SET_SETTINGS_METHOD_NAME = "SetSettings";
+
+            static constexpr std::string_view GET_MAILS_METHOD_NAME = "GetMails";
+            static constexpr std::string_view ADD_MAILS_METHOD_NAME = "AddMails";
+            static constexpr std::string_view DELETE_MAILS_METHOD_NAME = "DeleteMails";
 
             if (!redfish::setUpRedfishRoute(app, req, asyncResp))
             {
                 return;
             }
             auto function_name = smtp::GetFunctionName(function_with_parameters);
-            if(!function_name)
-            {
-                return;
-            }
 
             asyncResp->res.jsonValue["@odata.type"] ="#SmtpCollection";
-            asyncResp->res.jsonValue["@odata.id"] = "/redfish/v1/Smtp/" + *function_name;
+            asyncResp->res.jsonValue["@odata.id"] = "/redfish/v1/Smtp/" + function_name;
             asyncResp->res.jsonValue["Name"] = "Smtp Collection";
-
-            if(*function_name == SEND_MAIL_METHOD_NAME)
+            std::cout << "function_name " << function_name << std::endl;
+            if(function_name == SEND_MAIL_METHOD_NAME)
             {
                 smtp::SendMail(function_with_parameters, asyncResp);
             }
-            else if(*function_name == CHANGE_PARAMETERS_METHOD_NAME)
+            else if(function_name == SET_SETTINGS_METHOD_NAME)
+            {
+                smtp::SetSettings(function_with_parameters, asyncResp);
+            }
+            else if(function_name == GET_SETTINGS_METHOD_NAME)
+            {
+                smtp::GetSettings(asyncResp);
+            }
+            else if(function_name == GET_MAILS_METHOD_NAME)
+            {
+                smtp::GetMails(asyncResp);
+            }
+            else if(function_name == ADD_MAILS_METHOD_NAME)
+            {
+                smtp::AddMails(function_with_parameters, asyncResp);
+            }
+            else if(function_name == DELETE_MAILS_METHOD_NAME)
             {
-                smtp::ChangeParameters(function_with_parameters, asyncResp);
+                smtp::DeleteMails(function_with_parameters, asyncResp);
             }
         });
     }
diff --git a/redfish-core/src/utils/smtp/add_mails_parser.cpp b/redfish-core/src/utils/smtp/add_mails_parser.cpp
new file mode 100644
index 00000000..6abe41c9
--- /dev/null
+++ b/redfish-core/src/utils/smtp/add_mails_parser.cpp
@@ -0,0 +1,22 @@
+#include "utils/smtp/add_mails_parser.hpp"
+
+namespace redfish::smtp::parser
+{
+    AddMails::AddMails( std::string const& function_with_parameters )
+    {
+        static const std::string DELIMITER_ON_LINE = "&";
+
+        mMails = ParseLine(function_with_parameters, DELIMITER_ON_LINE);
+        mMails.erase(mMails.begin());
+    }
+
+    std::list<std::string> AddMails::GetMails() const
+    {
+        return mMails;
+    }
+
+    std::string AddMails::GetMethodName() const
+    {
+        return "AddMailsToSend";
+    }
+}
diff --git a/redfish-core/src/utils/smtp/change_parameters_parser.cpp b/redfish-core/src/utils/smtp/change_parameters_parser.cpp
deleted file mode 100644
index f78b9482..00000000
--- a/redfish-core/src/utils/smtp/change_parameters_parser.cpp
+++ /dev/null
@@ -1,62 +0,0 @@
-#include "utils/smtp/change_parameters_parser.hpp"
-
-namespace redfish::smtp::parser
-{
-    ChangeParameters::ChangeParameters( std::string const& function_with_parameters )
-    {
-        static const std::string DELIMITER_ON_LINE = "&";
-
-        auto params = BuildParams(ParseLine(function_with_parameters, DELIMITER_ON_LINE));
-        FillParams( params );
-    }
-
-    std::string ChangeParameters::GetUser() const
-    {
-        return mUser;
-    }
-    std::string ChangeParameters::GetPassword() const
-    {
-        return mPassword;
-    }
-    std::string ChangeParameters::GetHost() const
-    {
-        return mHost;
-    }
-    std::string ChangeParameters::GetPort() const
-    {
-        return mPort;
-    }
-
-    std::string ChangeParameters::GetMethodName() const
-    {
-        constexpr const char* CHANGE_METHOD_NAME = "ChangeParameters";
-        return CHANGE_METHOD_NAME;
-    }
-
-    void ChangeParameters::FillParams( types::ParserResult const& params )
-    {
-        auto user = params.find("user");
-        if(user != params.end())
-        {
-            mUser = (*user).second;
-        }
-
-        auto password = params.find("password");
-        if(password != params.end())
-        {
-            mPassword = (*password).second;
-        }
-
-        auto host = params.find("host");
-        if(host != params.end())
-        {
-            mHost = (*host).second;
-        }
-
-        auto port = params.find("port");
-        if(port != params.end())
-        {
-            mPort = (*port).second;
-        }
-    }
-}
diff --git a/redfish-core/src/utils/smtp/delete_mails_parser.cpp b/redfish-core/src/utils/smtp/delete_mails_parser.cpp
new file mode 100644
index 00000000..ead3bbfb
--- /dev/null
+++ b/redfish-core/src/utils/smtp/delete_mails_parser.cpp
@@ -0,0 +1,23 @@
+#include "utils/smtp/delete_mails_parser.hpp"
+
+namespace redfish::smtp::parser
+{
+    DeleteMails::DeleteMails( std::string const& function_with_parameters )
+    {
+        static const std::string DELIMITER_ON_LINE = "&";
+
+        mDeleteMails = ParseLine(function_with_parameters, DELIMITER_ON_LINE);
+        mDeleteMails.erase(mDeleteMails.begin());
+    }
+
+    std::list<std::string> DeleteMails::GetDeleteMails() const
+    {
+        return mDeleteMails;
+    }
+
+    std::string DeleteMails::GetMethodName() const
+    {
+        return "DeleteMailsToSend";
+    }
+
+}
diff --git a/redfish-core/src/utils/smtp/set_settings_parser.cpp b/redfish-core/src/utils/smtp/set_settings_parser.cpp
new file mode 100644
index 00000000..d5071b05
--- /dev/null
+++ b/redfish-core/src/utils/smtp/set_settings_parser.cpp
@@ -0,0 +1,96 @@
+#include "utils/smtp/set_settings_parser.hpp"
+#include <iostream>
+
+namespace redfish::smtp::parser
+{
+    SetSettings::SetSettings( std::string const& function_with_parameters )
+    {
+        static const std::string DELIMITER_ON_LINE = "&";
+        auto parsed_data = ParseLine(function_with_parameters, DELIMITER_ON_LINE);
+        std::cout << "aaaa" <<std::endl;
+        for(auto const& d : parsed_data)
+        {
+            std::cout << d <<std::endl;
+        }
+        auto params = BuildParams( parsed_data );
+        std::cout << "qqqq" <<std::endl;
+        for(const auto& dd: params)
+        {
+            std::cout << dd.first << ":"<< dd.second << std::endl;
+        }
+        FillParams( params );
+    }
+
+    std::string SetSettings::GetUser() const
+    {
+        return mUser;
+    }
+    
+    std::string SetSettings::GetPassword() const
+    {
+        return mPassword;
+    }
+    
+    std::string SetSettings::GetHost() const
+    {
+        return mHost;
+    }
+    
+    std::string SetSettings::GetPort() const
+    {
+        return mPort;
+    }
+    
+    bool SetSettings::GetIsNeedSsl() const
+    {
+        return mIsNeedSsl;
+    }
+    
+    bool SetSettings::GetIsNeedAuth() const
+    {
+        return mIsNeedAuth;
+    }
+
+    std::string SetSettings::GetMethodName() const
+    {
+        constexpr const char* CHANGE_METHOD_NAME = "SetSettings";
+        return CHANGE_METHOD_NAME;
+    }
+
+    void SetSettings::FillParams( types::ParserResult const& params )
+    {
+        auto user = params.find("username");
+        if(user != params.end())
+        {
+            mUser = (*user).second;
+        }
+
+        auto password = params.find("password");
+        if(password != params.end())
+        {
+            mPassword = (*password).second;
+        }
+
+        auto host = params.find("host");
+        if(host != params.end())
+        {
+            mHost = (*host).second;
+        }
+
+        auto port = params.find("port");
+        if(port != params.end())
+        {
+            mPort = (*port).second;
+        }
+        auto is_need_auth = params.find("is_need_auth");
+        if(is_need_auth != params.end())
+        {
+            mIsNeedAuth = (*is_need_auth).second == "true" ? true : false;
+        }
+        auto is_need_ssl = params.find("is_need_ssl");
+        if(is_need_ssl != params.end())
+        {
+            mIsNeedSsl = (*is_need_ssl).second == "true" ? true : false;
+        }
+    }
+}
diff --git a/redfish-core/ut/smtp_reader_parser_test.cpp b/redfish-core/ut/smtp_reader_parser_test.cpp
index 67a6645c..85ca25dc 100644
--- a/redfish-core/ut/smtp_reader_parser_test.cpp
+++ b/redfish-core/ut/smtp_reader_parser_test.cpp
@@ -1,5 +1,5 @@
 #include "utils/smtp/send_message_parser.hpp"
-#include "utils/smtp/change_parameters_parser.hpp"
+#include "utils/smtp/set_settings_parser.hpp"
 #include "smtp.hpp"
 
 #include <string>
@@ -27,11 +27,13 @@ TEST(SmtpReaderParser, SendMessage)
 
 TEST(SmtpReaderParser, ChangeParameters)
 {
-    smtp::parser::ChangeParameters message_parser{"ChangeParameters&user=claiff@mail.ru&password=32311&host=smtp.mail.ru&port=465"};
+    smtp::parser::SetSettings message_parser{"ChangeParameters&user=claiff@mail.ru&password=32311&host=smtp.mail.ru&port=465&is_need_auth=true&is_need_ssl=true"};
     EXPECT_EQ(message_parser.GetUser(), "claiff@mail.ru");
     EXPECT_EQ(message_parser.GetPassword(), "32311");
     EXPECT_EQ(message_parser.GetHost(), "smtp.mail.ru");
     EXPECT_EQ(message_parser.GetPort(), "465");
+    EXPECT_EQ(message_parser.GetIsNeedAuth(), true);
+    EXPECT_EQ(message_parser.GetIsNeedSsl(), true);
 }
 
 TEST(SmtpReaderParser, GetFunctionName)