Module TMail::TextUtils
In: lib/action_mailer/vendor/tmail-1.2.3/tmail/utils.rb

Text Utils provides a namespace to define TOKENs, ATOMs, PHRASEs and CONTROL characters that are OK per RFC 2822.

It also provides methods you can call to determine if a string is safe

Methods

Constants

CONTROL_CHAR = /[#{control}]/n
ATOM_UNSAFE = /[#{Regexp.quote aspecial}#{control}#{lwsp}]/n
PHRASE_UNSAFE = /[#{Regexp.quote aspecial}#{control}]/n
TOKEN_UNSAFE = /[#{Regexp.quote tspecial}#{control}#{lwsp}]/n

Public Instance methods

Returns true if the string supplied is free from characters not allowed as an ATOM

Provides a method to join a domain name by it‘s parts and also makes it ATOM safe by quoting it as needed

If the string supplied has ATOM unsafe characters in it, will return the string quoted in double quotes, otherwise returns the string unmodified

If the string supplied has PHRASE unsafe characters in it, will return the string quoted in double quotes, otherwise returns the string unmodified

If the string supplied has TOKEN unsafe characters in it, will return the string quoted in double quotes, otherwise returns the string unmodified

Takes a time zone string from an EMail and converts it to Unix Time (seconds)

Returns true if the string supplied is free from characters not allowed as a TOKEN

Unwraps supplied string from inside double quotes Returns unquoted string

[Validate]