mirror of
https://github.com/foxcpp/maddy.git
synced 2025-04-07 06:57:37 +03:00
Reasons are explained here: https://github.com/emersion/maddy/issues/15#issuecomment-473340377
40 lines
761 B
Go
40 lines
761 B
Go
package maddy
|
|
|
|
import (
|
|
"bytes"
|
|
|
|
"github.com/emersion/maddy/module"
|
|
)
|
|
|
|
// Dummy is a struct that implements AuthProvider, DeliveryTarget and Filter
|
|
// interfaces but does nothing. Useful for testing.
|
|
type Dummy struct{ instName string }
|
|
|
|
func (d Dummy) CheckPlain(username, password string) bool {
|
|
return true
|
|
}
|
|
|
|
func (d Dummy) Apply(ctx *module.DeliveryContext, msg *bytes.Buffer) error {
|
|
return nil
|
|
}
|
|
|
|
func (d Dummy) Deliver(ctx module.DeliveryContext, msg bytes.Buffer) error {
|
|
return nil
|
|
}
|
|
|
|
func (d Dummy) Name() string {
|
|
return "dummy"
|
|
}
|
|
|
|
func (d Dummy) Version() string {
|
|
return "0.0"
|
|
}
|
|
|
|
func (d Dummy) InstanceName() string {
|
|
return d.instName
|
|
}
|
|
|
|
func init() {
|
|
module.Register("dummy", nil)
|
|
module.RegisterInstance(&Dummy{instName: "dummy"})
|
|
}
|