Created
June 26, 2013 23:39
-
-
Save saimonmoore/5872757 to your computer and use it in GitHub Desktop.
Demonstrate Microsoft SMTPSVC mail header bug
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# With invalid space between "Microsoft" and "SMTPSVC" | |
# Parses incorrectly | |
irb(main):001:0> Mail::Header.new( "Received: from LEXCV6.live.trust.xblt.nhs.uk ([12.10.5.27]) by lexcb1.live.trust.xblt.nhs.uk with Microsoft SMTPSVC(6.0.3790.4675); Fri, 26 Oct 2012 15:42:13 +0100" ).errors | |
=> [[Received, from LEXCV6.live.trust.xblt.nhs.uk ([12.10.5.27]) by lexcb1.live.trust.xblt.nhs.uk with Microsoft SMTPSVC(6.0.3790.4675); Fri, 26 Oct 2012 15:42:13 +0100, #<Mail::Field::ParseError: ReceivedElement can not parse |from LEXCV6.live.trust.xblt.nhs.uk ([12.10.5.27]) by lexcb1.live.trust.xblt.nhs.uk with Microsoft SMTPSVC(6.0.3790.4675); Fri, 26 Oct 2012 15:42:13 +0100| | |
Reason was: Expected one of | |
, (, <, ., ", !, #, $, %, &, ', *, +, -, /, =, ?, ^, _, `, {, |, }, ~, [ at line 1, column 121 (byte 121) after from LEXCV6.live.trust.xblt.nhs.uk ([12.10.5.27]) by lexcb1.live.trust.xblt.nhs.uk with Microsoft SMTPSVC(6.0.3790.4675) | |
>]] | |
# Without invalid space between "Microsoft" and "SMTPSVC" | |
# Parses correctly | |
irb(main):002:0> Mail::Header.new( "Received: from LEXCV6.live.trust.xblt.nhs.uk ([12.10.5.27]) by lexcb1.live.trust.xblt.nhs.uk with MicrosoftSMTPSVC(6.0.3790.4675); Fri, 26 Oct 2012 15:42:13 +0100" ).errors | |
=> [] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment