tougenkyou

IPv6-only email server

tech

add dns records

make sure both the forward and reverse DNS match.

An SPF record must be a DNS record of type TXT (type 16). DNS record type of SPF (type 99) is deprecated and should not be used.

v=spf1 ip6:2001:470:XXXX:X:XXX:XXXX:XXXX:XXX -all

https://stackoverflow.com/questions/19142369/create-both-ipv4-and-ipv6-spf-record
https://serverfault.com/questions/355511/is-using-softfail-over-fail-in-the-spf-record-considered-best-practice/752911#752911

you don't need MX or SRV records if you're going to be sending and receiving from the same domain.

i didn't need to turn on DKIM or DMARC for gmail to receive my emails. i don't know if it has something to do with ipv6 address space, but here https://support.google.com/mail/answer/81126#authentication

install postfix

edit /etc/postfix/main.cf

set myhostname, mydomain, inet_interfaces, and inet_protocols.

use the Maildir mailbox format.

sudo postconf -e "home_mailbox = Maildir/"

Next, you need to configure Postfix to enable your email client to connect to your new SMTP server.

smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
smtpd_sasl_local_domain = $myhostname
smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks, reject_unauth_destination
broken_sasl_auth_clients = yes
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth

Append the above to /etc/postfix/main.cf.

install dovecot

edit /etc/dovecot/dovecot.conf

protocols = imap             
listen = [2001:470:XXXX:X:XXX:XXXX:XXXX:XXX]

https://docs.rackspace.com/support/how-to/dovecot-installation-and-configuration-on-centos/

The socket gets made by running dovecot. It is dovecot that offers a service to postfix, so dovecot should create it. It should get made as soon as dovecot starts. If there is no socket after you restart dovecot, check the dovecot logs, not postfix.

https://www.namecheap.com/support/knowledgebase/article.aspx/9795/69/installing-and-configuring-ssl-on-postfixdovecot-mail-server/

open up your firewall

assuming you are using firewalld, do something like this https://support.moonpoint.com/network/email/postfix/firewalld-postfix.php

sudo firewall-cmd --permanent --add-service={http,https,smtp-submission,smtps,imap,imaps}

https://support.moonpoint.com/network/email/postfix/firewalld-postfix.php
https://www.linuxbabe.com/redhat/install-dovecot-centos-enable-tls-encryption

testing

echo "test mail" | sendmail  "unix_username"

to send mail locally.

.muttrc

set mbox_type=Maildir
set spoolfile="~/Maildir/"
set folder="~/Maildir/"
set mask=".*"
set record="+.Sent"
set postponed="+.Drafts"

# Generate mailboxes for each maildir subdir
#
# mailboxes ! + `\
#
# for file in ~/Maildir/.*; do \
#
#   box=$(basename "$file"); \
#
#     if [ ! "$box" = '.' -a ! "$box" = '..' -a ! "$box" = '.customflags' \
#
#           -a ! "$box" = '.subscriptions' ]; then \
#
#              echo -n "\"+$box\" "; \
#
#                fi; \
#
#                done`
set smtp_url = 'smtp://user:password@your.domain'
set from = 'user@your.domain'
set realname = 'real_name'