Add SPF and DKIM hints for each sending method

This commit is contained in:
Kijin Sung 2016-05-19 14:11:55 +09:00
parent ce66292fe4
commit 729bfe8239
10 changed files with 184 additions and 0 deletions

View file

@ -66,6 +66,26 @@ abstract class Base implements \Rhymix\Framework\Drivers\MailInterface
return array();
}
/**
* Get the SPF hint.
*
* @return string
*/
public static function getSPFHint()
{
return '';
}
/**
* Get the DKIM hint.
*
* @return string
*/
public static function getDKIMHint()
{
return '';
}
/**
* Check if the current mail driver is supported on this server.
*

View file

@ -25,6 +25,16 @@ class MailFunction extends Base implements \Rhymix\Framework\Drivers\MailInterfa
return 'PHP mail()';
}
/**
* Get the SPF hint.
*
* @return string
*/
public static function getSPFHint()
{
return 'ip4:$SERVER_ADDR';
}
/**
* Check if the current mail driver is supported on this server.
*

View file

@ -22,6 +22,26 @@ class Mailgun extends Base implements \Rhymix\Framework\Drivers\MailInterface
return array('api_domain', 'api_token');
}
/**
* Get the SPF hint.
*
* @return string
*/
public static function getSPFHint()
{
return 'include:mailgun.org';
}
/**
* Get the DKIM hint.
*
* @return string
*/
public static function getDKIMHint()
{
return 'mailo._domainkey';
}
/**
* Check if the current mail driver is supported on this server.
*

View file

@ -29,4 +29,24 @@ class Mandrill extends SMTP implements \Rhymix\Framework\Drivers\MailInterface
{
return array('api_user', 'api_token');
}
/**
* Get the SPF hint.
*
* @return string
*/
public static function getSPFHint()
{
return 'include:spf.mandrillapp.com';
}
/**
* Get the DKIM hint.
*
* @return string
*/
public static function getDKIMHint()
{
return 'mandrill._domainkey';
}
}

View file

@ -29,4 +29,24 @@ class Postmark extends SMTP implements \Rhymix\Framework\Drivers\MailInterface
{
return array('api_token');
}
/**
* Get the SPF hint.
*
* @return string
*/
public static function getSPFHint()
{
return 'include:spf.mtasv.net';
}
/**
* Get the DKIM hint.
*
* @return string
*/
public static function getDKIMHint()
{
return '********.pm._domainkey';
}
}

View file

@ -29,4 +29,24 @@ class SendGrid extends SMTP implements \Rhymix\Framework\Drivers\MailInterface
{
return array('api_user', 'api_pass');
}
/**
* Get the SPF hint.
*
* @return string
*/
public static function getSPFHint()
{
return 'include:sendgrid.net';
}
/**
* Get the DKIM hint.
*
* @return string
*/
public static function getDKIMHint()
{
return 'smtpapi._domainkey';
}
}

View file

@ -43,6 +43,26 @@ class SES extends Base implements \Rhymix\Framework\Drivers\MailInterface
return array('us-east-1', 'us-west-2', 'eu-west-1');
}
/**
* Get the SPF hint.
*
* @return string
*/
public static function getSPFHint()
{
return '';
}
/**
* Get the DKIM hint.
*
* @return string
*/
public static function getDKIMHint()
{
return '********._domainkey';
}
/**
* Check if the current mail driver is supported on this server.
*

View file

@ -22,6 +22,26 @@ class SparkPost extends Base implements \Rhymix\Framework\Drivers\MailInterface
return array('api_token');
}
/**
* Get the SPF hint.
*
* @return string
*/
public static function getSPFHint()
{
return 'include:sparkpostmail.com';
}
/**
* Get the DKIM hint.
*
* @return string
*/
public static function getDKIMHint()
{
return '********._domainkey';
}
/**
* Check if the current mail driver is supported on this server.
*

View file

@ -51,6 +51,26 @@ class Woorimail extends Base implements \Rhymix\Framework\Drivers\MailInterface
return array('free', 'paid');
}
/**
* Get the SPF hint.
*
* @return string
*/
public static function getSPFHint()
{
return 'include:woorimail.com';
}
/**
* Get the DKIM hint.
*
* @return string
*/
public static function getDKIMHint()
{
return '';
}
/**
* Check if the current mail driver is supported on this server.
*