mirror of
https://github.com/mjl-/mox.git
synced 2024-12-26 16:33:47 +03:00
in smtpserver, allow a space after "mail from:" and "rcpt to:" commands for submission connections
the space is explicitly mentioned as not valid in rfc 5321, but it clients do send it, such as microsoft outlook 365 apps for enterprise. no need to punish such users, we'll allow it. but only for submission, not regular smtp, because it is normally a sign of a spammer. we still don't allow it in pedantic mode (as used by localserve). for issue #51 by hmfaysal, thanks for reporting and testing!
This commit is contained in:
parent
6273afe84f
commit
a31dfc573e
1 changed files with 10 additions and 0 deletions
|
@ -1203,6 +1203,11 @@ func (c *conn) cmdMail(p *parser) {
|
|||
}()
|
||||
p.xtake(" FROM:")
|
||||
// note: no space after colon. ../rfc/5321:1093
|
||||
// Allow illegal space for submission only, not for regular SMTP. Microsoft Outlook
|
||||
// 365 Apps for Enterprise sends it.
|
||||
if c.submission && !moxvar.Pedantic {
|
||||
p.space()
|
||||
}
|
||||
rawRevPath := p.xrawReversePath()
|
||||
paramSeen := map[string]bool{}
|
||||
for p.space() {
|
||||
|
@ -1331,6 +1336,11 @@ func (c *conn) cmdRcpt(p *parser) {
|
|||
// ../rfc/5321:1985
|
||||
p.xtake(" TO:")
|
||||
// note: no space after colon. ../rfc/5321:1093
|
||||
// Allow illegal space for submission only, not for regular SMTP. Microsoft Outlook
|
||||
// 365 Apps for Enterprise sends it.
|
||||
if c.submission && !moxvar.Pedantic {
|
||||
p.space()
|
||||
}
|
||||
var fpath smtp.Path
|
||||
if p.take("<POSTMASTER>") {
|
||||
fpath = smtp.Path{Localpart: "postmaster"}
|
||||
|
|
Loading…
Reference in a new issue