Commit Graph

43 Commits (6312c0df6949955d1cd59c3dd444268e0773293c)

Author SHA1 Message Date
Carl Schwan 6312c0df69
Check style update
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2 years ago
Christoph Wurst 745543d8c0
Merge pull request #27306 from nextcloud/enh/noid/set-local-domain-for-swiftmailer
Set local domain for swiftmailer
3 years ago
John Molakvoæ (skjnldsv) 215aef3cbd
Update php licenses
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
3 years ago
Daniel Kesselberg 747325fc43
Set local domain for swiftmailer transport
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
3 years ago
dependabot-preview[bot] eb502c02ff
Bump nextcloud/coding-standard from 0.3.0 to 0.5.0
Bumps [nextcloud/coding-standard](https://github.com/nextcloud/coding-standard) from 0.3.0 to 0.5.0.
- [Release notes](https://github.com/nextcloud/coding-standard/releases)
- [Changelog](https://github.com/nextcloud/coding-standard/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nextcloud/coding-standard/compare/v0.3.0...v0.5.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
3 years ago
Christoph Wurst 883848b58a
Micro-optimize validation of empty email addresses
Then we don't have to construct any validators.

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
3 years ago
Christoph Wurst d89a75be0b
Update all license headers for Nextcloud 21
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
4 years ago
kevin147147 120c0feb57
Fix example usage 4 years ago
Christoph Wurst cb057829f7
Update license headers for 19
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
4 years ago
Tekhnee 7ee67339e0
Adhere to EMailTemplate interface in constructor call.
Email creation appears to have been refactored lately but it looks like custom template-based emails were left out.

Signed-off-by: Tekhnee <info@tekhnee.org>
4 years ago
Roeland Jago Douma bb4dedb015
Provide the proper language to the mailer
Else we can't properly translate the footer in the recipients e-mail
language.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
4 years ago
Christoph Wurst caff1023ea
Format control structures, classes, methods and function
To continue this formatting madness, here's a tiny patch that adds
unified formatting for control structures like if and loops as well as
classes, their methods and anonymous functions. This basically forces
the constructs to start on the same line. This is not exactly what PSR2
wants, but I think we can have a few exceptions with "our" style. The
starting of braces on the same line is pracrically standard for our
code.

This also removes and empty lines from method/function bodies at the
beginning and end.

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
4 years ago
Christoph Wurst f4c09f299d
Make sure there is exactly one newline after imports
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
4 years ago
Christoph Wurst 1a9330cd69
Update the license headers for Nextcloud 19
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
4 years ago
Arne Hamann a16aa99586
Added Hook before Message is send
Signed-off-by: Arne Hamann <kontakt+github@arne.email>
4 years ago
Julius Härtl 76a706738b
Do not use the instance name as user part of from mail addresses
This will cause issues since the theming name can contain characters
that are not allowed in the local part of the mail address (like spaces)

Signed-off-by: Julius Härtl <jus@bitgrid.net>
4 years ago
Christoph Wurst 5bf3d1bb38
Update license headers
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
5 years ago
Roeland Jago Douma 68748d4f85
Some php-cs fixes
* Order the imports
* No leading slash on imports
* Empty line before namespace
* One line per import
* Empty after imports
* Emmpty line at bottom of file

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
5 years ago
Branko Kokanovic 7cef9b0248 Addressing comments, array() to []
Signed-off-by: Branko Kokanovic <branko@kokanovic.org>
6 years ago
Branko Kokanovic 8101059062 Addressing comments, count to empty
Signed-off-by: Branko Kokanovic <branko@kokanovic.org>
6 years ago
Branko Kokanovic 72d97b44a7 Expose Swift Mailer streaming options in config, fixes #12702
Signed-off-by: Branko Kokanovic <branko@kokanovic.org>
6 years ago
Carsten Wiedmann 446d96f3eb
Apply patch from @cwiedmann but drop -oi option for pipe
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
6 years ago
Roeland Jago Douma 054056a8df
Fallback to default path is sendmail can't be found
If the sendmail binary can't be found at all we fallback to the default
path.
It most likely is not there but then at least a proper error message
pops up.

Updated the tests to also properly pass.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
6 years ago
Florian Klink 7078a0e53e
Mailer: discover sendmail path instead of hardcoding it to /usr/sbin/sendmail
`sendmail` can very well be in a path different from
`/usr/sbin/sendmail`.

We already search `$PATH` at `lib/private/Settings/Admin/Mail.php` to
detect whether we want to offer sendmail as a mail transfer method, so
let's be consistent and actually initialize `\Swift_SendmailTransport`
with this path to sendmail, instead of just hardcoding
`/usr/sbin/sendmail`.

Signed-off-by: Florian Klink <flokli@flokli.de>
6 years ago
Roeland Jago Douma be7db1573d
Swift to \Swift_Mailer as abstraction
* \Swift_Mailer handles starting the transport etc properly
* Fixed tests

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
6 years ago
Roeland Jago Douma e6e6b5648a
Make swift 6 compatible
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
6 years ago
Morris Jobke 9ee1febf62
Provide an option to disable HTML emails
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
6 years ago
Jared Boone a5b50e487e Do not convert email addresses with idn_to_ascii if INTL_IDNA_VARIANT_UTS46 is undefined.
Fixes https://github.com/nextcloud/server/issues/8387.

Signed-off-by: Jared Boone <jared.boone@gmail.com>
6 years ago
Roeland Jago Douma 0cef938299
Make \OCP\Mail strict
* Fix typehints
* Made strict

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
6 years ago
Morris Jobke 0eebff152a
Update license headers
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
7 years ago
Joas Schilling 6a035bd0a0
Move attachment creators to mailer class
Signed-off-by: Joas Schilling <coding@schilljs.com>
7 years ago
Joas Schilling c9af36a9ab
Introduce a public interface for Message
Signed-off-by: Joas Schilling <coding@schilljs.com>
7 years ago
Joas Schilling 6dbb64c4a2
Merge setMetaData into constructor
This ensures that the meta data is set in the beginning

Signed-off-by: Joas Schilling <coding@schilljs.com>
7 years ago
Lukas Reschke 70d42afb93
Use non-deprecated INTL_IDNA_VARIANT_UTS46
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
7 years ago
Roeland Jago Douma 5f227bd93b
More phpstorm inspection fixes
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
7 years ago
Joas Schilling 3af8abb098
Allow to overwrite the email template again
Signed-off-by: Joas Schilling <coding@schilljs.com>
7 years ago
Lukas Reschke bae64e810e
Add instance name to default sender
Otherwise your mail program shows "foo@mail.com" instead of "Nextcloud" or whatever your instance name is.

Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
7 years ago
Lukas Reschke 3600dd4f52
Add IEMailTemplate to public OCP API
Also adds `\OCP\Mail\IMailer::createEMailTemplate` as helper so the functionality can easily be used within apps.

Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
7 years ago
Morris Jobke 5b4adf66e5
Move OC_Defaults to OCP\Defaults
* currently there are two ways to access default values:
  OCP\Defaults or OC_Defaults (which is extended by
  OCA\Theming\ThemingDefaults)
* our code used a mixture of both of them, which made
  it hard to work on theme values
* this extended the public interface with the missing
  methods and uses them everywhere to only rely on the
  public interface

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
7 years ago
Morris Jobke 12e3b357d4
Fix default of mail_smtpmode - fixes #3102
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
7 years ago
Joas Schilling ba87db3fcc
Fix others 8 years ago
Lukas Reschke aba539703c
Update license headers 8 years ago
Roeland Jago Douma bc4185a6fe
Move \OC\Mail to PSR-4 8 years ago