1

Topic: Problem with iredmail 0.9.3 SMTP: [451] 4.3.5 Server configuration er

==== Required information ====
- iRedMail version (check /etc/iredmail-release): 0.9.3
- Linux/BSD distribution name and version: debian 8
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): LDAP + SAMBA4 4.3.0
- Web server (Apache or Nginx):Nginx
- Manage mail accounts with iRedAdmin-Pro?
- Related log if you're reporting an issue:
====
Hello, i have a problem with iredmail 0.9.3
when a wrote a message and click on the icon of send mail i get this in dialogo box

Error SMTP: [451] 4.3.5 Server configuration error

i try to send a mail to another user mail in my server.

I have a dmz, mail server ip is x.y.z.2 gateway ip is x.y.z.5 and server mail ip of my isp is a.b.c.15.

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: Problem with iredmail 0.9.3 SMTP: [451] 4.3.5 Server configuration er

Is iredapd service running? Please start it.

3

Re: Problem with iredmail 0.9.3 SMTP: [451] 4.3.5 Server configuration er

The service iredapd is running, but the error is the same.

4

Re: Problem with iredmail 0.9.3 SMTP: [451] 4.3.5 Server configuration er

root@mx:~# tailf /var/log/iredapd/iredapd.log
2015-12-17 07:48:45 INFO Loading plugin: amavisd_wblist
2015-12-17 07:48:45 INFO Loading plugin: throttle
2015-12-17 07:48:45 INFO Loading plugin: ldap_maillist_access_policy
2015-12-18 15:55:22 INFO Starting iRedAPD (version: 1.7.0, backend: ldap), listening on 127.0.0.1:7777.
2015-12-18 15:55:22 INFO Log rotate type: time, interval: W6, backup copies: 12.
2015-12-18 15:55:22 INFO Loading plugin: reject_null_sender
2015-12-18 15:55:22 INFO Loading plugin: greylisting
2015-12-18 15:55:22 INFO Loading plugin: amavisd_wblist
2015-12-18 15:55:22 INFO Loading plugin: throttle
2015-12-18 15:55:22 INFO Loading plugin: ldap_maillist_access_policy

5

Re: Problem with iredmail 0.9.3 SMTP: [451] 4.3.5 Server configuration er

*) Does restart iRedAPD service solve this issue?
*) Show us output of command "postconf -n".

6

Re: Problem with iredmail 0.9.3 SMTP: [451] 4.3.5 Server configuration er

postconf -n

This is the postfix configuration

