Add `disable_mail_sending` config parameter

This disable the ability to send mail through the server. Users need to
use their own mail client.
This commit is contained in:
Luc Didry 2021-06-16 11:56:44 +02:00
parent 295e660461
commit 5845f31836
No known key found for this signature in database
GPG Key ID: EA868E12D0257E3C
5 changed files with 10 additions and 2 deletions

View File

@ -3,6 +3,7 @@ Revision history for Lufi
?.??.? ????-??-??
- 🔧 Set default morbo port to 3000 (as it should have stay)
- 🐛 Fix `Notification not defined` in Duckduckgo browser (Fix #224 again)
- ✨ Add `disable_mail_sending` config parameter
0.05.13 2021-01-28
- 🐛 Fix latest git tag improperly fetched

View File

@ -232,7 +232,7 @@ sub startup {
# Submit mail
$r->post('/m')
->to('Mail#send_mail');
->to('Mail#send_mail') unless $self->config('disable_mail_sending');
# Upload files websocket
$r->websocket('/upload')

View File

@ -17,6 +17,7 @@ our $default_config = {
how => 'sendmail'
},
mail_sender => 'no-reply@lufi.io',
disable_mail_sending => 0,
theme => 'default',
upload_dir => 'files',
session_duration => 3600,

View File

@ -166,6 +166,10 @@
# optional, default to no-reply@lufi.io
#mail_sender => 'no-reply@lufi.io',
# Disable sending mail through the server
# optional, default is false
#disable_mail_sending => 0,
#############
# DB settings
#############

View File

@ -43,7 +43,9 @@
% }
</textarea>
</div>
<button type="submit" class="btn btn-info"><%= l('Send with this server') %></button>
% if (!$self->config('disable_mail_sending')) {
<button type="submit" class="btn btn-info"><%= l('Send with this server') %></button>
% }
<a href="#" class="btn btn-primary" id="mailto"><%= l('Send with your own mail software') %></a>
</form>
<div>