Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F972162
PhabricatorSetupCheckMail.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
3 KB
Referenced Files
None
Subscribers
None
PhabricatorSetupCheckMail.php
View Options
<?php
final
class
PhabricatorSetupCheckMail
extends
PhabricatorSetupCheck
{
protected
function
executeChecks
()
{
$adapter
=
PhabricatorEnv
::
getEnvConfig
(
'metamta.mail-adapter'
);
switch
(
$adapter
)
{
case
'PhabricatorMailImplementationPHPMailerLiteAdapter'
:
if
(!
Filesystem
::
pathExists
(
'/usr/bin/sendmail'
)
&&
!
Filesystem
::
pathExists
(
'/usr/sbin/sendmail'
))
{
$message
=
pht
(
'Mail is configured to send via sendmail, but this system has '
.
'no sendmail binary. Install sendmail or choose a different '
.
'mail adapter.'
);
$this
->
newIssue
(
'config.metamta.mail-adapter'
)
->
setShortName
(
pht
(
'Missing Sendmail'
))
->
setName
(
pht
(
'No Sendmail Binary Found'
))
->
setMessage
(
$message
)
->
addRelatedPhabricatorConfig
(
'metamta.mail-adapter'
);
}
break
;
case
'PhabricatorMailImplementationAmazonSESAdapter'
:
if
(
PhabricatorEnv
::
getEnvConfig
(
'metamta.can-send-as-user'
))
{
$message
=
pht
(
'Amazon SES does not support sending email as users. Disable '
.
'send as user, or choose a different mail adapter.'
);
$this
->
newIssue
(
'config.can-send-as-user'
)
->
setName
(
pht
(
"SES Can't Send As User"
))
->
setMessage
(
$message
)
->
addRelatedPhabricatorConfig
(
'metamta.mail-adapter'
)
->
addPhabricatorConfig
(
'metamta.can-send-as-user'
);
}
if
(!
PhabricatorEnv
::
getEnvConfig
(
'amazon-ses.access-key'
))
{
$message
=
pht
(
'Amazon SES is selected as the mail adapter, but no SES access '
.
'key is configured. Provide an SES access key, or choose a '
.
'different mail adapter.'
);
$this
->
newIssue
(
'config.amazon-ses.access-key'
)
->
setName
(
pht
(
'Amazon SES Access Key Not Set'
))
->
setMessage
(
$message
)
->
addRelatedPhabricatorConfig
(
'metamta.mail-adapter'
)
->
addPhabricatorConfig
(
'amazon-ses.access-key'
);
}
if
(!
PhabricatorEnv
::
getEnvConfig
(
'amazon-ses.secret-key'
))
{
$message
=
pht
(
'Amazon SES is selected as the mail adapter, but no SES secret '
.
'key is configured. Provide an SES secret key, or choose a '
.
'different mail adapter.'
);
$this
->
newIssue
(
'config.amazon-ses.secret-key'
)
->
setName
(
pht
(
'Amazon SES Secret Key Not Set'
))
->
setMessage
(
$message
)
->
addRelatedPhabricatorConfig
(
'metamta.mail-adapter'
)
->
addPhabricatorConfig
(
'amazon-ses.secret-key'
);
}
$address_key
=
'metamta.default-address'
;
$options
=
PhabricatorApplicationConfigOptions
::
loadAllOptions
();
$default
=
$options
[
$address_key
]->
getDefault
();
$value
=
PhabricatorEnv
::
getEnvConfig
(
$address_key
);
if
(
$default
===
$value
)
{
$message
=
pht
(
'Amazon SES requires verification of the "From" address, but '
.
'you have not configured a "From" address. Configure and verify '
.
'a "From" address, or choose a different mail adapter.'
);
$this
->
newIssue
(
'config.metamta.default-address'
)
->
setName
(
pht
(
'No SES From Address Configured'
))
->
setMessage
(
$message
)
->
addRelatedPhabricatorConfig
(
'metamta.mail-adapter'
)
->
addPhabricatorConfig
(
'metamta.default-address'
);
}
break
;
}
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Wed, Jun 18, 6:05 AM (1 d, 16 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
226280
Default Alt Text
PhabricatorSetupCheckMail.php (3 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment