Removes old mail scripts

This commit is contained in:
pierreozoux 2015-09-18 12:22:09 +01:00
parent a85ade7815
commit 569381753d
3 changed files with 0 additions and 97 deletions

View file

@ -1,27 +0,0 @@
#!/bin/bash -ex
EMAIL=$1
PASSWORD=`echo $RANDOM date | md5sum | base64 | cut -c-10`
MYSQL_PASS=`cat /data/domains/mail/mysql/.env | cut -d= -f2`
DOMAIN=$(echo ${EMAIL} | cut -f2 -d@)
/usr/bin/docker run \
--rm \
--name add_email_support_to_$DOMAIN \
--link mysql-mail:db \
indiepaas/mysql \
mysql \
-uadmin \
-p$MYSQL_PASS \
-h db \
-e "INSERT INTO servermail.virtual_users (domain_id, password , email) \
VALUES( \
(SELECT id FROM servermail.virtual_domains WHERE name='$DOMAIN'), \
ENCRYPT('$PASSWORD', CONCAT('\$6\$', SUBSTRING(SHA(RAND()), -16))), \
'$EMAIL');"
echo "Email added with success"
echo "Pass: $PASSWORD"

View file

@ -1,22 +0,0 @@
#!/bin/bash -ex
DOMAIN=$1
SOURCE=$2
DESTINATION=$3
MYSQL_PASS=`cat /data/domains/mail/mysql/.env | cut -d= -f2`
/usr/bin/docker run \
--rm \
--name add_email_support_to_$DOMAIN \
--link mysql-mail:db \
indiepaas/mysql \
mysql \
-uadmin \
-p$MYSQL_PASS \
-h db \
-e "INSERT INTO servermail.virtual_aliases (domain_id, source , destination) \
VALUES( \
(SELECT id FROM servermail.virtual_domains WHERE name='$DOMAIN'), \
'$SOURCE',
'$DESTINATION');"

View file

@ -1,48 +0,0 @@
#!/bin/bash -ex
DOMAIN=$1
MYSQL_PASS=`cat /data/domains/mail/mysql/.env | cut -d= -f2`
/usr/bin/docker run \
--rm \
--name add_email_support_to_$DOMAIN \
--link mysql-mail:db \
indiepaas/mysql \
mysql \
-uadmin \
-p$MYSQL_PASS \
-h db \
-e "INSERT INTO servermail.virtual_domains (name) VALUES ('$DOMAIN');"
mkdir -p /data/domains/mail/opendkim/keys/$DOMAIN
/usr/bin/docker run \
--rm \
--name opendkim-genkey \
-v /data/domains/mail/opendkim:/etc/opendkim \
indiepaas/postfix \
/usr/bin/opendkim-genkey -D /etc/opendkim/keys/$DOMAIN/ -d $DOMAIN -s mail
/usr/bin/docker run \
--rm \
--name opendkim-genkey \
-v /data/domains/mail/opendkim:/etc/opendkim \
indiepaas/postfix \
/bin/chown -R opendkim /etc/opendkim/keys
mv /data/domains/mail/opendkim/keys/$DOMAIN/mail.private /data/domains/mail/opendkim/keys/$DOMAIN/mail
echo mail._domainkey.$DOMAIN $DOMAIN:mail:/etc/opendkim/keys/$DOMAIN/mail >> /data/domains/mail/opendkim/KeyTable
echo *@$DOMAIN mail._domainkey.$DOMAIN >> /data/domains/mail/opendkim/SigningTable
echo $DOMAIN >> /data/domains/mail/opendkim/TrustedHosts
echo galaxy.$DOMAIN >> /data/domains/mail/opendkim/TrustedHosts
echo "Domain installed with success."
echo "Please add the followig records to it's DNS."
cat /data/domains/mail/opendkim/keys/$DOMAIN/mail.txt
echo "And don't forget spf :)"