alias_database = hash:/etc/postfix/aliases
alias_maps = hash:/etc/postfix/aliases
allow_min_user = no
allow_percent_hack = no
biff = no
body_checks = pcre:/etc/postfix/body_checks.pcre
broken_sasl_auth_clients = yes
command_directory = /usr/sbin
config_directory = /etc/postfix
content_filter = smtp-amavis:[127.0.0.1]:10024
daemon_directory = /usr/lib/postfix
data_directory = /var/lib/postfix
debug_peer_level = 2
debugger_command = PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin ddd $daemon_directory/$process_name $process_id & sleep 5
disable_vrfy_command = yes
dovecot_destination_recipient_limit = 1
enable_original_recipient = no
header_checks = pcre:/etc/postfix/header_checks
home_mailbox = Maildir/
inet_interfaces = all
inet_protocols = all
lmtp_tls_mandatory_protocols = !SSLv2 !SSLv3
lmtp_tls_protocols = !SSLv2 !SSLv3
mail_owner = postfix
mailbox_command = /usr/lib/dovecot/deliver
mailq_path = /usr/bin/mailq
message_size_limit = 15728640
mydestination = $myhostname, localhost, localhost.localdomain
mydomain = mx.example.gov.com
myhostname = mx.example.gov.com
mynetworks = 127.0.0.1
myorigin = mx.example.gov.com
newaliases_path = /usr/bin/newaliases
postscreen_access_list = permit_mynetworks, cidr:/etc/postfix/postscreen_access.cidr
postscreen_blacklist_action = enforce
postscreen_dnsbl_action = enforce
postscreen_dnsbl_reply_map = texthash:/etc/postfix/postscreen_dnsbl_reply
postscreen_dnsbl_sites = zen.spamhaus.org*3 b.barracudacentral.org*2 bl.spameatingmonkey.net*2 bl.spamcop.net dnsbl.sorbs.net psbl.surriel.com bl.mailspike.net swl.spamhaus.org*-4 list.dnswl.org=127.[0..255].[0..255].0*-2 list.dnswl.org=127.[0..255].[0..255].1*-3 list.dnswl.org=127.[0..255].[0..255].[2..255]*-4
postscreen_dnsbl_threshold = 2
postscreen_greet_action = enforce
proxy_read_maps = $canonical_maps $lmtp_generic_maps $local_recipient_maps $mydestination $mynetworks $recipient_bcc_maps $recipient_canonical_maps $relay_domains $relay_recipient_maps $relocated_maps $sender_bcc_maps $sender_canonical_maps $smtp_generic_maps $smtpd_sender_login_maps $transport_maps $virtual_alias_domains $virtual_alias_maps $virtual_mailbox_domains $virtual_mailbox_maps $smtpd_sender_restrictions
queue_directory = /var/spool/postfix
recipient_bcc_maps =
recipient_delimiter = +
relay_domains =
relay_recipient_maps =
sender_bcc_maps =
sendmail_path = /usr/sbin/sendmail
setgid_group = postdrop
smtp-amavis_destination_recipient_limit = 1
smtp_tls_CAfile = $smtpd_tls_CAfile
smtp_tls_loglevel = 0
smtp_tls_mandatory_protocols = !SSLv2 !SSLv3
smtp_tls_note_starttls_offer = yes
smtp_tls_protocols = !SSLv2 !SSLv3
smtp_tls_security_level = may
smtpd_data_restrictions = reject_unauth_pipelining
smtpd_end_of_data_restrictions = #check_policy_service inet:127.0.0.1:7777
smtpd_helo_required = yes
smtpd_helo_restrictions = permit_mynetworks permit_sasl_authenticated reject_non_fqdn_helo_hostname reject_invalid_helo_hostname
check_helo_access pcre:/etc/postfix/helo_access.pcre
smtpd_recipient_restrictions = reject_unknown_recipient_domain reject_non_fqdn_recipient reject_unlisted_recipient permit_mynetworks permit_sasl_authenticated reject_unauth_destination
smtpd_reject_unlisted_recipient = yes
smtpd_reject_unlisted_sender = yes
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain = example.gov.com
smtpd_sasl_path = private/dovecot-auth
smtpd_sasl_security_options = noanonymous
smtpd_sasl_type = dovecot
smtpd_sender_login_maps = proxy:ldap:/etc/postfix/ad_sender_login_maps.cf
smtpd_sender_restrictions = reject_unknown_sender_domain reject_non_fqdn_sender reject_unlisted_sender permit_mynetworks reject_sender_login_mismatch permit_sasl_authenticated check_sender_access pcre:/etc/postfix/sender_access.pcre
smtpd_tls_CAfile = /etc/ssl/certs/iRedMail.crt
smtpd_tls_auth_only = yes
smtpd_tls_cert_file = /etc/ssl/certs/iRedMail.crt
smtpd_tls_dh1024_param_file = /etc/ssl/dhparams.pem
smtpd_tls_exclude_ciphers = aNULL, eNULL, EXPORT, DES, RC4, MD5, PSK, aECDH, EDH-DSS-DES-CBC3-SHA, EDH-RSA-DES-CDC3-SHA, KRB5-DE5, CBC3-SHA
smtpd_tls_key_file = /etc/ssl/private/iRedMail.key
smtpd_tls_loglevel = 0
smtpd_tls_mandatory_protocols = !SSLv2 !SSLv3
smtpd_tls_protocols = !SSLv2 !SSLv3
smtpd_tls_security_level = may
swap_bangpath = no
tls_random_source = dev:/dev/urandom
transport_maps = hash:/etc/postfix/transport
unknown_local_recipient_reject_code = 550
virtual_alias_domains =
virtual_alias_maps = proxy:ldap:/etc/postfix/ad_virtual_group_maps.cf
virtual_gid_maps = static:2000
virtual_mailbox_base = /var/vmail
virtual_mailbox_domains = example.gov.com
virtual_mailbox_maps = proxy:ldap:/etc/postfix/ad_virtual_mailbox_maps.cf
virtual_minimum_uid = 2000
virtual_transport = dovecot
virtual_uid_maps = static:2000

