-
Notifications
You must be signed in to change notification settings - Fork 0
/
Module.php
51 lines (45 loc) · 1.7 KB
/
Module.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php declare(strict_types=1);
/**
* Copyright (C) Apis Networks, Inc - All Rights Reserved.
*
* MIT License
*
* Written by Matt Saladna <matt@apisnetworks.com>, August 2018
*/
namespace Opcenter\Mail\Providers\Gmail;
use Module\Provider\Contracts\ProviderInterface;
// stub to make apnscp happy
class Module extends \Opcenter\Mail\Providers\Null\Module implements ProviderInterface
{
/**
* Get DNS records
*
* @param string $domain
* @param string $subdomain
* @return array
*/
public function provisioning_records(string $domain, string $subdomain = ''): array
{
$ttl = $this->dns_get_default('ttl');
return [
new \Opcenter\Dns\Record($domain,
['name' => $subdomain, 'ttl' => $ttl, 'rr' => 'MX', 'parameter' => '1 ASPMX.L.GOOGLE.COM.']),
new \Opcenter\Dns\Record($domain,
['name' => $subdomain, 'ttl' => $ttl, 'rr' => 'MX', 'parameter' => '5 ALT1.ASPMX.L.GOOGLE.COM.']),
new \Opcenter\Dns\Record($domain,
['name' => $subdomain, 'ttl' => $ttl, 'rr' => 'MX', 'parameter' => '5 ALT2.ASPMX.L.GOOGLE.COM.']),
new \Opcenter\Dns\Record($domain,
['name' => $subdomain, 'ttl' => $ttl, 'rr' => 'MX', 'parameter' => '10 ALT3.ASPMX.L.GOOGLE.COM.']),
new \Opcenter\Dns\Record($domain,
['name' => $subdomain, 'ttl' => $ttl, 'rr' => 'MX', 'parameter' => '10 ALT4.ASPMX.L.GOOGLE.COM.']),
new \Opcenter\Dns\Record($domain,
['name' => rtrim("mail.{$subdomain}",'.'), 'ttl' => $ttl, 'rr' => 'CNAME', 'parameter' => 'ghs.google.com.']),
new \Opcenter\Dns\Record($domain,
['name' => $subdomain,
'ttl' => $ttl,
'rr' => 'TXT',
'parameter' => '"v=spf1 include:_spf.google.com a ~all"'
]),
];
}
}