1.\" $OpenBSD: aliases.5,v 1.17 2021/02/13 07:20:49 jmc Exp $ 2.\" 3.\" Copyright (c) 2012 Gilles Chehade <gilles@poolp.org> 4.\" 5.\" Permission to use, copy, modify, and distribute this software for any 6.\" purpose with or without fee is hereby granted, provided that the above 7.\" copyright notice and this permission notice appear in all copies. 8.\" 9.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16.\" 17.Dd $Mdocdate: February 13 2021 $ 18.Dt ALIASES 5 19.Os 20.Sh NAME 21.Nm aliases 22.Nd aliases file for smtpd 23.Sh DESCRIPTION 24This manual page describes the format of the 25.Nm 26file, as used by 27.Xr smtpd 8 . 28An alias, in its simplest form, is used to assign an arbitrary name 29to an email address or a group of email addresses. 30This provides a convenient way to send mail. 31For example an alias could refer to all users of a group: 32email to that alias would be sent to all members of the group. 33Much more complex aliases can be defined however: 34an alias can refer to other aliases, 35be used to send mail to a file instead of another person, 36or to execute various commands. 37.Pp 38Within the file, 39.Ql # 40is a comment delimiter; anything placed after it is discarded. 41The file consists of key/value mappings of the form: 42.Bd -filled -offset indent 43key: value1, value2, value3, ... 44.Ed 45.Pp 46.Em key 47is always folded to lowercase before alias lookups to ensure that 48there can be no ambiguity. 49The key is expanded to the corresponding values, 50which consist of one or more of the following: 51.Bl -tag -width Ds 52.It Em user 53A user on the host machine. 54The user must have a valid entry in the 55.Xr passwd 5 56database file. 57.It Ar /path/to/file 58Append messages to 59.Ar file , 60specified by its absolute pathname. 61.It | Ns Ar command 62Pipe the message to 63.Ar command 64on its standard input. 65The command is run under the privileges of the daemon's unprivileged account. 66.It : Ns Ar include : Ns Ar /path/to/file 67Include any definitions in 68.Ar file 69as alias entries. 70The format of the file is identical to this one. 71.It Ar user-part@domain-part 72An email address in RFC 5322 format. 73If an address extension is appended to the user-part, 74it is first compared for an exact match. 75It is then stripped so that an address such as user+ext@example.com 76will only use the part that precedes 77.Sq + 78as a 79.Em key . 80.It Ar error : Ns Ar code message 81A status code and message to return. 82The code must be 3 digits, 83starting 4XX (TempFail) or 5XX (PermFail). 84The message must be present and can be freely chosen. 85.El 86.Sh FILES 87.Bl -tag -width "/etc/mail/aliasesXXX" -compact 88.It Pa /etc/mail/aliases 89Default 90.Nm 91file. 92.El 93.Sh SEE ALSO 94.Xr smtpd.conf 5 , 95.Xr makemap 8 , 96.Xr newaliases 8 , 97.Xr smtpd 8 98.Sh HISTORY 99The 100.Nm 101file format appeared in 102.Bx 4.0 . 103