Method code for $smtp.format_email_address()

[Turn off line numbering]
  1: arg recip, @notfull;
  2: var host, mailname;
  3: 
  4: host = (| (.get_hosts_setting())[1] |);
  5: mailname = recip.mail_name();
  6: if ((| .lookup_alias(recip.name().replace(" ", "-")) |)) {
  7:     mailname = strsed(mailname, "^[*~]", "");
  8: } else {
  9:     mailname = strsub(recip.mail_name(), "*", "list-");
 10:     if (.get_setting("cold-relay-recip", $smtp))
 11:         mailname = strsub(mailname, "~", "user-");
 12:     else
 13:         mailname = strsub(mailname, "~", "");
 14: }
 15: if (host) {
 16:     if (notfull)
 17:         return mailname + "@" + host;
 18:     return recip.name().capitalize() + " <" + mailname + "@" + host + ">";
 19: } else {
 20:     if (notfull)
 21:         return mailname;
 22:     return recip.name().capitalize() + " <" + mailname + ">";
 23: }

// Created 13-Oct-1996 as a part of ColdCore, see: @help Credit

Tlon