Skip to content

Commit 1718ccd

Browse files
Alexandros IoannidesScIT-Raphael
andauthored
Enhance mail configuration (hestiacp#815)
* Enable Roundcube plugins and few tweaks * ZipDownload Roundcube Plugin * Newmail Notifier Roundcube Plugin * Enable Roundcube plugins * HELO support for multiple domains and IPs * Generating list of mail domains for HELO * Update CHANGELOG.md * Add cosmetic new line to eof. Co-authored-by: Raphael Schneeberger <rs@scit.ch>
1 parent 03ff18a commit 1718ccd

File tree

11 files changed

+79
-8
lines changed

11 files changed

+79
-8
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ All notable changes to this project will be documented in this file.
77
- Added support for Ubuntu Server 20.04 LTS.
88
- Added the ability to set the php cli version per user (using alias).
99
- Added support for resolving ip addresses based on geoip database for Awstats
10+
- Added Roundcube plugins newmail_notifier and zipdownload.
11+
- Added HELO support for multiple domains and IPs.
1012

1113
### Bugfixes
1214
- Do not allow to show apache2 server-status page from public.

bin/v-add-mail-domain

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@ else
6565
get_user_ip
6666
fi
6767

68+
# Generating list of mail domains for HELO
69+
ls /etc/exim4/domains > /etc/exim4/mailhelo.conf
70+
sed -i "s \(.*\) \1:\1 " /etc/exim4/mailhelo.conf
71+
6872
# Generating timestamp
6973
new_timestamp
7074

bin/v-delete-mail-domain

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,10 @@ rm -f $USER_DATA/mail/$domain.pem
8585
rm -f $USER_DATA/mail/$domain.pub
8686
rm -f $USER_DATA/mail/*@$domain.msg
8787

88+
# Generating list of mail domains for HELO
89+
ls /etc/exim4/domains > /etc/exim4/mailhelo.conf
90+
sed -i "s \(.*\) \1:\1 " /etc/exim4/mailhelo.conf
91+
8892
# Decreasing domain value
8993
decrease_user_value "$user" '$U_MAIL_DOMAINS'
9094
if [ "$DKIM" = 'yes' ]; then

func/rebuild.sh

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -497,11 +497,15 @@ rebuild_mail_domain_conf() {
497497
touch $HOMEDIR/$user/conf/mail/$domain/passwd
498498
touch $HOMEDIR/$user/conf/mail/$domain/fwd_only
499499

500-
# Seeting outgoing ip address
500+
# Setting outgoing ip address
501501
if [ ! -z "$local_ip" ]; then
502502
echo "$local_ip" > $HOMEDIR/$user/conf/mail/$domain/ip
503503
fi
504504

505+
# Generating list of mail domains for HELO
506+
ls /etc/exim4/domains > /etc/exim4/mailhelo.conf
507+
sed -i "s \(.*\) \1:\1 " /etc/exim4/mailhelo.conf
508+
505509
# Adding antispam protection
506510
if [ "$ANTISPAM" = 'yes' ]; then
507511
touch $HOMEDIR/$user/conf/mail/$domain/antispam
@@ -524,7 +528,7 @@ rebuild_mail_domain_conf() {
524528
rm -f /etc/dovecot/conf.d/domains/$domain_idn.conf
525529
fi
526530

527-
# Adding mail directiry
531+
# Adding mail directory
528532
if [ ! -e $HOMEDIR/$user/mail/$domain_idn ]; then
529533
mkdir "$HOMEDIR/$user/mail/$domain_idn"
530534
fi
@@ -590,8 +594,8 @@ rebuild_mail_domain_conf() {
590594
sslcheck=$(grep "DOMAIN='$domain'" $USER_DATA/mail.conf | grep SSL)
591595
if [ -z "$sslcheck" ]; then
592596
sed -i "s|$domain'|$domain' SSL='no' LETSENCRYPT='no'|g" $USER_DATA/mail.conf
593-
fi
594-
597+
fi
598+
595599
# Remove and recreate SSL configuration
596600
if [ -f "$HOMEDIR/$user/conf/mail/$domain/ssl/$domain.crt" ]; then
597601
del_mail_ssl_config

install/deb/exim/exim4.conf.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ begin transports
325325

326326
remote_smtp:
327327
driver = smtp
328-
helo_data = ${primary_hostname}
328+
helo_data = ${if exists {/etc/exim4/mailhelo.conf}{${lookup{$sender_address_domain}lsearch*{/etc/exim4/mailhelo.conf}{$value}{$primary_hostname}}}{$primary_hostname}}
329329
dkim_domain = DKIM_DOMAIN
330330
dkim_selector = mail
331331
dkim_private_key = DKIM_PRIVATE_KEY

install/deb/roundcube/main.inc.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@
377377
// ----------------------------------
378378

379379
// List of active plugins (in plugins/ directory)
380-
$rcmail_config['plugins'] = array('password');
380+
$rcmail_config['plugins'] = array('password','newmail_notifier','zipdownload');
381381

382382
// ----------------------------------
383383
// USER INTERFACE
@@ -715,11 +715,11 @@
715715
// 0 - Never, always ask
716716
// 1 - Ask if sender is not in address book
717717
// 2 - Always show inline images
718-
$rcmail_config['show_images'] = 0;
718+
$rcmail_config['show_images'] = 1;
719719

720720
// compose html formatted messages by default
721721
// 0 - never, 1 - always, 2 - on reply to HTML message only
722-
$rcmail_config['htmleditor'] = 0;
722+
$rcmail_config['htmleditor'] = 1;
723723

724724
// show pretty dates as standard
725725
$rcmail_config['prettydate'] = true;
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?php
2+
3+
// Enables basic notification
4+
$config['newmail_notifier_basic'] = true;
5+
6+
// Enables sound notification
7+
$config['newmail_notifier_sound'] = false;
8+
9+
// Enables desktop notification
10+
$config['newmail_notifier_desktop'] = false;
11+
12+
// Desktop notification close timeout in seconds
13+
$config['newmail_notifier_desktop_timeout'] = 5;
14+
15+
?>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
3+
/**
4+
* ZipDownload configuration file
5+
*/
6+
7+
// Zip attachments
8+
// Only show the link when there are more than this many attachments
9+
// -1 to prevent downloading of attachments as zip
10+
$config['zipdownload_attachments'] = 1;
11+
12+
// Zip selection of mail messages
13+
// This option enables downloading of multiple messages as one zip archive.
14+
// The number or string value specifies maximum total size of all messages
15+
// in the archive (not the size of the archive itself).
16+
$config['zipdownload_selection'] = '100MB';
17+
18+
// Charset to use for filenames inside the zip
19+
$config['zipdownload_charset'] = 'ISO-8859-1';
20+
21+
?>

install/hst-install-debian.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1604,6 +1604,10 @@ if [ "$dovecot" = 'yes' ] && [ "$exim" = 'yes' ] && [ "$mysql" = 'yes' ]; then
16041604
fi
16051605
fi
16061606

1607+
# Enable Roundcube plugins
1608+
cp -f $HESTIA_INSTALL_DIR/roundcube/plugins/config_newmail_notifier.inc.php /etc/roundcube/plugins/newmail_notifier/config.inc.php
1609+
cp -f $HESTIA_INSTALL_DIR/roundcube/plugins/config_zipdownload.inc.php /etc/roundcube/plugins/zipdownload/config.inc.php
1610+
16071611
# Fixes for PHP 7.4 compatibility
16081612
sed -i 's/\"\\n\", $identities/$identities, \"\\n\"/g' /usr/share/roundcube/plugins/enigma/lib/enigma_ui.php
16091613
sed -i 's/(array_keys($post_search), \x27|\x27)/(\x27|\x27, array_keys($post_search))/g' /usr/share/roundcube/program/lib/Roundcube/rcube_contacts.php

install/hst-install-ubuntu.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1549,6 +1549,10 @@ if [ "$dovecot" = 'yes' ] && [ "$exim" = 'yes' ] && [ "$mysql" = 'yes' ]; then
15491549
sed -i "s/localhost/$servername/g" /etc/roundcube/plugins/password/config.inc.php
15501550
mysql roundcube < /usr/share/dbconfig-common/data/roundcube/install/mysql
15511551

1552+
# Enable Roundcube plugins
1553+
cp -f $HESTIA_INSTALL_DIR/roundcube/plugins/config_newmail_notifier.inc.php /etc/roundcube/plugins/newmail_notifier/config.inc.php
1554+
cp -f $HESTIA_INSTALL_DIR/roundcube/plugins/config_zipdownload.inc.php /etc/roundcube/plugins/zipdownload/config.inc.php
1555+
15521556
# Fixes for PHP 7.4 compatibility
15531557
sed -i 's/\"\\n\", $identities/$identities, \"\\n\"/g' /usr/share/roundcube/plugins/enigma/lib/enigma_ui.php
15541558
sed -i 's/(array_keys($post_search), \x27|\x27)/(\x27|\x27, array_keys($post_search))/g' /usr/share/roundcube/program/lib/Roundcube/rcube_contacts.php

0 commit comments

Comments
 (0)