Skip to content

Instantly share code, notes, and snippets.

@azumakuniyuki azumakuniyuki/smtpd.conf
Last active Dec 11, 2015

What would you like to do?
Sample smtpd.conf on OpenBSD 5.2
# $OpenBSD: smtpd.conf,v 1.4 2012/07/16 05:56:16 jmc Exp $
# This is the smtpd server system-wide configuration file.
# See smtpd.conf(5) for more information.
# See also
# ファイル内でマクロが使える
if_ext = "pppoe0"
if_int = "vr0"
hostname ""
# マクロの参照は$マクロ名
listen on lo0
listen on $if_ext
listen on $if_int
# 外部データベースファイルの定義
map aliases source db "/etc/smtpd/aliases.db"
map authinfo source db "/etc/smtpd/authinfo.db"
map virtusers source db "/etc/smtpd/virtusers.db"
map relayhosts source plain "/etc/smtpd/relay-domains"
# local宛(*は~/Maildirへ配送する
accept for local alias aliases deliver to maildir
# バーチャルドメインの対応
accept from all for virtual map "virtusers" deliver to maildir
# 特定ドメイン宛メールのリレー先定義
accept for domain "" relay via "tls+auth://" auth "authinfo"
accept for domain "*" relay via "tls+auth://" auth "authinfo"
accept for domain "" relay via "smtp://"
# relayhostsマップに定義したホストからはリレーを受け付ける
accept from map "relayhosts" for all relay
# from *を省略するとfrom localとして解釈される
# よってlocal(このホスト)からは全部リレーする
accept for all relay
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.