1
0
mirror of https://blitiri.com.ar/repos/chasquid synced 2025-12-17 14:37:02 +00:00

aliases: Treat empty pipe aliases as bad lines and skip them

A pipe alias must have a command, if it doesn't, we should treat the
line as bad and skip it like we do for others.
This commit is contained in:
Alberto Bertogli
2019-10-22 22:05:52 +01:00
parent 5f72f723db
commit dea6f73164
2 changed files with 8 additions and 0 deletions

View File

@@ -307,6 +307,10 @@ func parseReader(domain string, r io.Reader) (map[string][]Recipient, error) {
if rawalias[0] == '|' {
cmd := strings.TrimSpace(rawalias[1:])
if cmd == "" {
// A pipe alias without a command is invalid.
continue
}
aliases[addr] = []Recipient{{cmd, PIPE}}
} else {
rs := []Recipient{}