.\" $OpenBSD: smtpd.conf.5,v 1.4 2008/12/06 02:04:56 gilles Exp $ .\" .\" Copyright (c) 2008 Janne Johansson .\" .\" Permission to use, copy, modify, and distribute this software for any .\" purpose with or without fee is hereby granted, provided that the above .\" copyright notice and this permission notice appear in all copies. .\" .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" .\" .Dd $Mdocdate: December 6 2008 $ .Dt SMTPD.CONF 5 .Os .Sh NAME .Nm smtpd.conf .Nd Simple Mail Transfer Protocol daemon configuration file .Sh DESCRIPTION .Nm is used to configure .Xr smtpd 8 , a small SMTP daemon. .Pp Lines beginning with .Sq # and empty lines are regarded as comments, and ignored. Lines may be split using the .Sq \e character. .Pp Additional configuration files can be included with the .Ic include keyword, for example: .Bd -literal -offset indent include "/etc/mail/sub.smtpd.conf" .Ed .Sh MACROS Macros can be defined that will later be expanded in context. Macro names must start with a letter, and may contain letters, digits and underscores. Macro names may not be reserved words (for example .Ar listen , .Ar accept , .Ar port ) . Macros are not expanded inside quotes. .Pp For example, .Bd -literal -offset indent smtp_port = 25 listen on 127.0.0.1 port $smtp_port listen on fxp0 port $smtp_port .Ed .Sh EXPANSION Some configuration directives expect expansion of their parameter at runtime. Such directives (for example .Ar deliver to mbox , .Ar deliver to maildir , .Ar deliver to mda , .Ar relay via ) may use format specifiers which will be expanded before delivery or relaying. The following formats are currently supported: %a expands to the user part of the email address prior to the resolution of aliases; %u expands to the user part after aliases resolution and will typically be the system account; %d expands to the domain part of the email address. .Sh FILES .Bl -tag -width "/etc/mail/smtpd.confXXX" -compact .It Pa /etc/mail/smtpd.conf Default .Xr smtpd 8 configuration file. .It Pa /var/spool/smtpd/ Spool directories for mail during processing. .El .Sh EXAMPLES The following example configures a machine to accept local delivery for both localhost and example.com, as well as the relaying of mail destined for example.org through the mx1.example.org server and mail destined for example.net through regular MX records lookup: .Bd -literal -offset indent listen on 0.0.0.0 port 25 accept for domain "localhost" deliver to mbox "/var/mail/%u" accept for domain "example.com" deliver to maildir "/home/%u/Maildir" accept for domain "example.org" relay via "mx1.example.org" accept for domain "example.net" relay .Ed .Sh SEE ALSO .Xr smtpctl 8 , .Xr smtpd 8 , .Xr smtpdb 8 .Sh HISTORY .Xr smtpd 8 first appeared in .Ox 4.5 .