mirror of
https://blitiri.com.ar/repos/chasquid
synced 2025-12-16 14:27:01 +00:00
mda-lmtp: Handle "<>" addresses
Either the recipient or from addresses can be "<>" to indicate the null address. mda-lmtp does not handle that well, as it sends "<<>>" which is invalid. This patch fixes that by special-casing them, which is unfortunate but reasonably common.
This commit is contained in:
@@ -84,6 +84,13 @@ func main() {
|
||||
tempExit("Could not get hostname: %v", err)
|
||||
}
|
||||
|
||||
if *fromwhom == "<>" {
|
||||
*fromwhom = ""
|
||||
}
|
||||
if *recipient == "<>" {
|
||||
*recipient = ""
|
||||
}
|
||||
|
||||
cmd(tc, 250, "LHLO %s", hostname)
|
||||
cmd(tc, 250, "MAIL FROM:<%s>", *fromwhom)
|
||||
cmd(tc, 250, "RCPT TO:<%s>", *recipient)
|
||||
|
||||
32
cmd/mda-lmtp/test_tcp_null.cmy
Normal file
32
cmd/mda-lmtp/test_tcp_null.cmy
Normal file
@@ -0,0 +1,32 @@
|
||||
|
||||
nc tcp_listen localhost:14932
|
||||
|
||||
mda |= ./mda-lmtp --addr=localhost:14932 -f "<>" -d "<>" < .data
|
||||
|
||||
nc -> 220 Hola desde expect
|
||||
|
||||
nc <~ LHLO .*
|
||||
nc -> 250-Bienvenido!
|
||||
nc -> 250 Contame...
|
||||
|
||||
nc <- MAIL FROM:<>
|
||||
nc -> 250 Aja
|
||||
|
||||
nc <- RCPT TO:<>
|
||||
nc -> 250 Aja
|
||||
|
||||
nc <- DATA
|
||||
nc -> 354 Dale
|
||||
|
||||
nc <- Subject: test
|
||||
nc <-
|
||||
nc <- This is a test.
|
||||
nc <- .
|
||||
|
||||
nc -> 250 Recibido
|
||||
|
||||
nc <- QUIT
|
||||
nc -> 221 Chauchas
|
||||
|
||||
mda wait 0
|
||||
|
||||
Reference in New Issue
Block a user