mirror of
https://github.com/jhillyerd/inbucket.git
synced 2025-12-17 17:47:03 +00:00
add reject from origin domain feature (#375)
Add a new feature to be able to reject email *from* specific domains. Co-authored-by: Cyril DUPONT <cyd@9bis.com>
This commit is contained in:
@@ -19,7 +19,7 @@ import (
|
||||
type Manager interface {
|
||||
Deliver(
|
||||
to *policy.Recipient,
|
||||
from string,
|
||||
from *policy.Origin,
|
||||
recipients []*policy.Recipient,
|
||||
prefix string,
|
||||
content []byte,
|
||||
@@ -43,7 +43,7 @@ type StoreManager struct {
|
||||
// Deliver submits a new message to the store.
|
||||
func (s *StoreManager) Deliver(
|
||||
to *policy.Recipient,
|
||||
from string,
|
||||
from *policy.Origin,
|
||||
recipients []*policy.Recipient,
|
||||
prefix string,
|
||||
source []byte,
|
||||
@@ -56,7 +56,8 @@ func (s *StoreManager) Deliver(
|
||||
}
|
||||
fromaddr, err := env.AddressList("From")
|
||||
if err != nil || len(fromaddr) == 0 {
|
||||
fromaddr = []*mail.Address{{Address: from}}
|
||||
fromaddr = make([]*mail.Address, 1)
|
||||
fromaddr[0] = &from.Address
|
||||
}
|
||||
toaddr, err := env.AddressList("To")
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user