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
use crateMessageHandler;
use crateMilter;
use crateMilterProtocol;
/// Used to build a Milter.
///
/// This crate tries to make it as easy as possible to use milter functionality in rust, while at
/// the same time make it as difficult as possible to violate the milter protocol. The builder
/// pattern is used here to provide an API that achieves these requirements.
///
/// One example of this is that the user doesn't need to implement OPTNEG messages manually and
/// instead only defines what should be enabled by using the `set_protocol` method and rmilter uses
/// this information during option negotiation with the MTA.
///
/// If the `set_protocol` method is not used, all functionality is enabled by default during option
/// negotiation.
///
/// # Example
/// ```
/// use rmilter::milter_builder::MilterBuilder;
/// use rmilter::message_handler::MessageHandler;
///
/// struct MyHandler;
/// impl MessageHandler for MyHandler {}
///
/// let mut handler = MyHandler {};
///
/// let mut milter = MilterBuilder::new(&mut handler)
/// .build();
/// ```