I've been reading and it appears that NOTIFY=NEVER can not be mixed with any other NOTIFY commands
Para referência, é definido na RFC 1891 Seção 5.1
A RCPT command issued by a client may contain the optional esmtp-keyword "NOTIFY", to specify the conditions under which the SMTP server should generate DSNs for that recipient. If the NOTIFY esmtp-keyword is used, it MUST have an associated esmtp-value, formatted according to the following rules, using the ABNF of RFC 822:
notify-esmtp-value = "NEVER" / 1#notify-list-element notify-list-element = "SUCCESS" / "FAILURE" / "DELAY"
Notes:
a. Multiple notify-list-elements, separated by commas, MAY appear in a NOTIFY parameter; however, the NEVER keyword MUST appear by itself.
b. Any of the keywords NEVER, SUCCESS, FAILURE, or DELAY may be spelled in any combination of upper and lower case letters.
Este é o seu regex (parece ser copiado de esta página )
/^(RCPT\s+TO:<.*>.*)\s+NOTIFY=\S+(.*)/ $1 NOTIFY=NEVER$2
/^(RCPT\s+TO:.*)/ $1 NOTIFY=NEVER
Esta é a sequência de comandos RCPT do Outlook 2013
RCPT TO: <[email protected]> NOTIFY=SUCCESS,FAILURE,DELAY
A string acima corresponderá à segunda linha. Por quê? Porque entre TO:
e <[email protected]>
, há espaço em branco. Sua primeira linha de expressão regular não contém espaços em branco entre TO:
e '<'.
Para espaço entre ':' e '<' problema, aqui o que RFC 5321 diz
Since it has been a common source of errors, it is worth noting that spaces are not permitted on either side of the colon following FROM in the MAIL command or TO in the RCPT command. The syntax is exactly as given above.
Então, é por isso que o problema aparece localmente. Parece que o outlook ainda adicionando espaço entre após RCPT TO:
deste modo violar as especificações RFC.
Solução Regex:
Modifique a primeira linha de regex, para que ela se torne
/^(RCPT\s+TO:\s*<.*>.*)\s+NOTIFY=\S+(.*)/ $1 NOTIFY=NEVER$2
adicionar \ s * corresponderá a uma string que tenha zero ou mais espaço em branco após RCPT TO:
Para saber como funciona o regex, visite esta página .