Skip to content

Commit 5cc181a

Browse files
author
Marius Cramer
committed
Merge branch 'master' into 'master'
Master See merge request !230
2 parents b3ada52 + 7c980c3 commit 5cc181a

File tree

3 files changed

+31
-14
lines changed

3 files changed

+31
-14
lines changed

install/dist/tpl/gentoo/amavisd-ispconfig.conf.master

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,16 +94,24 @@ $LOGFILE = "/var/log/amavis.log"; # (defaults to empty, no log)
9494
$log_level = 0; # (defaults to 0)
9595

9696
$inet_socket_port = [10024,10026];
97-
$forward_method = 'smtp:[127.0.0.1]:10025';
98-
$notify_method = 'smtp:[127.0.0.1]:10027';
97+
98+
# *:* = send to IP/HOST:incoming Port + 1
99+
$forward_method = 'smtp:*:*';
100+
$notify_method = 'smtp:*:*';
101+
99102
$interface_policy{'10026'} = 'ORIGINATING';
100103
$policy_bank{'ORIGINATING'} = {
101104
originating => 1,
102105
smtpd_discard_ehlo_keywords => ['8BITMIME'],
103-
forward_method => 'smtp:[127.0.0.1]:10027',
104106
};
105-
@mynetworks = qw(0.0.0.0/8 127.0.0.0/8 10.0.0.0/8 172.16.0.0/12
106-
192.168.0.0/16);
107+
108+
# IP-Addresses for internal networks => load policy MYNETS
109+
# - requires -o smtp_send_xforward_command=yes in postfix master.cf
110+
@mynetworks = qw(0.0.0.0/8 127.0.0.0/8 10.0.0.0/8 172.16.0.0/12 192.168.0.0/16 [::1] [FE80::]/10 [FEC0::]/10);
111+
112+
# Allow SMTP access from IPs in @inet_acl to amvisd SMTP Port
113+
@inet_acl = qw( 127.0.0.1 [::1] 192.168.0.0/16 );
114+
107115
$signed_header_fields{'received'} = 0; # turn off signing of Received
108116
$enable_dkim_verification = 1;
109117
$enable_dkim_signing = 1;

install/tpl/amavisd_user_config.master

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,19 +76,24 @@ $LOGFILE = "/var/log/amavis.log"; # (defaults to empty, no log)
7676
$log_level = 0; # (defaults to 0)
7777

7878
$inet_socket_port = [10024,10026];
79-
$forward_method = 'smtp:[127.0.0.1]:10025';
80-
$notify_method = 'smtp:[127.0.0.1]:10027';
79+
80+
# *:* = send to IP/HOST:incoming Port + 1
81+
$forward_method = 'smtp:*:*';
82+
$notify_method = 'smtp:*:*';
8183
$interface_policy{'10026'} = 'ORIGINATING';
8284
$policy_bank{'ORIGINATING'} = {
8385
originating => 1,
8486
smtpd_discard_ehlo_keywords => ['8BITMIME'],
85-
forward_method => 'smtp:[127.0.0.1]:10027',
8687
};
87-
@mynetworks = qw(0.0.0.0/8 127.0.0.0/8 10.0.0.0/8 172.16.0.0/12
88-
192.168.0.0/16);
8988

90-
# DKIM
89+
# IP-Addresses for internal networks => load policy MYNETS
90+
# - requires -o smtp_send_xforward_command=yes in postfix master.cf
91+
@mynetworks = qw(0.0.0.0/8 127.0.0.0/8 10.0.0.0/8 172.16.0.0/12 192.168.0.0/16 [::1] [FE80::]/10 [FEC0::]/10);
9192

93+
# Allow SMTP access from IPs in @inet_acl to amvisd SMTP Port
94+
@inet_acl = qw( 127.0.0.1 [::1] 192.168.0.0/16 );
95+
96+
# DKIM
9297
$enable_dkim_verification = 1;
9398
$enable_dkim_signing = 1; # load DKIM signing code
9499
$signed_header_fields{'received'} = 0; # turn off signing of Received

server/plugins-available/mail_plugin_dkim.inc.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,8 @@ function check_system($data) {
122122
$mail_config = $app->getconf->get_server_config($conf['server_id'], 'mail');
123123
if ( isset($mail_config['dkim_path']) &&
124124
!empty($mail_config['dkim_path']) &&
125-
isset($data['new']['dkim_private']) &&
126-
!empty($data['new']['dkim_private']) &&
125+
// isset($data['new']['dkim_private']) &&
126+
// !empty($data['new']['dkim_private']) &&
127127
$mail_config['dkim_path'] != '/'
128128
) {
129129
if (!is_dir($mail_config['dkim_path'])) {
@@ -199,6 +199,10 @@ function restart_amavis() {
199199
function write_dkim_key($key_file, $key_value, $key_domain) {
200200
global $app, $mailconfig;
201201
$success=false;
202+
if ($key_file == '' || $key_value == '' || $key_domain == '') {
203+
$app->log('DKIM internal error for domain '.$key_domain, LOGLEVEL_ERROR);
204+
return $success;
205+
}
202206
if ( $app->system->file_put_contents($key_file.'.private', $key_value) ) {
203207
$app->log('Saved DKIM Private-key to '.$key_file.'.private', LOGLEVEL_DEBUG);
204208
$success=true;
@@ -211,7 +215,7 @@ function write_dkim_key($key_file, $key_value, $key_domain) {
211215
$app->log('Saved DKIM Public to '.$key_domain.'.', LOGLEVEL_DEBUG);
212216
else $app->log('Unable to save DKIM Public to '.$key_domain.'.', LOGLEVEL_DEBUG);
213217
} else {
214-
$app->log('Unable to save DKIM Privte-key to '.$key_file.'.private', LOGLEVEL_ERROR);
218+
$app->log('Unable to save DKIM Private-key to '.$key_file.'.private', LOGLEVEL_ERROR);
215219
}
216220
return $success;
217221
}

0 commit comments

Comments
 (0)