7

Re: Problem with iredmail 0.9.3 SMTP: [451] 4.3.5 Server configuration er

You didn't answer my first question: Does restart iRedAPD service solve this issue?

pablorvh wrote:

smtpd_end_of_data_restrictions = #check_policy_service inet:127.0.0.1:7777
smtpd_recipient_restrictions = reject_unknown_recipient_domain reject_non_fqdn_recipient reject_unlisted_recipient permit_mynetworks permit_sasl_authenticated reject_unauth_destination

You disabled iRedAPD service. But you should comment out the whole "smtpd_end_of_data_restrictions" to disable it, please fix this and restart postfix, try again.

8

Re: Problem with iredmail 0.9.3 SMTP: [451] 4.3.5 Server configuration er

Does restart iRedAPD service solve this issue?

No, i was wrote the tail of IRedAPD, but the problem isn't resolve.

9

Re: Problem with iredmail 0.9.3 SMTP: [451] 4.3.5 Server configuration er

*) What's your Postfix config now?
*) Is iRedAPD running?
*) Is iRedAPD enabled in Postfix (check_policy_service inet:127.0.0.1:7777)?
*) Does this issue occur again?

10

Re: Problem with iredmail 0.9.3 SMTP: [451] 4.3.5 Server configuration er

I change
smtpd_end_of_data_restrictions = #check_policy_service inet:127.0.0.1:7777

to this

smtpd_end_of_data_restrictions =

11

Re: Problem with iredmail 0.9.3 SMTP: [451] 4.3.5 Server configuration er

Could you please answer ALL my questions in last post?

12

Re: Problem with iredmail 0.9.3 SMTP: [451] 4.3.5 Server configuration er

main.cf file
# --------------------
# INSTALL-TIME CONFIGURATION INFORMATION
#
# location of the Postfix queue. Default is /var/spool/postfix.
queue_directory = /var/spool/postfix

# location of all postXXX commands. Default is /usr/sbin.
command_directory = /usr/sbin

# location of all Postfix daemon programs (i.e. programs listed in the
# master.cf file). This directory must be owned by root.
# Default is /usr/libexec/postfix
daemon_directory = /usr/lib/postfix

# location of Postfix-writable data files (caches, random numbers).
# This directory must be owned by the mail_owner account (see below).
# Default is /var/lib/postfix.
data_directory = /var/lib/postfix

# owner of the Postfix queue and of most Postfix daemon processes.
# Specify the name of a user account THAT DOES NOT SHARE ITS USER OR GROUP ID
# WITH OTHER ACCOUNTS AND THAT OWNS NO OTHER FILES OR PROCESSES ON THE SYSTEM.
# In particular, don't specify nobody or daemon. PLEASE USE A DEDICATED USER.
# Default is postfix.
mail_owner = postfix

# The following parameters are used when installing a new Postfix version.
#
# sendmail_path: The full pathname of the Postfix sendmail command.
# This is the Sendmail-compatible mail posting interface.
#
sendmail_path = /usr/sbin/sendmail

# newaliases_path: The full pathname of the Postfix newaliases command.
# This is the Sendmail-compatible command to build alias databases.
#
newaliases_path = /usr/bin/newaliases

# full pathname of the Postfix mailq command.  This is the Sendmail-compatible
# mail queue listing command.
mailq_path = /usr/bin/mailq

