Mailto URI Tests

Click each "given" link for a test and compare the field values in the generated compose form with the expected results. After the individual expected results, there's an equivalent_to link. Clicking it will load the expected values in a compose form, but note that the link could be affected by browser bugs, so use the individual expected values to double check.

Repeat the tests by dragging each "given" link to the tab bar.

Repeat the tests again by selecting each "given" link's textContent, copying the selection, and pasting it in a new, blank tab.

Repeat the tests again by passing each "given" link's textContent to the mail client (after quoting the textContent) on the command line with the client closed.

Repeat the tests again by passing each "given" link's textContent to the mail client (after quoting the textContent) on the command line with the client already open.

Hovering over expected Body values that contain newlines will show the JS literal value for clarity.

Test to make sure '#', '=' and '&' before first '?', extra '?' and extra '=' don't mess up parsing.

mailto:#1=2&3=4?subject=?#=&body=line1

#1=2&3=4

?#=

line1

mailto:%231%3D2%263%3D4?subject=%3F%23%3D&body=line1

Test case-insensitivity

mailto:?tO=1&sUbJeCt=2&bOdY=3&cC=4&bCc=5

mailto:?TO=1&SUBJECT=2&BODY=3&CC=4&BCC=5

1

2

3

4

5

mailto:1?subject=2&body=3&cc=4&bcc=5

Test case-insensitivity and examples of unnecessary percent-encoding an hname

mailto:?%74%4F=1&%73%55%62%4A%65%43%74=2&%62%4F%64%59=3&%63%43=4&%62%43%63=5

1

2

3

4

5

mailto:1?subject=2&body=3&cc=4&bcc=5

Test that lowercase %HH still work.

mailto:%5e?subject=%5e&body=%5e&cc=%5e&bcc=%5e

^

^

^

^

^

mailto:%5E?subject=%5E&body=%5E&cc=%5E&bcc=%5E

Test that invalid %HH are treated literally.

mailto:%3y%?subject=%3y%&body=%3y%&cc=%3y%&bcc=%3y%

%3y%

%3y%

%3y%

%3y%

%3y%

mailto:%253y%25?subject=%253y%25&body=%253y%25&cc=%253y%25&bcc=%253y%25

Test that unsafe %HH are treated literally (uppercase).

mailto:?to=%00%01%02%03%04%05%06%07%08%0B%0C%0E%0F%10%11%12%13%14%15%16%17%18%19%1A%1B%1C%1D%1E%1F&subject=%00%01%02%03%04%05%06%07%08%0B%0C%0E%0F%10%11%12%13%14%15%16%17%18%19%1A%1B%1C%1D%1E%1F&body=%00%01%02%03%04%05%06%07%08%0B%0C%0E%0F%10%11%12%13%14%15%16%17%18%19%1A%1B%1C%1D%1E%1F&cc=%00%01%02%03%04%05%06%07%08%0B%0C%0E%0F%10%11%12%13%14%15%16%17%18%19%1A%1B%1C%1D%1E%1F&bcc=%00%01%02%03%04%05%06%07%08%0B%0C%0E%0F%10%11%12%13%14%15%16%17%18%19%1A%1B%1C%1D%1E%1F

mailto:%00%01%02%03%04%05%06%07%08%0B%0C%0E%0F%10%11%12%13%14%15%16%17%18%19%1A%1B%1C%1D%1E%1F?subject=%00%01%02%03%04%05%06%07%08%0B%0C%0E%0F%10%11%12%13%14%15%16%17%18%19%1A%1B%1C%1D%1E%1F&body=%00%01%02%03%04%05%06%07%08%0B%0C%0E%0F%10%11%12%13%14%15%16%17%18%19%1A%1B%1C%1D%1E%1F&cc=%00%01%02%03%04%05%06%07%08%0B%0C%0E%0F%10%11%12%13%14%15%16%17%18%19%1A%1B%1C%1D%1E%1F&bcc=%00%01%02%03%04%05%06%07%08%0B%0C%0E%0F%10%11%12%13%14%15%16%17%18%19%1A%1B%1C%1D%1E%1F

%00%01%02%03%04%05%06%07%08%0B%0C%0E%0F%10%11%12%13%14%15%16%17%18%19%1A%1B%1C%1D%1E%1F

%00%01%02%03%04%05%06%07%08%0B%0C%0E%0F%10%11%12%13%14%15%16%17%18%19%1A%1B%1C%1D%1E%1F

%00%01%02%03%04%05%06%07%08%0B%0C%0E%0F%10%11%12%13%14%15%16%17%18%19%1A%1B%1C%1D%1E%1F

%00%01%02%03%04%05%06%07%08%0B%0C%0E%0F%10%11%12%13%14%15%16%17%18%19%1A%1B%1C%1D%1E%1F

%00%01%02%03%04%05%06%07%08%0B%0C%0E%0F%10%11%12%13%14%15%16%17%18%19%1A%1B%1C%1D%1E%1F

mailto:%2500%2501%2502%2503%2504%2505%2506%2507%2508%250B%250C%250E%250F%2510%2511%2512%2513%2514%2515%2516%2517%2518%2519%251A%251B%251C%251D%251E%251F?subject=%2500%2501%2502%2503%2504%2505%2506%2507%2508%250B%250C%250E%250F%2510%2511%2512%2513%2514%2515%2516%2517%2518%2519%251A%251B%251C%251D%251E%251F&body=%2500%2501%2502%2503%2504%2505%2506%2507%2508%250B%250C%250E%250F%2510%2511%2512%2513%2514%2515%2516%2517%2518%2519%251A%251B%251C%251D%251E%251F&cc=%2500%2501%2502%2503%2504%2505%2506%2507%2508%250B%250C%250E%250F%2510%2511%2512%2513%2514%2515%2516%2517%2518%2519%251A%251B%251C%251D%251E%251F&bcc=%2500%2501%2502%2503%2504%2505%2506%2507%2508%250B%250C%250E%250F%2510%2511%2512%2513%2514%2515%2516%2517%2518%2519%251A%251B%251C%251D%251E%251F

Test that unsafe %HH are treated literally (lowercase).

mailto:?to=%00%01%02%03%04%05%06%07%08%0b%0c%0e%0f%10%11%12%13%14%15%16%17%18%19%1a%1b%1c%1d%1e%1f&subject=%00%01%02%03%04%05%06%07%08%0b%0c%0e%0f%10%11%12%13%14%15%16%17%18%19%1a%1b%1c%1d%1e%1f&body=%00%01%02%03%04%05%06%07%08%0b%0c%0e%0f%10%11%12%13%14%15%16%17%18%19%1a%1b%1c%1d%1e%1f&cc=%00%01%02%03%04%05%06%07%08%0b%0c%0e%0f%10%11%12%13%14%15%16%17%18%19%1a%1b%1c%1d%1e%1f&bcc=%00%01%02%03%04%05%06%07%08%0b%0c%0e%0f%10%11%12%13%14%15%16%17%18%19%1a%1b%1c%1d%1e%1f

mailto:%00%01%02%03%04%05%06%07%08%0b%0c%0e%0f%10%11%12%13%14%15%16%17%18%19%1a%1b%1c%1d%1e%1f?subject=%00%01%02%03%04%05%06%07%08%0b%0c%0e%0f%10%11%12%13%14%15%16%17%18%19%1a%1b%1c%1d%1e%1f&body=%00%01%02%03%04%05%06%07%08%0b%0c%0e%0f%10%11%12%13%14%15%16%17%18%19%1a%1b%1c%1d%1e%1f&cc=%00%01%02%03%04%05%06%07%08%0b%0c%0e%0f%10%11%12%13%14%15%16%17%18%19%1a%1b%1c%1d%1e%1f&bcc=%00%01%02%03%04%05%06%07%08%0b%0c%0e%0f%10%11%12%13%14%15%16%17%18%19%1a%1b%1c%1d%1e%1f

%00%01%02%03%04%05%06%07%08%0b%0c%0e%0f%10%11%12%13%14%15%16%17%18%19%1a%1b%1c%1d%1e%1f

