Reformatted code
This commit is contained in:
@@ -15,36 +15,33 @@ Sample Milter
|
||||
package main
|
||||
|
||||
import (
|
||||
|
||||
"."
|
||||
"fmt"
|
||||
|
||||
"."
|
||||
"fmt"
|
||||
)
|
||||
|
||||
|
||||
type Mymilter struct {
|
||||
gomilter.MilterRaw // Embed the basic functionality. No callbacks yet
|
||||
gomilter.MilterRaw // Embed the basic functionality. No callbacks yet
|
||||
}
|
||||
|
||||
// Define the callback functions we are going to use
|
||||
func (m *Mymilter) Connect(ctx uintptr, hostname, ip string) (sfsistat int8) {
|
||||
fmt.Println("mymilter.connect was called")
|
||||
fmt.Printf("hostname: %s\n", hostname)
|
||||
fmt.Printf("ip: %s\n", ip)
|
||||
return gomilter.Reject
|
||||
fmt.Println("mymilter.connect was called")
|
||||
fmt.Printf("hostname: %s\n", hostname)
|
||||
fmt.Printf("ip: %s\n", ip)
|
||||
return gomilter.Reject
|
||||
}
|
||||
|
||||
func (m *Mymilter) Helo(ctx uintptr, helohost string) (sfsistat int8) {
|
||||
fmt.Println("mymilter.helo was called")
|
||||
return
|
||||
fmt.Println("mymilter.helo was called")
|
||||
return
|
||||
}
|
||||
|
||||
func main() {
|
||||
mymilter := new(Mymilter)
|
||||
mymilter.FilterName = "TestFilter"
|
||||
mymilter.Debug = true
|
||||
mymilter.Flags = gomilter.AddHdrs|gomilter.AddRcpt
|
||||
mymilter := new(Mymilter)
|
||||
mymilter.FilterName = "TestFilter"
|
||||
mymilter.Debug = true
|
||||
mymilter.Flags = gomilter.AddHdrs | gomilter.AddRcpt
|
||||
|
||||
// Start Milter
|
||||
gomilter.Run(mymilter)
|
||||
// Start Milter
|
||||
gomilter.Run(mymilter)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user