Topic: Root mail issue using different myhostname and mydomain in Postfix
==== Required information ====
- iRedMail version (check /etc/iredmail-release): 0.9.6 OPENLDAP edition.
- Linux/BSD distribution name and version: Linux 2.6.32-042stab120.18 Debian 8
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): LDAP
- Web server (Apache or Nginx): Nginx
- Manage mail accounts with iRedAdmin-Pro? no
- Related log if you're reporting an issue:
Apr 12 20:06:37 se2 postfix/master[27197]: terminating on signal 15
Apr 12 20:06:37 se2 postfix/master[27502]: daemon started -- version 2.11.3, configuration /etc/postfix
Apr 12 20:07:04 se2 postfix/pickup[27503]: 8B34D123411: uid=0 from=<root>
Apr 12 20:07:04 se2 postfix/cleanup[27521]: 8B34D123411: message-id=<20170412170704.8B34D123411@se2.example.com>
Apr 12 20:07:04 se2 postfix/qmgr[27504]: 8B34D123411: from=<root@example.com>, size=301, nrcpt=1 (queue active)
Apr 12 20:07:04 se2 postfix/10025/smtpd[27528]: connect from localhost.localdomain[127.0.0.1]
Apr 12 20:07:04 se2 postfix/10025/smtpd[27528]: EC2F7123414: client=localhost.localdomain[127.0.0.1]
Apr 12 20:07:04 se2 postfix/cleanup[27521]: EC2F7123414: message-id=<20170412170704.8B34D123411@se2.example.com>
Apr 12 20:07:04 se2 postfix/qmgr[27504]: EC2F7123414: from=<root@example.com>, size=754, nrcpt=1 (queue active)
Apr 12 20:07:04 se2 postfix/10025/smtpd[27528]: disconnect from localhost.localdomain[127.0.0.1]
Apr 12 20:07:04 se2 amavis[27051]: (27051-01) Passed CLEAN {RelayedInbound}, [127.0.0.1] <root@example.com> -> <root@example.com>, Message-ID: <20170412170704.8B34D123411@se2.example.com>, mail_id: tTvyDMbQzH2m, Hits: -0.001, size: 301, queued_as: EC2F7123414, 373 ms, Tests: [NO_RELAYS=-0.001]
Apr 12 20:07:04 se2 postfix/smtp-amavis/smtp[27523]: 8B34D123411: to=<root@example.com>, relay=127.0.0.1[127.0.0.1]:10024, delay=0.43, delays=0.02/0.01/0.05/0.34, dsn=2.0.0, status=sent (250 2.0.0 from MTA(smtp:[127.0.0.1]:10025): 250 2.0.0 Ok: queued as EC2F7123414)
Apr 12 20:07:04 se2 postfix/qmgr[27504]: 8B34D123411: removed
Apr 12 20:07:05 se2 postfix/pipe[27529]: EC2F7123414: to=<root@example.com>, relay=dovecot, delay=0.05, delays=0/0.01/0/0.03, dsn=5.1.1, status=bounced (user unknown)
Apr 12 20:07:05 se2 postfix/cleanup[27521]: 04C2D12341B: message-id=<20170412170705.04C2D12341B@se2.example.com>
Apr 12 20:07:05 se2 postfix/qmgr[27504]: 04C2D12341B: from=<>, size=2529, nrcpt=1 (queue active)
Apr 12 20:07:05 se2 postfix/bounce[27531]: EC2F7123414: sender non-delivery notification: 04C2D12341B
Apr 12 20:07:05 se2 postfix/qmgr[27504]: EC2F7123414: removed
Apr 12 20:07:05 se2 postfix/pipe[27529]: 04C2D12341B: to=<root@example.com>, relay=dovecot, delay=0.03, delays=0.01/0/0/0.02, dsn=5.1.1, status=bounced (user unknown)
Apr 12 20:07:05 se2 postfix/qmgr[27504]: 04C2D12341B: removed
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
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
inet_interfaces = all
inet_protocols = all
lmtp_tls_mandatory_protocols = !SSLv2 !SSLv3
lmtp_tls_protocols = !SSLv2 !SSLv3
mail_owner = postfix
mailq_path = /usr/bin/mailq
message_size_limit = 31457280
mydestination = $myhostname, localhost, localhost.localdomain
mydomain = example.com
myhostname = se2.example.com
mynetworks = 127.0.0.1
myorigin = $mydomain
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=127.0.0.[2..11]*3 b.barracudacentral.org=127.0.0.[2..11]*2
postscreen_dnsbl_threshold = 2
postscreen_dnsbl_whitelist_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 $sender_dependent_relayhost_maps
queue_directory = /var/spool/postfix
recipient_bcc_maps = proxy:ldap:/etc/postfix/ldap/recipient_bcc_maps_user.cf proxy:ldap:/etc/postfix/ldap/recipient_bcc_maps_domain.cf
recipient_delimiter = +
relay_domains = $mydestination proxy:ldap:/etc/postfix/ldap/relay_domains.cf
sender_bcc_maps = proxy:ldap:/etc/postfix/ldap/sender_bcc_maps_user.cf proxy:ldap:/etc/postfix/ldap/sender_bcc_maps_domain.cf
sender_dependent_relayhost_maps = proxy:ldap:/etc/postfix/ldap/sender_dependent_relayhost_maps_user.cf proxy:ldap:/etc/postfix/ldap/sender_dependent_relayhost_maps_domain.cf
sendmail_path = /usr/sbin/sendmail
setgid_group = postdrop
smtp-amavis_destination_recipient_limit = 1
smtp_tls_CAfile = $smtpd_tls_CAfile
smtp_tls_loglevel = 1
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_unknown_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 check_policy_service inet:127.0.0.1:7777 permit_mynetworks permit_sasl_authenticated reject_unauth_destination
smtpd_reject_unlisted_recipient = yes
smtpd_reject_unlisted_sender = yes
smtpd_sasl_path = private/dovecot-auth
smtpd_sasl_type = dovecot
smtpd_sender_login_maps = proxy:ldap:/etc/postfix/ldap/sender_login_maps.cf
smtpd_sender_restrictions = reject_unknown_sender_domain reject_non_fqdn_sender reject_unlisted_sender permit_mynetworks permit_sasl_authenticated check_sender_access pcre:/etc/postfix/sender_access.pcre
smtpd_tls_CAfile = /etc/ssl/certs/example.com.bundle.crt
smtpd_tls_cert_file = /etc/ssl/certs/example.com.crt
smtpd_tls_dh1024_param_file = /etc/ssl/dh2048_param.pem
smtpd_tls_dh512_param_file = /etc/ssl/dh512_param.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/example.com.key
smtpd_tls_loglevel = 1
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 = proxy:ldap:/etc/postfix/ldap/transport_maps_user.cf proxy:ldap:/etc/postfix/ldap/transport_maps_domain.cf
unknown_local_recipient_reject_code = 550
virtual_alias_domains =
virtual_alias_maps = proxy:ldap:/etc/postfix/ldap/virtual_alias_maps.cf proxy:ldap:/etc/postfix/ldap/virtual_group_maps.cf proxy:ldap:/etc/postfix/ldap/virtual_group_members_maps.cf proxy:ldap:/etc/postfix/ldap/catchall_maps.cf
virtual_gid_maps = static:2000
virtual_mailbox_base = /var/vmail
virtual_mailbox_domains = proxy:ldap:/etc/postfix/ldap/virtual_mailbox_domains.cf
virtual_mailbox_maps = proxy:ldap:/etc/postfix/ldap/virtual_mailbox_maps.cf
virtual_minimum_uid = 2000
virtual_transport = dovecot
virtual_uid_maps = static:2000
====
Hello!
Logwatch and backup mail arrive to postmaster while there are default settings in main.cf
myhostname = se2.example.com
myorigin = se2.example.com
mydomain = se2.example.com
mydestination = $myhostname, localhost, localhost.localdomain
and postfix sends mail to root@se2.example.com .
In fact i use domain example.com and after i change this settings to listed below
myhostname = se2.example.com
myorigin = $mydomain
mydomain = example.com
mydestination = $myhostname, localhost, localhost.localdomain
postfix begins to send post to root@example.com and i see
"status=sent (250 2.0.0 from MTA(smtp:[127.0.0.1]:10025): 250 2.0.0 Ok: queued as 97541123407)"
but the next line is
"status=bounced (user unknown)"
I tried to change "mydestination", adding $mydomain but nothing happens.
If i add $mydomain, i see
" warning: do not list domain example.com in BOTH mydestination and virtual_mailbox_domains"
The same time i can send mail from real user to real user. What should i do to normalize sending mail from local virtual users like root?
----
Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.