mirror of
https://github.com/decke/smtprelay.git
synced 2026-11-06 07:51:36 -06:00
feat: add alias file support
This commit is contained in:
1 parent
6e9c00e171
commit
7b6be95125
5 files changed
+88
-4
No files matched your search
@@ -159,6 +159,17 @@ func mailHandler(peer smtpd.Peer, env smtpd.Envelope) error {
|
||||
peerIP = addr.IP.String()
|
||||
}
|
||||
|
||||
// Check for aliases
|
||||
for i, recipient := range env.Recipients {
|
||||
if alias, exists := aliasesList[recipient]; exists {
|
||||
env.Recipients[i] = alias
|
||||
log.Info().
|
||||
Str("original_recipient", recipient).
|
||||
Str("aliased_recipient", alias).
|
||||
Msg("Recipient address aliased")
|
||||
}
|
||||
}
|
||||
|
||||
logger := log.With().
|
||||
Str("from", env.Sender).
|
||||
Strs("to", env.Recipients).
|
||||
|
||||
Reference in new issue
Block a user