2
2
3
3
[ ![ CircleCI] ( https://circleci.com/gh/mocktools/go-smtp-mock/tree/master.svg?style=svg )] ( https://circleci.com/gh/mocktools/go-smtp-mock/tree/master )
4
4
[ ![ GitHub release (latest by date)] ( https://img.shields.io/github/v/release/mocktools/go-smtp-mock )] ( https://github.com/mocktools/go-smtp-mock/releases )
5
+ [ ![ Codecov] ( https://codecov.io/gh/mocktools/go-smtp-mock/branch/master/graph/badge.svg )] ( https://codecov.io/gh/mocktools/go-smtp-mock )
5
6
[ ![ Go Report Card] ( https://goreportcard.com/badge/github.com/mocktools/go-smtp-mock )] ( https://goreportcard.com/report/github.com/mocktools/go-smtp-mock )
6
7
[ ![ PkgGoDev] ( https://pkg.go.dev/badge/github.com/mocktools/go-smtp-mock )] ( https://pkg.go.dev/github.com/mocktools/go-smtp-mock )
7
8
[ ![ GitHub] ( https://img.shields.io/github/license/mocktools/go-smtp-mock )] ( LICENSE.txt )
@@ -16,7 +17,7 @@ Golang SMTP mock. Mimic SMTP server behaviour for your test environment and even
16
17
- [ Installation] ( #installation )
17
18
- [ Usage] ( #usage )
18
19
- [ Configuring] ( #configuring )
19
- - [ Starting/stopping server ] ( #starting-stopping-server )
20
+ - [ Example of usage ] ( #example-of-usage )
20
21
- [ Contributing] ( #contributing )
21
22
- [ License] ( #license )
22
23
- [ Code of Conduct] ( #code-of-conduct )
@@ -115,79 +116,79 @@ smtpmock.ConfigurationAttr{
115
116
116
117
// Customazing SMTP command handler messages context
117
118
// ---------------------------------------------------------------------
118
- // Custom server greeting message. Base on DefaultGreetingMsg by default
119
+ // Custom server greeting message. Base on defaultGreetingMsg by default
119
120
msgGreeting: " msgGreeting" ,
120
121
121
- // Custom invalid command message. Based on DefaultInvalidCmdMsg by default
122
+ // Custom invalid command message. Based on defaultInvalidCmdMsg by default
122
123
msgInvalidCmd: " msgInvalidCmd" ,
123
124
124
125
// Custom invalid command HELO sequence message.
125
- // Based on DefaultInvalidCmdHeloSequenceMsg by default
126
+ // Based on defaultInvalidCmdHeloSequenceMsg by default
126
127
msgInvalidCmdHeloSequence: " msgInvalidCmdHeloSequence" ,
127
128
128
129
// Custom invalid command HELO argument message.
129
- // Based on DefaultInvalidCmdHeloArgMsg by default
130
+ // Based on defaultInvalidCmdHeloArgMsg by default
130
131
msgInvalidCmdHeloArg: " msgInvalidCmdHeloArg" ,
131
132
132
- // Custom HELO blacklisted domain message. Based on DefaultQuitMsg by default
133
+ // Custom HELO blacklisted domain message. Based on defaultQuitMsg by default
133
134
msgHeloBlacklistedDomain: " msgHeloBlacklistedDomain" ,
134
135
135
- // Custom HELO received message. Based on DefaultReceivedMsg by default
136
+ // Custom HELO received message. Based on defaultReceivedMsg by default
136
137
msgHeloReceived: " msgHeloReceived" ,
137
138
138
139
// Custom invalid command MAIL FROM sequence message.
139
- // Based on DefaultInvalidCmdMailfromSequenceMsg by default
140
+ // Based on defaultInvalidCmdMailfromSequenceMsg by default
140
141
msgInvalidCmdMailfromSequence: " msgInvalidCmdMailfromSequence" ,
141
142
142
143
// Custom invalid command MAIL FROM argument message.
143
- // Based on DefaultInvalidCmdMailfromArgMsg by default
144
+ // Based on defaultInvalidCmdMailfromArgMsg by default
144
145
msgInvalidCmdMailfromArg: " msgInvalidCmdMailfromArg" ,
145
146
146
- // Custom MAIL FROM blacklisted domain message. Based on DefaultQuitMsg by default
147
+ // Custom MAIL FROM blacklisted domain message. Based on defaultQuitMsg by default
147
148
msgMailfromBlacklistedEmail: " msgMailfromBlacklistedEmail" ,
148
149
149
- // Custom MAIL FROM received message. Based on DefaultReceivedMsg by default
150
+ // Custom MAIL FROM received message. Based on defaultReceivedMsg by default
150
151
msgMailfromReceived: " msgMailfromReceived" ,
151
152
152
153
// Custom invalid command RCPT TO sequence message.
153
- // Based on DefaultInvalidCmdRcpttoSequenceMsg by default
154
+ // Based on defaultInvalidCmdRcpttoSequenceMsg by default
154
155
msgInvalidCmdRcpttoSequence: " msgInvalidCmdRcpttoSequence" ,
155
156
156
157
// Custom invalid command RCPT TO argument message.
157
- // Based on DefaultInvalidCmdRcpttoArgMsg by default
158
+ // Based on defaultInvalidCmdRcpttoArgMsg by default
158
159
msgInvalidCmdRcpttoArg: " msgInvalidCmdRcpttoArg" ,
159
160
160
161
// Custom RCPT TO not registered email message.
161
- // Based on DefaultNotRegistredRcpttoEmailMsg by default
162
+ // Based on defaultNotRegistredRcpttoEmailMsg by default
162
163
msgRcpttoNotRegisteredEmail: " msgRcpttoNotRegisteredEmail" ,
163
164
164
- // Custom RCPT TO blacklisted email message. Based on DefaultQuitMsg by default
165
+ // Custom RCPT TO blacklisted email message. Based on defaultQuitMsg by default
165
166
msgRcpttoBlacklistedEmail: " msgRcpttoBlacklistedEmail" ,
166
167
167
- // Custom RCPT TO received message. Based on DefaultReceivedMsg by default
168
+ // Custom RCPT TO received message. Based on defaultReceivedMsg by default
168
169
msgRcpttoReceived: " msgRcpttoReceived" ,
169
170
170
171
// Custom invalid command DATA sequence message.
171
- // Based on DefaultInvalidCmdDataSequenceMsg by default
172
+ // Based on defaultInvalidCmdDataSequenceMsg by default
172
173
msgInvalidCmdDataSequence: " msgInvalidCmdDataSequence" ,
173
174
174
- // Custom DATA received message. Based on DefaultReadyForReceiveMsg by default
175
+ // Custom DATA received message. Based on defaultReadyForReceiveMsg by default
175
176
msgDataReceived: " msgDataReceived" ,
176
177
177
- // Custom size is too big message. Based on DefaultMsgSizeIsTooBigMsg by default
178
+ // Custom size is too big message. Based on defaultMsgSizeIsTooBigMsg by default
178
179
msgMsgSizeIsTooBig: " msgMsgSizeIsTooBig" ,
179
180
180
- // Custom received message body message. Based on DefaultReceivedMsg by default
181
+ // Custom received message body message. Based on defaultReceivedMsg by default
181
182
msgMsgReceived: " msgMsgReceived" ,
182
183
183
- // Custom quit command message. Based on DefaultQuitMsg by default
184
+ // Custom quit command message. Based on defaultQuitMsg by default
184
185
msgQuitCmd: " msgQuitCmd" ,
185
186
}
186
187
```
187
188
188
- ### Starting-stopping server
189
+ ### Example of usage
189
190
190
- You have to create your SMTP mock server using ` smtpmock.New() ` and ` smtpmock.ConfigurationAttr ` to iterate with it first. Example of usage:
191
+ You have to create your SMTP mock server using ` smtpmock.New() ` and ` smtpmock.ConfigurationAttr{} ` to iterate with it first.
191
192
192
193
``` go
193
194
package main
@@ -203,7 +204,7 @@ import (
203
204
func main () {
204
205
hostAddress , portNumber := " 127.0.0.1" , 2525
205
206
206
- // You can pass empty ConfigurationAttr{}. It means that smtpmock will use default settings
207
+ // You can pass empty smtpmock. ConfigurationAttr{}. It means that smtpmock will use default settings
207
208
server := smtpmock.New (smtpmock.ConfigurationAttr {
208
209
hostAddress: hostAddress,
209
210
portNumber: portNumber,
0 commit comments