---
name: "smtp.relay"
section: "5"
platform: "linux"
package: "sharc"
version: "2.1-1"
release: "Debian 2.2 (Potato)"
platforms: ["linux"]
url: "https://new.carta.tech/smtp.relay"
---

# smtp.relay(5)

sendmail relay-control database

## NAME

smtp.relay - sendmail relay-control database

## SYNOPSIS

**/etc/mail/smtp.relay**

## DESCRIPTION

This is a sample (and a typical) smtp.relay file:

    \# IP address ranges that can relay anywhere:\
     \#\
     127\
     10\.128/9        # Our own addresses\
     195\.18.160/23   # Customer X\
     163\.22          # Customer Y\
     100\.22.2.56     # Mail server Z\
     \#\
     \# Domain names we accept mail for:\
     \#\
     mydomain.com\
     another-domain.com\
     yet-another-domain.com\
     \#\
     include sendmail.cw\
     include mailertable\
     include secondary-mx

This file contains two types of entries - a collection of the ranges of IP adresses that we will allow to connect to our mail server to perform unlimited relaying (typicly our own and our customers IP addresses), and a collection of domain names we accept mail for.

How this works, in short:

The mail server will accept mail destined for the domain names in this file from ANYWHERE, and will accept mail for OTHER domains ONLY from clients whose IP adresses are in this file.

This gives you complete relay control.

The syntactis details:

The file contains one entry per line, which is either 1-4 IP octets optionaly followed by a netmask (like in the smtp.access file) or a domain name. The contents of other files may be included with the "include filename" directive. This is very useful since you probably have several files containing domain names you accept mail for (like "sendmail.cw", "mailertable" and others) and you'd rather not have to keep multiple records of these domain names. If an entry is a domain name, the rest of the line following the domain name is ignored.  This is perfect for including files like "mailertable" which contains other stuff after the domain. (Includes may be nested as deep as you like).

The software will complain if addresses and masks are inconsistent. Example:

    50\.12.72.0 /18     \<====  Illegal because bit 21 is a 1

    50\.12.64.0 /18     \<====  Ok, all 0's after bit 18

One last thing - you can specify all subdomains of a domain with a leading dot (just like in sendmail's "mailertable"): .domain.com matches dept1.domain.com, sect1.dept1.domain.com and so on.

Everything following a # through the rest of the line is a comment.

## DESCRIPTION

## SEE ALSO

**[sharc-update(8)](/sharc-update/8.md),** **[mk-accessdb(8)](/mk-accessdb/8.md),** **[mk-relaydb(8)](/mk-relaydb/8.md)** and **[smtp.access(5)](/smtp.access/5.md)**

## AUTHOR

This manual page, based on the original README, was written by Stig Sandbeck Mathisen \<ssm@debian.org\>, for the Debian GNU/Linux system (but may be used by others).