# group for mail submission and queue management commands.
# This must be a group name with a numerical group ID that is not shared with
# other accounts, not even with the Postfix account.
setgid_group = postdrop

# external command that is executed when a Postfix daemon program is run with
# the -D option.
#
# Use "command .. & sleep 5" so that the debugger can attach before
# the process marches on. If you use an X-based debugger, be sure to
# set up your XAUTHORITY environment variable before starting Postfix.
#
debugger_command =
    PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
    ddd $daemon_directory/$process_name $process_id & sleep 5

debug_peer_level = 2

# --------------------
# CUSTOM SETTINGS
#

# SMTP server response code when recipient or domain not found.
unknown_local_recipient_reject_code = 550

# Do not notify local user.
biff = no

# Disable the rewriting of "site!user" into "user@site".
swap_bangpath = no

# Disable the rewriting of the form "user%domain" to "user@domain".
allow_percent_hack = no

# Allow recipient address start with '-'.
allow_min_user = no

# Disable the SMTP VRFY command. This stops some techniques used to
# harvest email addresses.
disable_vrfy_command = yes

# Enable both IPv4 and IPv6.
inet_protocols = all

# Enable all network interfaces.
inet_interfaces = all

# Mailbox type
home_mailbox = Maildir/

#
# TLS settings.
#
# Disable SSLv3
#
smtpd_tls_protocols = !SSLv2 !SSLv3
smtp_tls_protocols = !SSLv2 !SSLv3
lmtp_tls_protocols = !SSLv2 !SSLv3
smtpd_tls_mandatory_protocols = !SSLv2 !SSLv3
smtp_tls_mandatory_protocols = !SSLv2 !SSLv3
lmtp_tls_mandatory_protocols = !SSLv2 !SSLv3

#
# Fix 'The Logjam Attack'.
#
smtpd_tls_exclude_ciphers = aNULL, eNULL, EXPORT, DES, RC4, MD5, PSK, aECDH, EDH-DSS-DES-CBC3-SHA, EDH-RSA-DES-CDC3-SHA, KRB5-DE5, CBC3-SHA
smtpd_tls_dh1024_param_file = /etc/ssl/dhparams.pem

# Opportunistic TLS, used when Postfix sends email to remote SMTP server.
# Use TLS if this is supported by the remote SMTP server, otherwise use
# plaintext.
# References:
#   - http://www.postfix.org/TLS_README.html#client_tls_may
#   - http://www.postfix.org/postconf.5.html# … rity_level
smtp_tls_security_level = may
# Use the same CA file as smtpd.
smtp_tls_CAfile = $smtpd_tls_CAfile
smtp_tls_loglevel = 0
smtp_tls_note_starttls_offer = yes

# hostname
myhostname = mx.example.com
myorigin = mx.example.com
mydomain = mx.example.com

# trusted SMTP clients which are allowed to relay mail through Postfix.
mynetworks = 127.0.0.1

# Accepted local emails
mydestination = $myhostname, localhost, localhost.localdomain

# Reject unlisted sender and recipient
smtpd_reject_unlisted_recipient = yes
smtpd_reject_unlisted_sender = yes

# Header and body checks with PCRE table
header_checks = pcre:/etc/postfix/header_checks
body_checks = pcre:/etc/postfix/body_checks.pcre

# HELO restriction
smtpd_helo_required = yes
smtpd_helo_restrictions =
    permit_mynetworks
    permit_sasl_authenticated
    reject_non_fqdn_helo_hostname
    reject_invalid_helo_hostname
    check_helo_access pcre:/etc/postfix/helo_access.pcre

# Sender restrictions
smtpd_sender_restrictions =
    reject_unknown_sender_domain
    reject_non_fqdn_sender
    reject_unlisted_sender
    permit_mynetworks
    reject_sender_login_mismatch
    permit_sasl_authenticated
    check_sender_access pcre:/etc/postfix/sender_access.pcre

# Recipient restrictions
smtpd_recipient_restrictions =
    reject_unknown_recipient_domain
    reject_non_fqdn_recipient
    reject_unlisted_recipient
    permit_mynetworks
    permit_sasl_authenticated
    reject_unauth_destination

