1
0
mirror of https://github.com/mailcow/mailcow-dockerized.git synced 2026-07-29 16:13:39 +00:00
Stephen Ritz c17cc8a792 [Web] fix add/time_limited_alias silently discarding requests and validity
Three defects in add/time_limited_alias:

The description was read as $_data['description'] without a guard. When a
client omits it, null is bound to spamalias.description, which is TEXT NOT
NULL, so the insert raises a PDOException. The global exception handler is
terminal, so process_add_return() never echoes anything and the caller sees
HTTP 200 with an empty body while no alias was created. Default it to an
empty string instead.

The validity guard used a single condition whose else branch also caught the
success case, so every valid validity was overwritten with the 8760 hour
default and the parameter did nothing. Only invalid values were rejected.
Nest the range check so a valid value survives.

The OpenAPI spec documented only username and domain, while the code also
reads description, validity and permanent. Spec driven clients therefore
could not construct a working request. Document all three.

spamalias.description is the only NOT NULL description column in the schema,
which is why the same unguarded read in add/domain and add/resource does not
fail, both of those columns are nullable.

This does not change the generic exception handling. A database error is
still swallowed into an empty HTTP 200, and the message the handler builds
carries the raw PDOException, so surfacing it to API clients would need
sanitising first. That is left for a separate change.

Refs #7287

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-14 15:23:31 -07:00
2026-03-09 15:27:33 +01:00
2017-03-02 11:23:23 +01:00
2017-06-30 07:03:10 +08:00
2025-12-08 15:08:25 +01:00
2026-03-09 15:27:33 +01:00
2017-05-18 09:48:22 +02:00
2025-09-01 12:32:27 +02:00
2022-07-11 21:06:23 +02:00

mailcow: dockerized - 🐮 + 🐋 = 💕

Translation status Twitter URL Mastodon Follow

Want to support mailcow?

Please consider a support contract with Servercow to support further development. We support you while you support us. :)

You can also get a SAL which is a one-time payment with no liabilities or returning fees.

Or just spread the word: moo.

Many thanks to our GitHub Sponsors ❤️

A big thank you to everyone supporting us on GitHub Sponsors—your contributions mean the world to us! Special thanks to the following amazing supporters:

100$/Month Sponsors

50$/Month Sponsors

Info, documentation and support

Please see the official documentation for installation and support instructions. 🐄

🐛 If you found a critical security issue, please mail us to info at servercow.de.

Cowmunity

mailcow community

Telegram mailcow channel

Telegram mailcow Off-Topic channel

Official 𝕏 (Twitter) Account

Official Mastodon Account

Telegram desktop clients are available for multiple platforms. You can search the groups history for keywords.

Misc

Important: mailcow makes use of various open-source software. Please assure you agree with their license before using mailcow. Any part of mailcow itself is released under GNU General Public License, Version 3.

mailcow is a registered word mark of The Infrastructure Company GmbH, Parkstr. 42, 47877 Willich, Germany.

The project is managed and maintained by The Infrastructure Company GmbH.

Originated from @andryyy (André)

S
Description
No description provided
Readme GPL-3.0 92 MiB
Languages
JavaScript 54.2%
PHP 16.1%
Perl 9.8%
Twig 8.5%
CSS 4.5%
Other 6.7%