Commit Graph

85 Commits

Author SHA1 Message Date
fiwswe 6c16a3a9aa Use str_starts_with/str_ends_with 2023-09-14 23:06:43 +02:00
Andreas Gohr d4f83172d9 code style: line breaks 2023-08-31 22:44:40 +02:00
Andreas Gohr 90fb952c4c code style: operator spacing 2023-08-31 22:38:07 +02:00
Andreas Gohr 7d34963b3e coding style: control flow line breaks 2023-08-31 15:04:10 +02:00
Andreas Gohr 177d6836e2 coding style: control flow whitespaces 2023-08-31 14:22:35 +02:00
Andreas Gohr dccd6b2bba coding style: function call spacing 2023-08-30 18:41:45 +02:00
Andreas Gohr d868eb89f1 codestyle adjustments: function declaration braces/spaces 2023-08-30 17:09:14 +02:00
Andreas Gohr 8c7c53b032 codestyle adjustments: class declaration braces 2023-08-30 17:05:28 +02:00
Andreas Gohr c1482d1c08 codestyle adjustments: function argument spacing 2023-08-30 17:03:06 +02:00
Andreas Gohr 24870174d2 Apply rector fixes to the rest of inc 2023-08-29 19:42:15 +02:00
Andreas Gohr 2b58f04945 fix trim call in Mailer's name cleaning
The wrong quotes were used, turning what was meant to be a tab char into
a literal t.

fixes #3923
2023-03-14 21:27:44 +01:00
Andreas Gohr 0981255e12
Merge pull request #3831 from dokuwiki/pr3774
Mail EOL handling
2023-03-14 20:02:17 +01:00
Andreas Gohr bfa6d256d4 Avoid empty To: header. fixes #1422
This sets the To: header to a display name without an address, which
seems to be better supported than an empty group as tried in #1428
2023-03-14 19:56:23 +01:00
Andreas Gohr 2b483eba90 move mail header constants to define file 2023-03-06 13:11:30 +01:00
Andreas Gohr 8fa268b3d5 fix isset checks in Mailer class
$INFO might be set, but may not contain any user info
2023-01-26 15:01:13 +01:00
fiwswe f41f896960
remove obsolete define of MAILHEADER_EOL
But make sure that inc/mail.php where this is defined was included.
2022-09-19 18:21:16 +02:00
Philipp Specht 7c7659d2eb Add Message-ID to all mails
RFC 5322 specifies that all mails SHOULD have a Message-ID field. While
originating SMTP servers MAY (as per RFC 5321) add a missing Message-ID,
this behavior is not mandatory.
Multiple mail providers, e.g. Gmail, reject mails without a Message-ID
field, rendering their users unable to receive mails from a Dokuwiki
instance using a standard-conforming mail server.

