3 final class PhabricatorMetaMTAConfigOptions
4 extends PhabricatorApplicationConfigOptions
{
6 public function getName() {
10 public function getDescription() {
11 return pht('Configure Mail.');
14 public function getIcon() {
18 public function getGroup() {
22 public function getOptions() {
23 $send_as_user_desc = $this->deformat(pht(<<<EODOC
24 When a user takes an action which generates an email notification (like
25 commenting on a Differential revision), the "From" address can either be set
26 to the user's email address (like "alincoln@logcabin.com") or the
27 "metamta.defualt-address" address.
29 The user experience is generally better if the user's real address is used as
30 the "From" header value, since the messages are easier to organize when they
31 appear in mail clients, but this will only work if the server is authorized to
32 send email on behalf of the "From" domain. Practically, this means:
34 - If you are doing an install for Example Corp and all the users will have
35 corporate @corp.example.com addresses and any hosts this software is running
36 on are authorized to send email from corp.example.com, you can enable this
37 to make the user experience a little better.
38 - If you are doing an install for an open source project and your users will
39 be registering via third-party services and/or using personal email
40 addresses, you probably should not enable this or all of your outgoing
41 email might vanish into SFP blackholes.
42 - If your install is anything else, you're safer leaving this off, at least
43 initially, since the risk in turning it on is that your outgoing mail will
48 $one_mail_per_recipient_desc = $this->deformat(pht(<<<EODOC
49 When a message is sent to multiple recipients (for example, several reviewers on
50 a code review), it can either be delieverd as one email to everyone (e.g., "To:
51 alincoln, usgrant, htaft") or separate emails to each user (e.g., "To:
52 alincoln", "To: usgrant", "To: htaft"). The major advantages and disadvantages
55 - One mail to everyone:
56 - This violates policy controls. The body of the mail is generated without
57 respect for object policies.
58 - Recipients can see To/Cc at a glance.
59 - If you use mailing lists, you won't get duplicate mail if you're
60 a normal recipient and also Cc'd on a mailing list.
61 - Getting threading to work properly is harder, and probably requires
62 making mail less useful by turning off options.
63 - Sometimes people will "Reply All", which can send mail to too many
64 recipients. This software will try not to send mail to users who already
65 received a similar message, but can not prevent all stray email arising
67 - Not supported with a private reply-to address.
68 - Mail messages are sent in the server default translation.
69 - Mail that must be delivered over secure channels will leak the recipient
70 list in the "To" and "Cc" headers.
71 - One mail to each user:
72 - Policy controls work correctly and are enforced per-user.
73 - Recipients need to look in the mail body to see To/Cc.
74 - If you use mailing lists, recipients may sometimes get duplicate
76 - Getting threading to work properly is easier, and threading settings
77 can be customzied by each user.
78 - "Reply All" will never send extra mail to other users involved in the
80 - Required if private reply-to addresses are configured.
81 - Mail messages are sent in the language of user preference.
86 $reply_hints_description = $this->deformat(pht(<<<EODOC
87 You can disable the hints under "REPLY HANDLER ACTIONS" if users prefer
88 smaller messages. The actions themselves will still work properly.
92 $recipient_hints_description = $this->deformat(pht(<<<EODOC
93 You can disable the "To:" and "Cc:" footers in mail if users prefer smaller
98 $email_preferences_description = $this->deformat(pht(<<<EODOC
99 You can disable the email preference link in emails if users prefer smaller
104 $re_prefix_description = $this->deformat(pht(<<<EODOC
105 Mail.app on OS X Lion won't respect threading headers unless the subject is
106 prefixed with "Re:". If you enable this option, this software will add "Re:" to
107 the subject line of all mail which is expected to thread. If you've set
108 'metamta.one-mail-per-recipient', users can override this setting in their
113 $vary_subjects_description = $this->deformat(pht(<<<EODOC
114 If true, allow MetaMTA to change mail subjects to put text like '[Accepted]' and
115 '[Commented]' in them. This makes subjects more useful, but might break
116 threading on some clients. If you've set '%s', users can override this setting
117 in their preferences.
120 'metamta.one-mail-per-recipient'));
122 $reply_to_description = $this->deformat(pht(<<<EODOC
123 If you enable `%s`, this software uses "From" to authenticate users. You can
124 additionally enable this setting to try to authenticate with 'Reply-To'. Note
125 that this is completely spoofable and insecure (any user can set any 'Reply-To'
126 address) but depending on the nature of your install or other deliverability
127 conditions this might be okay. Generally, you can't do much more by spoofing
128 Reply-To than be annoying (you can write but not read content). But this is
129 still **COMPLETELY INSECURE**.
132 'metamta.public-replies'));
134 $adapter_description = $this->deformat(pht(<<<EODOC
135 Adapter class to use to transmit mail to the MTA. The default uses
136 PHPMailerLite, which will invoke "sendmail". This is appropriate if sendmail
137 actually works on your host, but if you haven't configured mail it may not be so
138 great. A number of other mailers are available (e.g., SES, SendGrid, SMTP,
139 custom mailers). This option is deprecated in favor of 'cluster.mailers'.
143 $public_replies_description = $this->deformat(pht(<<<EODOC
144 By default, this software generates unique reply-to addresses and sends a
145 separate email to each recipient when you enable reply handling. This is more
146 secure than using "From" to establish user identity, but can mean users may
147 receive multiple emails when they are on mailing lists. Instead, you can use a
148 single, non-unique reply to address and authenticate users based on the "From"
149 address by setting this to 'true'. This trades away a little bit of security
150 for convenience, but it's reasonable in many installs. Object interactions are
151 still protected using hashes in the single public email address, so objects
152 can not be replied to blindly.
156 $single_description = $this->deformat(pht(<<<EODOC
157 If you want to use a single mailbox for reply mail, you can use this
158 and set a common prefix for generated reply addresses. It will
159 make use of the fact that a mail-address such as
160 `devtools+D123+1hjk213h@example.com` will be delivered to the `devtools`
161 user's mailbox. Set this to the left part of the email address and it will be
162 prepended to all generated reply addresses.
164 For example, if you want to use `devtools@example.com`, this should be set
169 $address_description = $this->deformat(pht(<<<EODOC
170 When email is sent, what format should the software use for users' email
171 addresses? Valid values are:
173 - `short`: 'gwashington <gwashington@example.com>'
174 - `real`: 'George Washington <gwashington@example.com>'
175 - `full`: 'gwashington (George Washington) <gwashington@example.com>'
177 The default is `full`.
181 $mailers_description = $this->deformat(pht(<<<EODOC
182 Define one or more mail transmission services. For help with configuring
183 mailers, see **[[ %s | %s ]]** in the documentation.
186 PhabricatorEnv
::getDoclink('Configuring Outbound Email'),
187 pht('Configuring Outbound Email')));
189 $default_description = $this->deformat(pht(<<<EODOC
190 Default address used as a "From" or "To" email address when an address is
191 required but no meaningful address is available.
193 If you configure inbound mail, you generally do not need to set this:
194 the software will automatically generate and use a suitable mailbox on the
197 Otherwise, this option should be configured to point at a valid mailbox which
198 discards all mail sent to it. If you point it at an invalid mailbox, mail sent
199 by the software and some mail sent by users will bounce. If you point it at a
200 real user mailbox, that user will get a lot of mail they don't want.
202 For further guidance, see **[[ %s | %s ]]** in the documentation.
205 PhabricatorEnv
::getDoclink('Configuring Outbound Email'),
206 pht('Configuring Outbound Email')));
209 $this->newOption('cluster.mailers', 'cluster.mailers', array())
211 ->setDescription($mailers_description),
212 $this->newOption('metamta.default-address', 'string', null)
214 ->setSummary(pht('Default address used when generating mail.'))
215 ->setDescription($default_description),
217 'metamta.one-mail-per-recipient',
223 pht('Send Mail To Each Recipient'),
224 pht('Send Mail To All Recipients'),
228 'Controls whether email for multiple recipients is sent by '.
229 'creating one message with everyone in the "To:" line, or '.
230 'multiple messages that each have a single recipeint in the '.
232 ->setDescription($one_mail_per_recipient_desc),
233 $this->newOption('metamta.can-send-as-user', 'bool', false)
236 pht('Send as User Taking Action'),
239 PlatformSymbols
::getPlatformServerName()),
243 'Controls whether email is sent "From" users.'))
244 ->setDescription($send_as_user_desc),
246 'metamta.reply-handler-domain',
250 ->setDescription(pht('Domain used for reply email addresses.'))
251 ->addExample('devtools.example.com', ''),
252 $this->newOption('metamta.recipients.show-hints', 'bool', true)
255 pht('Show Recipient Hints'),
256 pht('No Recipient Hints'),
258 ->setSummary(pht('Show "To:" and "Cc:" footer hints in email.'))
259 ->setDescription($recipient_hints_description),
260 $this->newOption('metamta.email-preferences', 'bool', true)
263 pht('Show Email Preferences Link'),
264 pht('No Email Preferences Link'),
266 ->setSummary(pht('Show email preferences link in email.'))
267 ->setDescription($email_preferences_description),
268 $this->newOption('metamta.public-replies', 'bool', false)
271 pht('Use Public Replies (Less Secure)'),
272 pht('Use Private Replies (More Secure)'),
276 'Reply addresses can either be private (more secure) or '.
277 'public (which works better with mailing lists).'))
278 ->setDescription($public_replies_description),
279 $this->newOption('metamta.single-reply-handler-prefix', 'string', null)
281 pht('Allow a single mailbox to be used for all replies.'))
282 ->setDescription($single_description),
283 $this->newOption('metamta.user-address-format', 'enum', 'full')
286 'short' => pht('Short'),
287 'real' => pht('Real'),
288 'full' => pht('Full'),
290 ->setSummary(pht('Control how user names are rendered in mail.'))
291 ->setDescription($address_description)
292 ->addExample('gwashington <gwashington@example.com>', 'short')
293 ->addExample('George Washington <gwashington@example.com>', 'real')
295 'gwashington (George Washington) <gwashington@example.com>',
297 $this->newOption('metamta.email-body-limit', 'int', 524288)
300 'You can set a limit for the maximum byte size of outbound mail. '.
301 'Mail which is larger than this limit will be truncated before '.
302 'being sent. This can be useful if your MTA rejects mail which '.
303 'exceeds some limit (this is reasonably common). Specify a value '.
305 ->setSummary(pht('Global cap for size of generated emails (bytes).'))
306 ->addExample(524288, pht('Truncate at 512KB'))
307 ->addExample(1048576, pht('Truncate at 1MB')),