Template:No spam/sandbox: Difference between revisions

From Zoophilia Wiki
Jump to navigationJump to search
SockyPaws (talk | contribs)
Create template documentation page
Tag: 2017 source edit
 
SockyPaws (talk | contribs)
Replace errant documentation text with proper wikicode from root template
Tags: Replaced 2017 source edit
 
Line 1: Line 1:
{{Documentation subpage}}
<span style="white-space: pre;">{{{local|{{{mailbox|{{{1|<noinclude>account</noinclude>}}}}}}}}}[[File:At sign.svg|x14px|@|link=]]{{{domain|{{{mailhost|{{{2|<noinclude>example.com</noinclude>}}}}}}}}}</span>
The &lbrace;&lbrace;[[Template:No spam|No spam]]&rbrace;&rbrace; template is designed to help prevent spam from being sent to email addresses which are part of the content of wiki pages. As nearly all email address harvesting for these purposes is automated,<ref name="Pearce2006">Robyn Pearce (January 2006). [https://robynpearce.com/products/about-time-for-teachers ''About Time for Teaching: 120 Time-Saving Tips for Teachers and Those Who Support Them'']. Auckland: Getting a Grip Publishing. p. 137. [[wikipedia:ISBN|ISBN]] [https://search.worldcat.org/title/156759530?oclcNum=156759530 978-0-7900-1044-1]. Retrieved {{#formatdate:2024-08-10|mdy}}.</ref> altering the format of the email address to where it does not match the [[wikipedia:Regular expression|regular expression]](s) used by the tools which scrape them from web page content helps prevent spam. It works by displaying an ''image'' of the '@' symbol instead of the typographical "Commercial At" symbol ([[wikipedia:Unicode|Unicode]] U+0040<ref name="U0040">The Unicode Consortium ({{#formatdate:2023-09-12|ymd}}). [https://www.unicode.org/charts/PDF/U0000.pdf The Unicode Standard, Version 15.1, ''C0 Controls and Basic Latin'']. Accessed {{#formatdate:2024-08-10|mdy}}.</ref>). This prevents automated search engines and crawlers that use the '@' symbol to detect email addresses from identifying them here, preventing their retrieval and addition to any spam recipient lists.
 
== Usage ==
If an email address input is provided as parameters, the template will display the email address and with an image of the '@' symbol inserted, instead of the actual typographical symbol. When invoked without parameters, only the image of the '@' symbol is displayed, and the user is responsible for placing the local and domain parts of the email address on both sides.
 
; With parameters : <code>&lbrace;&lbrace;{{ROOTPAGENAME}}|account|example.com&rbrace;&rbrace;</code> → {{{{ROOTPAGENAME}}|account|example.com}}
; Without parameters : <code>&lbrace;&lbrace;{{ROOTPAGENAME}}&rbrace;&rbrace;</code> → {{No spam}}
 
=== Parameters ===
The template accepts two parameters, meant to hold the portions of the address that precede and follow the '@' symbol, in that order.
 
==== Atypical characters ====
While this template should perform as expected in the vast majority of cases, email addresses with unusual characters present in the local or left-hand portion can lead to issues. In practice, most commercial email hosting services disallow the use of anything but a handful of non-ASCII glyphs when selecting a mailbox name, but this does not change the fact that they ''are'' acceptable as defined in RFC 821<ref name="RFC821">Postel, Jonathan B. (August 1982). [https://datatracker.ietf.org/doc/html/rfc821 ''"Simple Mail Transport Protocol"'']. [[wikipedia:Internet Engineering Task Force|IETF]]. pp. 29–30. [[wikipedia:Digital object identifier|doi]]:[https://doi.org/10.17487%2FRFC0821 10.17487/RFC0821]. Accessed {{#formatdate:2024-08-10|mdy}}.</ref>, the document which first defined the protocol used by servers to transmit and receive email still today. In [https://datatracker.ietf.org/doc/html/rfc821#section-4.1.2 § 4.1.2, "Command Syntax"], we learn that…
<pre style="margin: 1em 6em;">
<mailbox> ::= <local-part> "@" <domain>
<local-part> ::= <dot-string> | <quoted-string>
[…]
<dot-string> ::= <string> | <string> "." <dot-string>
<string> ::= <char> | <char> <string>
<quoted-string> ::=  """ <qtext> """
<qtext> ::=  "\" <x> | "\" <x> <qtext> | <q> | <q> <qtext>
<char> ::= <c> | "\" <x>
[…]
<SP> ::= the space character (ASCII code 32)
[…]
<c> ::= any one of the 128 ASCII characters, but not any <special> or <SP>
<x> ::= any one of the 128 ASCII characters (no exceptions)
<special> ::= "<" | ">" | "(" | ")" | "[" | "]" | "\" | "." | "," | ";" | ":" | "@"  """ | the control characters (ASCII codes 0 through 31 inclusive and 127)
</pre>
…'''''every''''' ASCII character, including the equality symbol (<code>=</code>), a space (<code>&#32;</code>) or even ''ANOTHER <code>@</code> SYMBOL'' is perfectly valid in the local part of the address provided both user and server take care to enclose the local part in quotation marks. With the knowledge that email addresses using one of these uncommon characters may occasionally be encountered and cause this template to malfunction, a solution was identified to overcome this failure mode.
 
Such email addresses '''''must''''' be supplied to the template as ''named'' parameters and not unnamed (positional) ones. The parameter names and aliases are identified below in the [[#TemplateData|TemplateData]] section, but examples of using them would be:
 
<code>&lbrace;&lbrace;{{ROOTPAGENAME}}|local=account|domain=example.com&rbrace;&rbrace;</code> → {{{{ROOTPAGENAME}}|local=account|domain=example.com}}
 
or
 
<code>&lbrace;&lbrace;{{ROOTPAGENAME}}|1=account|2=example.com&rbrace;&rbrace;</code> → {{{{ROOTPAGENAME}}|1=account|2=example.com}}
 
== TemplateData ==
<templatedata>{
  "description": "Displays an email address with the '@' symbol replaced by an image, to thwart automated harvesting for spam",
  "format": "inline",
  "paramOrder": [
    "local",
    "domain"
  ],
  "params": {
    "domain": {
      "aliases": [
        "mailhost",
        "2"
      ],
      "label": "Domain name",
      "description": "The domain part of the address, which follows the '@' symbol",
      "example": "mail.com",
      "type": "line",
      "required": true
    },
    "local": {
      "aliases": [
        "mailbox",
        "1"
      ],
      "label": "Mailbox name",
      "description": "The local part of the address, which precedes the '@' symbol",
      "example": "mail",
      "type": "line",
      "required": true
    }
  }
}</templatedata>
 
== References ==
{{Reflist}}
 
<includeonly>
[[Category:Character-substitution templates]]
</includeonly>

Latest revision as of 11:29, 10 August 2024

account@example.com