1
1
freepoteries-doc/content/mail_new_domain.rst
Maxime Alves LIRMM 6f368b37e8 [mail]
2022-10-27 11:18:42 +02:00

62 lines
2.0 KiB
ReStructuredText
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

DOMAIN=gitu.be
SELECTOR=mail
IP=127.0.0.1
cd /etc/dkimkeys
mkdir $DOMAIN
opendkim-genkey --domain=$DOMAIN --selector=$SELECTOR --directory=./$DOMAIN
chown -R opendkim: ./$DOMAIN
service opendkim restart
# Avoir un fichier ".ini" avec les details de l'accès API
mkdir /etc/lexicon
echo "dns_gandi_api_key = xxXXXxxx" > /etc/lexicon/gandi.ini
TOKEN=`awk '{ print $3 }' /etc/lexicon/gandi-freepoteries.ini`
lexicon gandi --auth-token $TOKEN --api-protocol rest --name $SELECTOR._domainkey list $DOMAIN TXT
# If it returns something, delete it
lexicon gandi --auth-token $TOKEN --api-protocol rest --name $SELECTOR._domainkey delete $DOMAIN TXT
# Get dkim txt content in variable
CONTENT=`cat gitu.be/mail.txt | tr -d '\n' | sed -E 's/^.*\(([^\)]*)\).*$/\1/;s/"([[:space:]])*"//g;s/ //g'`
# Check the content :
echo $CONTENT
# Set the TXT row
lexicon gandi --auth-token $TOKEN --api-protocol rest --name $SELECTOR._domainkey --content $CONTENT create $DOMAIN TXT
# DMARC
lexicon gandi --auth-token $TOKEN --api-protocol rest --name _dmarc --content "v=DMARC1; p=quarantine; adkim=r; aspf=r;" create gitu.be TXT
# SPF
lexicon gandi --auth-token $TOKEN --api-protocol rest --name '@' --content "v=spf1 mx a:mail.usinette.net ip4:91.121.171.218 ?all" create gitu.be TXT
# Create the domain on modoboa
# Set the password for domain administrator account
# Connect to your account using a mail client
# Use https://www.mail-tester.com/ to test your configuration
### DNS RECORDS ###
@ 86400 IN SOA ns1.gandi.net. hostmaster.gandi.net. 1645632008 10800 3600 604800
10800
@ 10800 IN A $IP
@ 10800 IN AAAA $IPv6
@ 10800 IN MX 10 $DOMAIN.
@ 10800 IN MX 20 SECONDAY.MAIL.SERVER.
@ 10800 IN TXT "v=spf1 mx a:$DOMAIN ip4:$IP ipv6:$IPv6 ?all"
_imap._tcp 10800 IN SRV 0 0 0 .
_imaps._tcp 10800 IN SRV 0 1 993 listonmail.fr.
_pop3._tcp 10800 IN SRV 0 0 0 .
_pop3s._tcp 10800 IN SRV 10 1 995 listonmail.fr.
_submission._tcp 10800 IN SRV 0 1 465 listonmail.fr.
webmail 10800 IN A $IP
webmail 10800 IN AAAA $IPv6