15 Commits

Author SHA1 Message Date
Vincent Li
aba6bc1e84 mail.cgi: Fixes bug 13891
commit 89585e76a2cade43c5fa397f4e2b86f605439659
Author: Michael Tremer <michael.tremer@ipfire.org>
Date:   Thu Sep 25 17:19:59 2025 +0200

    mail.cgi: Escape username/password in the right place

    Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>

commit 43b4ba3768db5e46b95c263accb5b26e90df8a08
Author: Adolf Belka <adolf.belka@ipfire.org>
Date:   Thu Sep 25 13:12:49 2025 +0200

    mail.cgi: Fixes bug 13891

    Fixes: bug 13891 - mail.cgi txt_mailuser txt_mailpass Stored Cross-Site Scripting
    Signed-off-by: Adolf Belka <adolf.belka@ipfire.org>
    Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-10-03 22:18:56 +00:00
Adolf Belka
670981e648 mail.cgi: Fixes bug#13040 - Change multipart/mixed to multipart/alternative
- Thunderbird and Roundcube mail clients presume that any mail with Content Type of
   multipart/mixed has an attachment included rather than actually checking for
   disposition attachment. This means that any mail with multipart/mixed gets the
   attachment icon marked up even though there is no attachment.
- Although this is a problem of the clients involved, in this case the simplest solution
   is to change multipart/mixed to multipart/alternative as the Mail Service test mail only
   sends text without any attachment or other part.
- Confirmed on my vm testbed

Fixes: Bug#13040
Tested-by: Adolf Belka <adolf.belka@ipfire.org>
Signed-off-by: Adolf Belka <adolf.belka@ipfire.org>
Reviewed-by: Bernhard Bitsch <bbitsch@ipfire.org>
2023-03-04 14:05:42 +00:00
Michael Tremer
7cb63527d9 mail.cgi: Validate email recipient
The email recipient was not correctly validated which allowed for some
stored cross-site scripting vulnerability.

Fixes: #12925 - JVN#15411362 Inquiry on vulnerability found in IPFire
Reported-by: Noriko Totsuka <vuls@jpcert.or.jp>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2022-09-11 08:11:56 +00:00
Peter Müller
c04309ef01 Do not mark CGI files as executable
Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
2022-04-23 19:35:37 +00:00
Peter Müller
66c3619872 Early spring clean: Remove trailing whitespaces, and correct licence headers
Bumping across one of our scripts with very long trailing whitespaces, I
thought it might be a good idea to clean these up. Doing so, some
missing or inconsistent licence headers were fixed.

There is no need in shipping all these files en bloc, as their
functionality won't change.

Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
2022-02-18 23:54:57 +00:00
Jonatan Schlag
8186b37230 Hardcode theme to ipfire
This disables the theme support and makes it impossible to use any other
themes than the ipfire default theme.

The only intention of this patch is to hardcode the theme to ipfire.
To change any cgi we have is an ugly way, but the only way to do this
fast. The colour handling needs certainly to be improved as well, but
this will and should be done in other patches.

Signed-off-by: Jonatan Schlag <jonatan.schlag@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2021-04-08 10:11:34 +00:00
Peter Müller
d07286de46 mail.cgi: add support for implicit TLS usage
The second version of this patchset fixes reading empty configuration
files and superseds the first version (duh!).

Fixes #12161

Reported-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
Tested-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2020-03-30 16:45:11 +00:00
Michael Tremer
095bf49407 mail.cgi: Do not print content of input fields
This was printed unescaped and could therefore be used
for a stored XSS attack.

Fixes: #12226
Reported-by: Pisher Honda <pisher24@gmail.com>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2019-11-13 18:41:02 +00:00
Michael Tremer
0a340fbe1e mail.cgi: Always check content of fields
These checks did not do anything but clear all fields
when mailing was disabled.

It makes a lot more sense to retain people's settings,
even when they have been disabled.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2019-11-13 18:41:01 +00:00
Alexander Marx
70defeb036 BUG10964: When entering wrong data in dma setup, the fields are blanked
When entring wrong values in the fields and saving the site, there comes
an errormessage and all fields except mailserver and port are blanked.
Now the fileds are preserved and all data is displayed even after an
errormessage

Signed-off-by: Alexander Marx <alexander.marx@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2015-11-10 18:38:56 +00:00
Alexander Marx
4bfec109e7 BUG10965: only write auth.conf if username/password are set
auth.conf was always written, even if no username/password provided.
In this case only the ip or Hostname of the mailserver was written into
auth.conf. Now the file is only filled if username/password are filled.

Signed-off-by: Alexander Marx <alexander.marx@ipfire.org>
Tested-by: Timo Eissler <timo.eissler@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2015-11-05 15:34:28 +00:00
Matthias Fischer
93a08fe261 dma: Update to 0.10
Sorry, I borked the PATCH from yesterday...second try:

dma: Update to 0.10
Changes: dns.c, do not treat unreachable DNS server as permanent error
See: 1a1306df01 (diff-8e1267319329e5ee7e6a92fb2aa01c6b)

Deleted unnecessary blank lines in 'mail.cgi'

Signed-off-by: Matthias Fischer <matthias.fischer@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2015-11-04 21:10:04 +00:00
Alexander Marx
afd6e1931d dma: change field order of mail.cgi and fix required fields
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2015-08-26 16:22:35 +01:00
Alexander Marx
2799b3d9e9 dma: fix typo in mail.cgi
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2015-08-26 12:36:47 +01:00
Alexander Marx
9c7b90207e Add web UI for the system MTA
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2015-08-21 09:46:26 +01:00