Try a Delivery Agent with /try

In the SMTP RCPT To: command, sendmail is required to express the recipient’s address relative to the local host. For domain addresses, this simply means that the address should be RFC2822-compliant (such as you@here.our.domain). For UUCP addresses, this can mean reversing the path (such as you@there reversing to there!you). The /try rule-testing command causes an address to be rewritten so that it appears to be correct relative to the local host.

The /try command is used like this:

/try agent address

Here, agent is the delivery agent, and address is the address to rewrite. The following usage message is produced if both agent and address are missing or if just the address is missing:

Usage: /try mailer address

The delivery agent (mailer) is used to select only the R= or S= rule set for the address. The /tryflags command (Select Whom to /parse or /try with /tryflags on page 311) determines which is selected (by selecting recipient or sender).

In the following example, the numbers to the left are for reference only and are not part of sendmail’s output:

   > /try smtp you Trying envelope-recipient address you for mailer esmtp ❶ canonify input: you Canonify2 input: you Canonify2 returns: you canonify returns: you ❷ 2 input: you 2 returns: you ❸ EnvToSMTP input: you PseudoToReal input: you PseudoToReal returns: you MasqSMTP input: you ❹ MasqSMTP returns: you < @ *LOCAL* > EnvToSMTP returns: you < @ here . our . domain . > ❺ final input: you < @ here . our . domain ...

Get sendmail, 4th Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.