This commit simply adds a random Message-ID to a mail's headers during
Mailer class initialization. With the current behavior of setHeader(),
overwriting that header happens without additional changes, should
another Message-ID be necessary, warranted or desired.
2022-08-30 20:38:03 +02:00
Myron Turner 3f6872b1fc
Checks for PHP mail in install.php and warns if mail used after install (#3056)
* Checks for PHP mail in install.php and warns if mail used after install.

* fixed spacing in instal.php

* Reconfigured warning message and code for PHP mail not existing or disabled. Removed the substitute mail function in inc/compatibility.php

* fixed some spacing errors in install.php

* Adds warning to error_log when call is made to unavailable PHP mail function and posts the warning to browser top if current user is admin.

* adds newline at end of compatibility.php and $lang global to Mailer.class.php

* Changes to handling of msg and `return false` as suggested by @phy25

* Removed tab from lilne 719

* removed additional tabs from Mailer.class.php

* Update inc/Mailer.class.php

removes unnecessary object

* Update inc/Mailer.class.php

changed msg styling for msg_managers_only warning for no PHP mail function

* Update inc/Mailer.class.php

* Update inc/Mailer.class.php
2020-05-16 23:24:21 -04:00
Andreas Gohr 4772cf38fc suppress errors messages in Mailer for non-admins #3014
When ever a mail is sent to the current user, it is usually the only
receiver. If in that case the mail validation fails, sending the whole
mail will fail which will be signalled by a return false of the
Mailer->send() method anyway. This is already signalled to the user.

The more commoin usecase of a validation error is when other people's
addresses fail to validate. These should never be shown to a user.
2020-04-29 19:58:59 +02:00
Andreas Gohr 10da1f74c9 more tests and a fix for #3036
Exploding lines left dangling commas for the addresses. In addition the
$text variable was not reset properly later on leading to an additional
error.
2020-04-29 19:45:59 +02:00
Phy 68491db904
PHP8 fix part 5: Trying to access array offset on value of type bool/null 2019-12-01 14:40:13 -05:00
Phy aac83cd489
PHP8 fix part 4: Trying to access array offset on value of type bool/null 2019-12-01 14:25:32 -05:00
Phy 3e9ae63d53
PHP8 fix part 3: Trying to access array offset on value of type bool/null 2019-12-01 14:01:52 -05:00
Andreas Gohr b47790f975 Merge branch 'utf8refactor' into psr2
* utf8refactor:
  replaced deprecated utf8 functions
  formatting cleanup
  mark old utf8 functions deprecated
  Some cleanup for the UTF-8 stuff
  Moved all utf8 methods to their own namespaced classes
  Create separate table files for UTF-8 handling
2019-07-14 21:11:04 +02:00
Andreas Gohr 2b9c4a056d Merge branch 'master' into psr2
* master: (34 commits)
  fix color for noninstalled extensions
  show disabled extensions in gray
  warn about inaccessible repo api
  bugfix: access check was never cached
  First go on a CLI component for the extension manager
  use strict type comparison
  translation update
  translation update
  fix #dokuwiki__sitetools current item not in highlight due to Greebo change
  authplain: Add tests for group retrieval
  authplain: Add a simple method for retrieving user groups
  translation update
  Negative string offsets are allowed in PHP 7.1+ only
  improve memory check output
  fix and test php_to_byte() related to #2756 #2556
  translation update
  translation update
  translation update
  translation update
  translation update
  ...
2019-07-14 20:50:16 +02:00
Andreas Gohr 8cbc5ee84f replaced deprecated utf8 functions
For now this uses full qualified namespaces, sensible imports may come
later.
2019-06-10 16:12:59 +02:00
Andreas Gohr e1d9dcc8b4 First go at moving the plugin classes into their own namespace 2019-04-20 21:33:23 +02:00
Andreas Gohr 749c002394 some PSR-2 fixes for the Mailer class
The defines might need to be moved elsewhere
2019-04-20 19:45:29 +02:00
LarsGit223 743792d023 Another scrutinizer fix. 2018-09-15 14:52:01 +02:00
LarsGit223 d31a1599b2 Added type check to fix scrutinizer message. 2018-09-15 14:35:58 +02:00
LarsGit223 102cdbd765 Auth/Mailer: properly handle usernames including a comma
Prevent splitting of e-mail addresses at the wrong point by enclosing a username in '"'.
The "To" e-mail address in the notification mail was malformed if a new user was added
and included a ',' in it's name. Fixes #1569.
2018-09-15 14:04:38 +02:00
Andreas Gohr 64159a61e9 line lengths shortened
This makes sure all files use line lenghts shorter than 120 characters.

This is a quick fix. It might not always be the nicest change.
2018-04-27 19:07:43 +02:00
Lukas Rademacher 5f43dcf497 Support for configurable e-mail return path 2017-10-28 22:24:54 +02:00
Andreas Gohr 1ec0f70815 Merge branch 'master-fix-windows' of git://github.com/yurii-github/wiki into pull-request-2053
* 'master-fix-windows' of git://github.com/yurii-github/wiki:
  response on review
  response on review
  cleaning after better understanding of the surroundings
  back slashes in @import
  cleaning
  fix tests on windows
2017-08-27 10:51:11 +02:00
Phy 65cc1598e0 Replace htmlspecialchars to hsc in core 2017-08-01 18:03:01 +08:00
Szymon Olewniczak 9796f26f1c doc abbreviation 2017-07-28 09:30:50 +02:00
Yurii K 30085ef376 fix tests on windows 2017-07-23 16:13:12 +03:00
Szymon Olewniczak 9ab4b0a5f1 doc fix 2017-07-20 12:32:07 +02:00
Andreas Gohr 64d23c161e make Mailer use mail_isvalid()
the new version of the validator is static. But it makes sense to use a
single point of entry anyway, so instead of adjusting the use of the new
class, prefer the function.
2017-05-26 21:57:00 +02:00
Gerrit Uitslag a566f85e9b reformatting 2016-05-28 00:59:57 +02:00
Gerrit Uitslag 774514c9e8 translate html and text string for signature
Default only text string exists, via localized translation a wiki admin
can add his/her own (html) version.
2016-05-28 00:39:11 +02:00
Andreas Gohr a94a808ccf use LF instead of CRLF as discussed in #1101
Until we did some more research on compatibility we should stick with
what works, even when the RFC says otherwise.

Should we decide to change line endings to RFC conform CRLF, it should
be done on the whole body, not the signature only.
2016-04-15 10:10:00 +02:00
Christopher Smith 04dcb5b22f correct typo 2015-04-01 19:21:37 +01:00
Christopher Smith 9ea4583661 Fix up test_simplemail()
- refactor Mailer class to allow unit tests to access token
  replacements
- use CRLF in signature string per rfc2045 6.8
- add email signature to the expected mail body
- apply appropriate chunksplit to the expected mail body
- ensure regex is quoted - '/' is a legal base64 character
2015-04-01 19:19:00 +01:00
furun 3819cafdf9 Cleanup of the mail text signature. #1088
mailwrap.html is back

@EMAILSIGNATURE@ added
2015-03-29 14:16:49 +02:00
furun ba2c2f1750 Cleanup of the mail text signature.
Done:
Cleanup of the mail text signature.
The signature is deleted from the txt files and moved in to lang.php
Mailer.class.php updated to insert the signature

Fix:
- Cleaner text
- no more "-- "  "--" "---" "----" problems.
- mailwrap.html is not needed anymore an can be deleted (?)

Changed files in all languages:
lang.php
mailtext.txt
password.txt
registermail.txt
subscr_digest.txt
subscr_list.txt
subscr_single.txt
uploadmail.txt
pwconfirm.txt
showrev.txt

delete?:
mailwrap.html
2015-03-27 17:15:56 +01:00
Gerrit Uitslag 42ea7f447f Many PHPDocs, some unused and dyn declared vars
many PHPDocs
some unused variables
some dynamically declared variables declared
2014-10-01 11:30:27 +02:00
Gerrit Uitslag 59bc3b48fd more scrutinizer issue improvements 2014-09-29 21:45:27 +02:00
Christopher Smith 585bf44e2b amend $_SERVER to $INPUT->server 2014-03-06 19:55:56 +00:00
Gerrit Uitslag 8c253612ce improve PHPDocs of Mailer 2014-02-15 22:09:24 +01:00