Sendmail: Theory and Practice, Second Edition

The steps in adding a new mailer are fairly straightforward. The header translations, mailer definitions, and testing are what take a lot of thought.
Determine the address formats. You need to understand what addresses will look like from this new mail environment and what you have to do, if you care to, to transform them for any other mail arena you support. If you were adding UUCP you'd be looking for addresses in bang notation.
Write the rules in Ruleset 3 to recognize mail from this mailer and tag it. This means determining how to recognize it and defining the tag to use and writing the lines to do that. Again, with the UUCP mail example, this means deciding to change addresses like
decwrl!decuac!avolio
into
decuac!avolio<@decwrl.UUCP>
for later handling. Rules we might add to Ruleset 3 are
# UUCP conversionsR$-.$+!$+ $@$>7$3<@$1.$2> host.domain!userR$-!$+ $@$>7$2<@$1.UUCP> resolve uucp names
Add lines in Ruleset 0 to recognize it and dispatch it. We need to recognize the form we decided on in the additional lines to Ruleset 3 (in this case $+<@$+.UUCP>) and decide what we will do with them.
# UUCP#R$*<@$-.UUCP> $#uucp $@$2 $:$2!$1 use our own uucp
Write the mailer definition. This is separate, of course, from writing the mailer...