Template:No spam/doc

From Zoophilia Wiki
Revision as of 11:27, 10 August 2024 by SockyPaws (talk | contribs) (Bonehead move (see what I did there?), accidentally wrote my documentation on the sandbox page. Copying here, will edit sandbox to appropriate content forthwith.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

The {{No spam}} 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,[1] altering the format of the email address to where it does not match the 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 (Unicode U+0040[2]). 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
{{No spam|account|example.com}}account@example.com
Without parameters
{{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[3], the document which first defined the protocol used by servers to transmit and receive email still today. In § 4.1.2, "Command Syntax", we learn that…

<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)

every ASCII character, including the equality symbol (=), a space ( ) or even ANOTHER @ 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 section, but examples of using them would be:

{{No spam|local=account|domain=example.com}}account@example.com

or

{{No spam|1=account|2=example.com}}account@example.com

TemplateData

Displays an email address with the '@' symbol replaced by an image, to thwart automated harvesting for spam

Template parameters

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
Mailbox namelocal mailbox 1

The local part of the address, which precedes the '@' symbol

Example
mail
Linerequired
Domain namedomain mailhost 2

The domain part of the address, which follows the '@' symbol

Example
mail.com
Linerequired

References

  1. Robyn Pearce (January 2006). About Time for Teaching: 120 Time-Saving Tips for Teachers and Those Who Support Them. Auckland: Getting a Grip Publishing. p. 137. ISBN 978-0-7900-1044-1. Retrieved August 10, 2024.
  2. The Unicode Consortium (2023 September 12). The Unicode Standard, Version 15.1, C0 Controls and Basic Latin. Accessed August 10, 2024.
  3. Postel, Jonathan B. (August 1982). "Simple Mail Transport Protocol". IETF. pp. 29–30. doi:10.17487/RFC0821. Accessed August 10, 2024.