%00%01%02%03%04%05%06%07%08%0b%0c%0e%0f%10%11%12%13%14%15%16%17%18%19%1a%1b%1c%1d%1e%1f

%00%01%02%03%04%05%06%07%08%0b%0c%0e%0f%10%11%12%13%14%15%16%17%18%19%1a%1b%1c%1d%1e%1f

%00%01%02%03%04%05%06%07%08%0b%0c%0e%0f%10%11%12%13%14%15%16%17%18%19%1a%1b%1c%1d%1e%1f

%00%01%02%03%04%05%06%07%08%0b%0c%0e%0f%10%11%12%13%14%15%16%17%18%19%1a%1b%1c%1d%1e%1f

mailto:%2500%2501%2502%2503%2504%2505%2506%2507%2508%250b%250c%250e%250f%2510%2511%2512%2513%2514%2515%2516%2517%2518%2519%251a%251b%251c%251d%251e%251f?subject=%2500%2501%2502%2503%2504%2505%2506%2507%2508%250b%250c%250e%250f%2510%2511%2512%2513%2514%2515%2516%2517%2518%2519%251a%251b%251c%251d%251e%251f&body=%2500%2501%2502%2503%2504%2505%2506%2507%2508%250b%250c%250e%250f%2510%2511%2512%2513%2514%2515%2516%2517%2518%2519%251a%251b%251c%251d%251e%251f&cc=%2500%2501%2502%2503%2504%2505%2506%2507%2508%250b%250c%250e%250f%2510%2511%2512%2513%2514%2515%2516%2517%2518%2519%251a%251b%251c%251d%251e%251f&bcc=%2500%2501%2502%2503%2504%2505%2506%2507%2508%250b%250c%250e%250f%2510%2511%2512%2513%2514%2515%2516%2517%2518%2519%251a%251b%251c%251d%251e%251f">mailto:%2500%2501%2502%2503%2504%2505%2506%2507%2508%250b%250c%250e%250f%2510%2511%2512%2513%2514%2515%2516%2517%2518%2519%251a%251b%251c%251d%251e%251f?subject=%2500%2501%2502%2503%2504%2505%2506%2507%2508%250b%250c%250e%250f%2510%2511%2512%2513%2514%2515%2516%2517%2518%2519%251a%251b%251c%251d%251e%251f&body=%2500%2501%2502%2503%2504%2505%2506%2507%2508%250b%250c%250e%250f%2510%2511%2512%2513%2514%2515%2516%2517%2518%2519%251a%251b%251c%251d%251e%251f&cc=%2500%2501%2502%2503%2504%2505%2506%2507%2508%250b%250c%250e%250f%2510%2511%2512%2513%2514%2515%2516%2517%2518%2519%251a%251b%251c%251d%251e%251f&bcc=%2500%2501%2502%2503%2504%2505%2506%2507%2508%250b%250c%250e%250f%2510%2511%2512%2513%2514%2515%2516%2517%2518%2519%251a%251b%251c%251d%251e%251f">mailto:%2500%2501%2502%2503%2504%2505%2506%2507%2508%250b%250c%250e%250f%2510%2511%2512%2513%2514%2515%2516%2517%2518%2519%251a%251b%251c%251d%251e%251f?subject=%2500%2501%2502%2503%2504%2505%2506%2507%2508%250b%250c%250e%250f%2510%2511%2512%2513%2514%2515%2516%2517%2518%2519%251a%251b%251c%251d%251e%251f&body=%2500%2501%2502%2503%2504%2505%2506%2507%2508%250b%250c%250e%250f%2510%2511%2512%2513%2514%2515%2516%2517%2518%2519%251a%251b%251c%251d%251e%251f&cc=%2500%2501%2502%2503%2504%2505%2506%2507%2508%250b%250c%250e%250f%2510%2511%2512%2513%2514%2515%2516%2517%2518%2519%251a%251b%251c%251d%251e%251f&bcc=%2500%2501%2502%2503%2504%2505%2506%2507%2508%250b%250c%250e%250f%2510%2511%2512%2513%2514%2515%2516%2517%2518%2519%251a%251b%251c%251d%251e%251f

