(ctx context.Context, to string, opts *smtp.RcptOptions)
| 376 | } |
| 377 | |
| 378 | func (s *Session) rcpt(ctx context.Context, to string, opts *smtp.RcptOptions) error { |
| 379 | // INTERNATIONALIZATION: Do not permit non-ASCII addresses unless SMTPUTF8 is |
| 380 | // used. |
| 381 | if !address.IsASCII(to) && !s.opts.UTF8 { |
| 382 | return &exterrors.SMTPError{ |
| 383 | Code: 553, |
| 384 | EnhancedCode: exterrors.EnhancedCode{5, 6, 7}, |
| 385 | Message: "SMTPUTF8 is required for non-ASCII recipients", |
| 386 | } |
| 387 | } |
| 388 | cleanTo, err := address.CleanDomain(to) |
| 389 | if err != nil { |
| 390 | return &exterrors.SMTPError{ |
| 391 | Code: 501, |
| 392 | EnhancedCode: exterrors.EnhancedCode{5, 1, 2}, |
| 393 | Message: "Unable to normalize the recipient address", |
| 394 | } |
| 395 | } |
| 396 | |
| 397 | return s.delivery.AddRcpt(ctx, cleanTo, *opts) |
| 398 | } |
| 399 | |
| 400 | func (s *Session) Logout() error { |
| 401 | s.msgLock.Lock() |
no test coverage detected