# Data restrictions
smtpd_data_restrictions = reject_unauth_pipelining

# END-OF-MESSAGE restrictions
smtpd_end_of_data_restrictions =

# The set of characters that can separate a user name from its extension
# (example: user+foo), or a .forward file name from its extension (example:
# .forward+foo).
# Postfix 2.11 and later supports multiple characters.
recipient_delimiter = +

proxy_read_maps = $canonical_maps $lmtp_generic_maps $local_recipient_maps $mydestination $mynetworks $recipient_bcc_maps $recipient_canonical_maps $relay_domains $relay_recipient_maps $relocated_maps $sender_bcc_maps $sender_canonical_maps $smtp_generic_maps $smtpd_sender_login_maps $transport_maps $virtual_alias_domains $virtual_alias_maps $virtual_mailbox_domains $virtual_mailbox_maps $smtpd_sender_restrictions

# Avoid duplicate recipient messages. Default is 'yes'.
enable_original_recipient = no

alias_maps = hash:/etc/postfix/aliases
alias_database = hash:/etc/postfix/aliases

# Default message_size_limit.
message_size_limit = 15728640

# Virtual support.
virtual_minimum_uid = 2000
virtual_uid_maps = static:2000
virtual_gid_maps = static:2000
virtual_mailbox_base = /var/vmail

# Do not set virtual_alias_domains.
virtual_alias_domains =

#
# Enable SASL authentication
#
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain = example.com
broken_sasl_auth_clients = yes
smtpd_sasl_security_options = noanonymous

# Force TLS-encrypted SASL authentication.
smtpd_tls_auth_only = yes

smtpd_tls_security_level = may
smtpd_tls_loglevel = 0
smtpd_tls_key_file = /etc/ssl/private/iRedMail.key
smtpd_tls_cert_file = /etc/ssl/certs/iRedMail.crt
smtpd_tls_CAfile = /etc/ssl/certs/iRedMail.crt
tls_random_source = dev:/dev/urandom
#
# Lookup virtual mail accounts
#
transport_maps = hash:/etc/postfix/transport

smtpd_sender_login_maps = proxy:ldap:/etc/postfix/ad_sender_login_maps.cf

virtual_mailbox_domains = example.com

relay_domains =

virtual_mailbox_maps = proxy:ldap:/etc/postfix/ad_virtual_mailbox_maps.cf

virtual_alias_maps = proxy:ldap:/etc/postfix/ad_virtual_group_maps.cf

sender_bcc_maps =

recipient_bcc_maps =
postscreen_dnsbl_threshold = 2
postscreen_dnsbl_sites = zen.spamhaus.org*3 b.barracudacentral.org*2 bl.spameatingmonkey.net*2 bl.spamcop.net dnsbl.sorbs.net psbl.surriel.com bl.mailspike.net swl.spamhaus.org*-4 list.dnswl.org=127.[0..255].[0..255].0*-2 list.dnswl.org=127.[0..255].[0..255].1*-3 list.dnswl.org=127.[0..255].[0..255].[2..255]*-4
postscreen_dnsbl_reply_map = texthash:/etc/postfix/postscreen_dnsbl_reply
postscreen_access_list = permit_mynetworks, cidr:/etc/postfix/postscreen_access.cidr
postscreen_greet_action = enforce
postscreen_dnsbl_action = enforce
postscreen_blacklist_action = enforce
#
# Dovecot SASL support.
#
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/dovecot-auth
mailbox_command = /usr/lib/dovecot/deliver
virtual_transport = dovecot
dovecot_destination_recipient_limit = 1
content_filter = smtp-amavis:[127.0.0.1]:10024
smtp-amavis_destination_recipient_limit = 1
relay_recipient_maps =

13

Re: Problem with iredmail 0.9.3 SMTP: [451] 4.3.5 Server configuration er