Test to see if RFC2368 duplicate hname handling is supported (won't be supported if Smart duplicate hname handling is supported)

mailto:?to=1t&to=2t&subject=1&subject=2&body=1&body=2&cc=1&cc=2&bcc=1&bcc=2

mailto:1t?to=2t&subject=1&subject=2&body=1&body=2&cc=1&cc=2&bcc=1&bcc=2

mailto:3t?to=1t&to=2t&subject=1&subject=2&body=1&body=2&cc=1&cc=2&bcc=1&bcc=2

mailto:3t?tO=1t&To=2t&subject=1&sUbJeCt=2&body=1&bOdY=2&cc=1&cC=2&bcc=1&bCc=2

2t

2

2

2

2

mailto:2t?subject=2&body=2&cc=2&bcc=2

Test to see if smart duplicate hname handling is supported (won't be supported if RFC2368 duplicate hname handling is supported)

mailto:1t?to=&to=&to=2t&to=3t&to=&to=&subject=1&subject=2&subject=&body=&body=&body=line1&body=&body=line3&body=&cc=&cc=&cc=1&cc=&cc=&cc=2&cc=3&bcc=&bcc=&bcc=1&bcc=2&bcc=&bcc=&bcc=3

1t, 2t, 3t

line1 line3

1, 2, 3

1, 2, 3

mailto:1t%2C%202t%2C%203t?body=line1%0D%0A%0D%0Aline3%0D%0A&cc=1%2C%202%2C%203&bcc=1%2C%202%2C%203

Test to make sure that '+' is treated as '+'

mailto:+?subject=+&body=+&cc=+&bcc=+

+

+

+

+

+

mailto:%2B?subject=%2B&body=%2B&cc=%2B&bcc=%2B

Test that newlines are stripped from to, cc, bcc and subject, but not body

mailto:line1%0D%0Aline2?subject=line1%0D%0Aline2&body=line1%0D%0Aline2&cc=line1%0D%0Aline2&bcc=line1%0D%0Aline2

mailto:?to=line1%0D%0Aline2&subject=line1%0D%0Aline2&body=line1%0D%0Aline2&cc=line1%0D%0Aline2&bcc=line1%0D%0Aline2

mailto:line1%0d%0aline2?subject=line1%0d%0aline2&body=line1%0d%0aline2&cc=line1%0d%0aline2&bcc=line1%0d%0aline2

mailto:?to=line1%0d%0aline2&subject=line1%0d%0aline2&body=line1%0d%0aline2&cc=line1%0d%0aline2&bcc=line1%0d%0aline2

line1line2

line1line2

line1 line2

line1line2

line1line2

mailto:line1line2?subject=line1line2&body=line1%0D%0Aline2&cc=line1line2&bcc=line1line2

Test that UTF-8 %HH sequence emit the chars they represent

mailto:%E2%88%9A?subject=%E2%88%9A&body=%E2%88%9A&cc=%E2%88%9A&bcc=%E2%88%9A

mailto:?to=%E2%88%9A&subject=%E2%88%9A&body=%E2%88%9A&cc=%E2%88%9A&bcc=%E2%88%9A

mailto:%e2%88%9a?subject=%e2%88%9a&body=%e2%88%9a&cc=%e2%88%9a&bcc=%e2%88%9a

mailto:?to=%e2%88%9a&subject=%e2%88%9a&body=%e2%88%9a&cc=%e2%88%9a&bcc=%e2%88%9a

mailto:%E2%88%9A?subject=%E2%88%9A&body=%E2%88%9A&cc=%E2%88%9A&bcc=%E2%88%9A

Test that a mailto URI with a To value that just has an integer is treated as a mailto URI (This will never pass when entering the URI in the address field. The URI will be treated as an http URI pointing to the 'mailto' domain on port 1.)

mailto:1

1

mailto:1

Test that mailto URI detection is handled case-insensitively

MaIlTo:test

test

mailto:test