diff --git a/dovecot_ident.php b/dovecot_ident.php index 50415fa..bab4e89 100644 --- a/dovecot_ident.php +++ b/dovecot_ident.php @@ -17,8 +17,11 @@ function init() function add_ident($args) { - $args['preauth_ident'] = $args['preauth_ident'] ? array_merge($args['preauth_ident'], array('x-originating-ip' => $_SERVER['REMOTE_ADDR'])) - : array('x-originating-ip' => $_SERVER['REMOTE_ADDR']); + if (isset($args['preauth_ident'])) { + $args['preauth_ident'] = array_merge($args['preauth_ident'], array('x-originating-ip' => $_SERVER['REMOTE_ADDR'])); + } else { + $args['preauth_ident'] = array('x-originating-ip' => $_SERVER['REMOTE_ADDR']); + } return $args; } }