*) What's your Postfix config now?
*) Is iRedAPD running?
oot@mx:~# service postfix restart
Stopping Postfix Mail Transport Agent: postfix.
Starting Postfix Mail Transport Agent: postfix.
root@mx:~# service dovecot restart
Restarting IMAP/POP3 mail server: dovecot.
root@mx:~# service iredapd restart
Stopping iredapd ...
Starting iredapd ...
root@mx:~# service iredapd status
iredapd is running.   

*) Is iRedAPD enabled in Postfix (check_policy_service inet:127.0.0.1:7777)?
# END-OF-MESSAGE restrictions
smtpd_end_of_data_restrictions =

*) Does this issue occur again?
I try again

14

Re: Problem with iredmail 0.9.3 SMTP: [451] 4.3.5 Server configuration er

*) Does this issue occur again?
I can send mail Thanks for everythings, i have another cuestion
how i can send my domains mails to ispmail? (relayhosts??)

15

Re: Problem with iredmail 0.9.3 SMTP: [451] 4.3.5 Server configuration er

another questions.
How i can get a copy from all emails of my users to one user??

16

Re: Problem with iredmail 0.9.3 SMTP: [451] 4.3.5 Server configuration er

pablorvh wrote:

how i can send my domains mails to ispmail? (relayhosts??)

If you mean send email via ispmail, then yes, you need 'relayhost =' setting in Postfix.

pablorvh wrote:

How i can get a copy from all emails of my users to one user??

server-side bcc setting.

iRedMail already has bcc settings enabled by default, try this:

postconf -n | grep 'bcc'

17

Re: Problem with iredmail 0.9.3 SMTP: [451] 4.3.5 Server configuration er

Hi, ZhangHuangbin
Send mail via ISP
I put this in main.cf

relayhost = x.y.z.a
and i try to send email to other domain for example: gmail.com

Error SMTP (450): No se pudo establecer destinatario "xxx@gmail.com" (4.1.2 <xxx@gmail.com>: Recipient address rejected: Domain not found).
I has to make changes in file transport to send mail via ISP??
transport file have this configuration

example.com dovecot

18

Re: Problem with iredmail 0.9.3 SMTP: [451] 4.3.5 Server configuration er

pablorvh wrote:

Recipient address rejected: Domain not found

this is a dns issue. Make sure you have correct dns server addresses in /etc/resolv.conf and /var/spool/postfix/etc/resolv.conf.

19

Re: Problem with iredmail 0.9.3 SMTP: [451] 4.3.5 Server configuration er

i have this in /etc/resolv.conf and /var/spool/postfix/etc/resolv.conf

searchexample.com
nameserver 192.168.1.7

20

Re: Problem with iredmail 0.9.3 SMTP: [451] 4.3.5 Server configuration er

What's the output of command below running on your server?

dig @192.168.1.7 -t a gmail.com

21

Re: Problem with iredmail 0.9.3 SMTP: [451] 4.3.5 Server configuration er

root@dc:~# dig @192.168.1.7 -t a gmail.com

; <<>> DiG 9.9.5-9+deb8u2-Debian <<>> @192.168.1.7 -t a gmail.com
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 48454
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;gmail.com.                     IN      A

;; Query time: 11 msec
;; SERVER: 192.168.1.7#53(192.168.1.7)
;; WHEN: Thu Jan 28 12:25:36 EST 2016
;; MSG SIZE  rcvd: 38

22

Re: Problem with iredmail 0.9.3 SMTP: [451] 4.3.5 Server configuration er

Now you see the problem. This DNS server didn't return any A record of @gmail.com.

23

Re: Problem with iredmail 0.9.3 SMTP: [451] 4.3.5 Server configuration er

How i can disabled the query to DNS and send all emails, exclude the local domains via ISPMail using relayhost?

24

Re: Problem with iredmail 0.9.3 SMTP: [451] 4.3.5 Server configuration er

Why not use a working DNS server?

25

Re: Problem with iredmail 0.9.3 SMTP: [451] 4.3.5 Server configuration er

Because my domain is in internal vpn, all emails, exclude my domain, i will send to the relayhost. This is my restriction.