(t *testing.T)
| 605 | } |
| 606 | |
| 607 | func TestMsgPipeline_MalformedSource(t *testing.T) { |
| 608 | target := testutils.Target{} |
| 609 | d := MsgPipeline{ |
| 610 | msgpipelineCfg: msgpipelineCfg{ |
| 611 | perSource: map[string]sourceBlock{}, |
| 612 | defaultSource: sourceBlock{ |
| 613 | perRcpt: map[string]*rcptBlock{ |
| 614 | "postmaster": { |
| 615 | targets: []module.DeliveryTarget{&target}, |
| 616 | }, |
| 617 | "sender@example.com": { |
| 618 | targets: []module.DeliveryTarget{&target}, |
| 619 | }, |
| 620 | "example.com": { |
| 621 | targets: []module.DeliveryTarget{&target}, |
| 622 | }, |
| 623 | }, |
| 624 | }, |
| 625 | }, |
| 626 | Log: testutils.Logger(t, "msgpipeline"), |
| 627 | } |
| 628 | |
| 629 | // Simple checks for violations that can make msgpipeline misbehave. |
| 630 | for _, addr := range []string{"not_postmaster_but_no_at_sign", "@no_mailbox", "no_domain@"} { |
| 631 | _, err := d.StartDelivery(context.Background(), &module.MsgMetadata{ID: "testing"}, addr) |
| 632 | if err == nil { |
| 633 | t.Errorf("%s is accepted as valid address", addr) |
| 634 | } |
| 635 | } |
| 636 | } |
| 637 | |
| 638 | func TestMsgPipeline_TwoRcptToOneTarget(t *testing.T) { |
| 639 | target := testutils.Target{} |
nothing calls this directly
no test coverage detected