migrate therinaldos.com data
Build & Deploy to DigitalOcean Space / build (push) Failing after 2m38s

This commit is contained in:
2024-05-05 15:50:45 -04:00
commit ef1ff240d4
23182 changed files with 3801898 additions and 0 deletions
@@ -0,0 +1,57 @@
<?php
declare(strict_types=1);
/**
* @copyright 2020 Arne Hamann <github@arne.email>
*
* @author Arne Hamann <kontakt+github@arne.email>
* @author Morris Jobke <hey@morrisjobke.de>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
namespace OCP\Mail\Events;
use OCP\EventDispatcher\Event;
use OCP\Mail\IMessage;
/**
* Emitted before a system mail is sent. It can be used to alter the message.
*
* @since 19.0.0
*/
class BeforeMessageSent extends Event {
/** @var IMessage */
private $message;
/**
* @param IMessage $message
* @since 19.0.0
*/
public function __construct(IMessage $message) {
parent::__construct();
$this->message = $message;
}
/**
* @return IMessage
* @since 19.0.0
*/
public function getMessage(): IMessage {
return $this->message;
}
}
@@ -0,0 +1,74 @@
<?php
declare(strict_types=1);
/**
* @copyright Copyright (c) 2022 Bennet Becker <dev@bennet.cc>
*
* @author Bennet Becker <dev@bennet.cc>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
namespace OCP\Mail\Headers;
/**
* Keyword values for the Auto-Submitted email header, as per RFC 3834.
*
* The value "auto-notified" as per RFC 5436 is deliberately omitted as it is
* meant of notification of the sieve system.
*
* @link https://www.iana.org/assignments/auto-submitted-keywords/auto-submitted-keywords.xhtml
*
* @since 26.0.0
*/
final class AutoSubmitted {
/**
* Name of the Header as used in the final message later
*
* @var string
* @since 26.0.0
*/
public const HEADER = 'Auto-Submitted';
/**
* Indicates that a message was NOT automatically generated, but was
* created by a human (or following human interaction). It is the equivalent
* to the absence of an Auto-Submitted header altogether.
*
* @var string
* @since 26.0.0
*/
public const VALUE_NO = 'no';
/**
* Indicates that a message was generated by an automatic process, and is
* not a direct response to another message
*
* @var string
* @since 26.0.0
*/
public const VALUE_AUTO_GENERATED = 'auto-generated';
/**
* Indicates that a message was automatically generated as a direct response
* to another message.
*
* @var string
* @since 26.0.0
*/
public const VALUE_AUTO_REPLIED = 'auto-replied';
}
@@ -0,0 +1,55 @@
<?php
declare(strict_types=1);
/**
* @copyright Copyright (c) 2017 Joas Schilling <coding@schilljs.com>
*
* @author Joas Schilling <coding@schilljs.com>
* @author Roeland Jago Douma <roeland@famdouma.nl>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
namespace OCP\Mail;
/**
* Interface IAttachment
*
* @since 13.0.0
*/
interface IAttachment {
/**
* @param string $filename
* @return IAttachment
* @since 13.0.0
*/
public function setFilename(string $filename): IAttachment;
/**
* @param string $contentType
* @return IAttachment
* @since 13.0.0
*/
public function setContentType(string $contentType): IAttachment;
/**
* @param string $body
* @return IAttachment
* @since 13.0.0
*/
public function setBody(string $body): IAttachment;
}
@@ -0,0 +1,175 @@
<?php
declare(strict_types=1);
/**
* @copyright 2017, Morris Jobke <hey@morrisjobke.de>
*
* @author Brad Rubenstein <brad@wbr.tech>
* @author Joas Schilling <coding@schilljs.com>
* @author Lukas Reschke <lukas@statuscode.ch>
* @author Morris Jobke <hey@morrisjobke.de>
* @author Roeland Jago Douma <roeland@famdouma.nl>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
namespace OCP\Mail;
/**
* Interface IEMailTemplate
*
* Interface to a class that allows to build HTML emails
*
* Example:
*
* <?php
*
* $emailTemplate = new EMailTemplate($this->defaults, $this->urlGenerator, $this->l10n);
*
* $emailTemplate->addHeader();
* $emailTemplate->addHeading('Welcome aboard');
* $emailTemplate->addBodyText('Welcome to your Nextcloud account, you can add, protect, and share your data.');
*
* $emailTemplate->addBodyButtonGroup(
* 'Set your password', 'https://example.org/resetPassword/q1234567890qwertz',
* 'Install Client', 'https://nextcloud.com/install/#install-clients'
* );
*
* $emailTemplate->addFooter('Optional footer text');
*
* $htmlContent = $emailTemplate->renderHtml();
* $plainContent = $emailTemplate->renderText();
*
* @since 12.0.0
*/
interface IEMailTemplate {
/**
* Sets the subject of the email
*
* @param string $subject
*
* @since 13.0.0
*/
public function setSubject(string $subject);
/**
* Adds a header to the email
*
* @since 12.0.0
*/
public function addHeader();
/**
* Adds a heading to the email
*
* @param string $title
* @param string|bool $plainTitle Title that is used in the plain text email
* if empty the $title is used, if false none will be used
*
* @since 12.0.0
*/
public function addHeading(string $title, $plainTitle = '');
/**
* Adds a paragraph to the body of the email
*
* @param string $text; Note: When $plainText falls back to this, HTML is automatically escaped in the HTML email
* @param string|bool $plainText Text that is used in the plain text email
* if empty the $text is used, if false none will be used
*
* @since 12.0.0
*/
public function addBodyText(string $text, $plainText = '');
/**
* Adds a list item to the body of the email
*
* @param string $text; Note: When $plainText falls back to this, HTML is automatically escaped in the HTML email
* @param string $metaInfo; Note: When $plainMetaInfo falls back to this, HTML is automatically escaped in the HTML email
* @param string $icon Absolute path, must be 16*16 pixels
* @param string|bool $plainText Text that is used in the plain text email
* if empty the $text is used, if false none will be used
* @param string|bool $plainMetaInfo Meta info that is used in the plain text email
* if empty the $metaInfo is used, if false none will be used
* @param integer plainIndent If > 0, Indent plainText by this amount.
* @since 12.0.0
*/
public function addBodyListItem(string $text, string $metaInfo = '', string $icon = '', $plainText = '', $plainMetaInfo = '', $plainIndent = 0);
/**
* Adds a button group of two buttons to the body of the email
*
* @param string $textLeft Text of left button; Note: When $plainTextLeft falls back to this, HTML is automatically escaped in the HTML email
* @param string $urlLeft URL of left button
* @param string $textRight Text of right button; Note: When $plainTextRight falls back to this, HTML is automatically escaped in the HTML email
* @param string $urlRight URL of right button
* @param string $plainTextLeft Text of left button that is used in the plain text version - if empty the $textLeft is used
* @param string $plainTextRight Text of right button that is used in the plain text version - if empty the $textRight is used
*
* @since 12.0.0
*/
public function addBodyButtonGroup(string $textLeft, string $urlLeft, string $textRight, string $urlRight, string $plainTextLeft = '', string $plainTextRight = '');
/**
* Adds a button to the body of the email
*
* @param string $text Text of button; Note: When $plainText falls back to this, HTML is automatically escaped in the HTML email
* @param string $url URL of button
* @param string|false $plainText Text of button in plain text version
* if empty the $text is used, if false none will be used
*
* @since 12.0.0
*/
public function addBodyButton(string $text, string $url, $plainText = '');
/**
* Adds a logo and a text to the footer. <br> in the text will be replaced by new lines in the plain text email
*
* @param string $text If the text is empty the default "Name - Slogan<br>This is an automatically sent email" will be used
* @param string $lang Optional language to set the default footer in
*
* @since 12.0.0
*/
public function addFooter(string $text = '', ?string $lang = null);
/**
* Returns the rendered email subject as string
*
* @return string
*
* @since 13.0.0
*/
public function renderSubject(): string;
/**
* Returns the rendered HTML email as string
*
* @return string
*
* @since 12.0.0
*/
public function renderHtml(): string;
/**
* Returns the rendered plain text email as string
*
* @return string
*
* @since 12.0.0
*/
public function renderText(): string;
}
+104
View File
@@ -0,0 +1,104 @@
<?php
declare(strict_types=1);
/**
* @copyright Copyright (c) 2016, ownCloud, Inc.
*
* @author Joas Schilling <coding@schilljs.com>
* @author Lukas Reschke <lukas@statuscode.ch>
* @author Morris Jobke <hey@morrisjobke.de>
* @author Roeland Jago Douma <roeland@famdouma.nl>
*
* @license AGPL-3.0
*
* This code is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License, version 3,
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/
namespace OCP\Mail;
/**
* Class IMailer provides some basic functions to create a mail message that can be used in combination with
* \OC\Mail\Message.
*
* Example usage:
*
* $mailer = \OC::$server->getMailer();
* $message = $mailer->createMessage();
* $message->setSubject('Your Subject');
* $message->setFrom(['cloud@domain.org' => 'Nextcloud Notifier']);
* $message->setTo(['recipient@domain.org' => 'Recipient']);
* $message->setPlainBody('The message text');
* $message->setHtmlBody('The <strong>message</strong> text');
* $mailer->send($message);
*
* This message can then be passed to send() of \OC\Mail\Mailer
*
* @since 8.1.0
*/
interface IMailer {
/**
* Creates a new message object that can be passed to send()
*
* @return IMessage
* @since 8.1.0
*/
public function createMessage(): IMessage;
/**
* @param string|null $data
* @param string|null $filename
* @param string|null $contentType
* @return IAttachment
* @since 13.0.0
*/
public function createAttachment($data = null, $filename = null, $contentType = null): IAttachment;
/**
* @param string $path
* @param string|null $contentType
* @return IAttachment
* @since 13.0.0
*/
public function createAttachmentFromPath(string $path, $contentType = null): IAttachment;
/**
* Creates a new email template object
*
* @param string $emailId
* @param array $data
* @return IEMailTemplate
* @since 12.0.0 Parameters added in 12.0.3
*/
public function createEMailTemplate(string $emailId, array $data = []): IEMailTemplate;
/**
* Send the specified message. Also sets the from address to the value defined in config.php
* if no-one has been passed.
*
* @param IMessage $message Message to send
* @return string[] Array with failed recipients. Be aware that this depends on the used mail backend and
* therefore should be considered
* @throws \Exception In case it was not possible to send the message. (for example if an invalid mail address
* has been supplied.)
* @since 8.1.0
*/
public function send(IMessage $message): array;
/**
* @param string $email Email address to be validated
* @return bool True if the mail address is valid, false otherwise
* @since 8.1.0
*/
public function validateMailAddress(string $email): bool;
}
+147
View File
@@ -0,0 +1,147 @@
<?php
declare(strict_types=1);
/**
* @copyright Copyright (c) 2017 Joas Schilling <coding@schilljs.com>
*
* @author Joas Schilling <coding@schilljs.com>
* @author Roeland Jago Douma <roeland@famdouma.nl>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
namespace OCP\Mail;
/**
* Interface IMessage
*
* @since 13.0.0
*/
interface IMessage {
/**
* Set the subject of this message
*
* @param string $subject
*
* @return self
* @since 28.0.0
*/
public function setSubject(string $subject): IMessage;
/**
* Set the plain-text body of this message
*
* @param string $body
*
* @return self
* @since 28.0.0
*/
public function setPlainBody(string $body): IMessage;
/**
* Set the HTML body of this message. Consider also sending a plain-text body instead of only an HTML one.
*
* @param string $body
*
* @return self
* @since 28.0.0
*/
public function setHtmlBody(string $body): IMessage;
/**
* @param IAttachment $attachment
* @return IMessage
* @since 13.0.0
*/
public function attach(IAttachment $attachment): IMessage;
/**
* Can be used to "attach content inline" as message parts with specific MIME type and encoding.
*
* @param string $body body of the MIME part
* @param string $name the file name
* @param string|null $contentType MIME Content-Type (e.g. text/plain or text/calendar)
*
* @return IMessage
* @since 27.0.0
*/
public function attachInline(string $body, string $name, string $contentType = null): IMessage;
/**
* Set the from address of this message.
*
* If no "From" address is used \OC\Mail\Mailer will use mail_from_address and mail_domain from config.php
*
* @param array $addresses Example: array('sender@domain.org', 'other@domain.org' => 'A name')
* @return IMessage
* @since 13.0.0
*/
public function setFrom(array $addresses): IMessage;
/**
* Set the Reply-To address of this message
*
* @param array $addresses
* @return IMessage
* @since 13.0.0
*/
public function setReplyTo(array $addresses): IMessage;
/**
* Set the to addresses of this message.
*
* @param array $recipients Example: array('recipient@domain.org', 'other@domain.org' => 'A name')
* @return IMessage
* @since 13.0.0
*/
public function setTo(array $recipients): IMessage;
/**
* Set the CC recipients of this message.
*
* @param array $recipients Example: array('recipient@domain.org', 'other@domain.org' => 'A name')
* @return IMessage
* @since 13.0.0
*/
public function setCc(array $recipients): IMessage;
/**
* Set the BCC recipients of this message.
*
* @param array $recipients Example: array('recipient@domain.org', 'other@domain.org' => 'A name')
* @return IMessage
* @since 13.0.0
*/
public function setBcc(array $recipients): IMessage;
/**
* @param IEMailTemplate $emailTemplate
* @return IMessage
* @since 13.0.0
*/
public function useTemplate(IEMailTemplate $emailTemplate): IMessage;
/**
* Add the Auto-Submitted header to the email, preventing most automated
* responses to automated messages.
*
* @param Headers\AutoSubmitted::VALUE_* $value (one of AutoSubmitted::VALUE_NO, AutoSubmitted::VALUE_AUTO_GENERATED, AutoSubmitted::VALUE_AUTO_REPLIED)
* @return IMessage
* @since 26.0.0
*/
public function setAutoSubmitted(string $value): IMessage;
}