

Return-Path: ĭelivered-To: from ( )īy (OpenSMTPD) with ESMTPS id 75b514d3 (TLSv1.2:ECDHE-RSA-AES256-GCM- SHA384:256:NO)ĭKIM-Signature: v=1 a=rsa-sha256 c=relaxed/relaxed d= īh=jhKB5/w9v87GaXSuizT576ntJ/72gvLRDhsqmGQQrCE= Review the contents of the file, including all of the mail headers, to verify the email delivery works properly. As the root user, browse to this location and verifiy you have a file named similar to this: :2.OpenSMTPD will create the maildir folder structure below /var/vmail and deliver the mail to /var/vmail///new.doas smtpd -nįrom an outside mail account, send a test email to one of the users. If no problems are found, restart the smtpd daemon. Use the OpenSMTPD configuration syntax checker. Openssl req -x509 -new -nodes -key private/mail.key -out mail.crt -days 3650 -sha256 Openssl genrsa -out private/mail.key 4096 When prompted for the common name, be sure it matches the FQDN of the server. Use a valid signed certificate if you have one. This example uses a self-signed certificate. Mail delivery attempted for addresses not defined in this file will be bounced with a Delivery Status Notification. OpenSMTPD will deliver the messages to /var/vmail//. The last three lines map the email addresses to the vmail account.The first four lines assign aliases for abuse, hostmaster, postmaster, and webmaster.doas chmod 0440 /etc/mail/credentialsĭoas chown _smtpd:_dovecot /etc/mail/credentialsĭoas useradd -c "Virtual Mail Account" -d /var/vmail -s /sbin/nologin -u 2000 -g =uid -L staff vmailĬreate /etc/mail/virtuals to define the valid email addresses. They are not required because the vmail account does not allow login. This avoids cluttering the directory with dot files from /etc/skel. When you create the vmail system user, you will receive the following warning: useradd: Warning: home directory '/var/vmail' doesn't exist, and -m was not specified. Create the vmail system user, group, and home directory.Set /etc/mail/credentials permissions to read-only for _smtpd and _dovecot system users.The virtual user name is the complete email address. Replace the example passwords with the passwords you generated in the previous step. Each line maps to a system account, vmail, with UID and GID of 2000. $2b$10$_EXAMPLE_PASSWORD3_IvRu4xbeOqOJJXlgEAKuS5sIrBvfdPvEzeqĮdit /etc/mail/credentials to add the required fields. $2b$10$_EXAMPLE_PASSWORD2_YKD.K0kQ2oylOmQ9SBUb0hIopBsmNxYPb4e The output looks similar to this: $2b$10$_EXAMPLE_PASSWORD1_3JbO4Ns2jJNZQfTS45MAnKi.IPrkKITyTa6 Smtpctl encrypt example_password3 > /etc/mail/credentials Smtpctl encrypt example_password2 > /etc/mail/credentials Smtpctl encrypt example_password1 > /etc/mail/credentials Generate the passwords and concatenate them to the /etc/mail/credentials file. This tutorial creates three example users. The two special fields define the virtual home directory and the mail location.
2019 spamsieve review password#
This database resembles the system password file in format, with two extra fields for Dovecot. OpenSMTPD and Dovecot can share an authentication database. Match auth from any for any action "outbound" Match from local for any action "outbound"

Match from local for local action "local_mail" # match from any for domain "" action "domain_mail" # Uncomment the following to accept external mail for domain "" Listen on egress port submission tls-require pki "mail" hostname "" auth Īction "domain_mail" maildir "/var/vmail//%" virtual # listen on all tls pki "mail" hostname "" # To accept external mail, replace with: listen on all Table credentials passwd:/etc/mail/credentialsįilter "rspamd" proc-exec "/usr/local/libexec/smtpd/filter-rspamd" Pki "mail" key "/etc/ssl/private/mail.key" This initial configuration does not activate the rspamd filter while testing OpenSMTP. cd /etc/mailĬreate a new nf as shown below. It should be configured to use virtual users instead of system users for security.īackup the default nf file and create a new one from scratch. It must be explicitly configured to listen on external interfaces. doas pkg_add opensmtpd-extras opensmtpd-filter-rspamd dovecot dovecot-pigeonhole rspamd redisīy default, OpenSMTPD only listens on localhost. Set up the package repository for OpenBSD. su -Įcho "permit nopass keepenv :wheel" > /etc/nf Set up your user account to perform tasks as root.

Verify the server's outbound port status. Choose a Vultr Compute Cloud instance with plenty of storage for the expected number of users. OpenSMTPD is the default mail server for OpenBSD. This tutorial demonstrates a full-featured email server running on OpenBSD using OpenSMTPD, Dovecot, Rspamd, and RainLoop.
