1

Topic: Problem receiving e-mails from external domains for second domain

Hi all,

Im running a server with:

Ubuntu 12.04 64bit server
Newest iRedmail version with LDAP.

Out of the box, it just simply works, which is amazing. But however, I have trouble with the second domain i have added via. iRedadmin. I can send mail from both domains, with no problems. But I cant seem to receive e-mail from the second domain(only from external domains). The /var/log/mail.log doesnt seem to show info regarding this, that maybe could explain the problem. But i do get this error, when i send an e-mail to the secondary domain, from my g-mail account:

This is the mail system at host wblv-ip-mesg-1-2.saix.net.

I'm sorry to have to inform you that your message could not
be delivered to one or more recipients. It's attached below.

For further assistance, please send mail to postmaster.

If you do so, please include this problem report. You can
delete your own text from the attached returned message.

                   The mail system

<test@example.com>: mail for example.com loops back to myself

Final-Recipient: rfc822;test@example.com
Original-Recipient: rfc822;test@example.com
Action: failed
Status: 5.4.6
Diagnostic-Code: X-Postfix; mail for example.com loops back to myself

And before that error, i got this:

This is the mail system at host wblv-ip-mesg-2-2.saix.net.

I'm sorry to have to inform you that your message could not
be delivered to one or more recipients. It's attached below.

For further assistance, please send mail to postmaster.

If you do so, please include this problem report. You can
delete your own text from the attached returned message.

                   The mail system

<test@example.com>: host smtp.vodamail.co.za[196.11.146.149] said: 554 5.7.1
    <test@example.comk>: Recipient address rejected: Access denied (in reply
    to RCPT TO command)

Final-Recipient: rfc822; test@example.com
Original-Recipient: rfc822;test@example.com
Action: failed
Status: 5.7.1
Remote-MTA: dns; smtp.vodamail.co.za
Diagnostic-Code: smtp; 554 5.7.1 <test@example.com>: Recipient address
    rejected: Access denied

But the second error, seems to have resolved it self, after some time. But this is normal i think, because DNS changes take some time to replicate.

Im thinking, that postfix might need some extra configuration, to handle receiving e-mails for 2 different domains ? - What am I missing here ? - I have spent a lot of time researching the problem, but I cant seem to crack the code.

Any help towards solving this, will be highly appreciated

Thanks in advance

/JaX

----

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

2

Re: Problem receiving e-mails from external domains for second domain

JaX wrote:

Im thinking, that postfix might need some extra configuration, to handle receiving e-mails for 2 different domains ?

- Default settings in iRedMail is ready to serve multiple virtual mail domains, so no addition configuration is required.
- Please show us output of command "postconf -n" to help troubleshoot.
- Did you modify some config files on this iRedMail server?
- Tell us the real mail domain IF POSSIBLE. So that we can help check your DNS record.

3

Re: Problem receiving e-mails from external domains for second domain

Here is the output:


alias_database = hash:/etc/postfix/aliases
alias_maps = hash:/etc/postfix/aliases
allow_min_user = no
append_dot_mydomain = no
biff = no
bounce_queue_lifetime = 1d
broken_sasl_auth_clients = yes
config_directory = /etc/postfix
content_filter = smtp-amavis:[127.0.0.1]:10024
delay_warning_time = 0h
disable_vrfy_command = yes
dovecot_destination_recipient_limit = 1
enable_original_recipient = no
home_mailbox = Maildir/
inet_interfaces = all
inet_protocols = ipv4
mailbox_command = /usr/lib/dovecot/deliver
mailbox_size_limit = 0
maximal_backoff_time = 4000s
maximal_queue_lifetime = 1d
message_size_limit = 15728640
minimal_backoff_time = 300s
mydestination = $myhostname, localhost, localhost.localdomain, localhost.$myhostname
mydomain = gratisnethotel.dk
myhostname = web1.gratisnethotel.dk
mynetworks = 127.0.0.0/8
mynetworks_style = subnet
myorigin = web1.gratisnethotel.dk
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_run_delay = 300s
readme_directory = no
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
relayhost =
sender_bcc_maps = proxy:ldap:/etc/postfix/ldap/sender_bcc_maps_user.cf, proxy:ldap:/etc/postfix/ldap/sender_bcc_maps_domain.cf
smtp-amavis_destination_recipient_limit = 1
smtp_data_init_timeout = 240s
smtp_data_xfer_timeout = 600s
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
smtpd_data_restrictions = reject_unauth_pipelining
smtpd_end_of_data_restrictions = check_policy_service inet:127.0.0.1:10031
smtpd_enforce_tls = no
smtpd_helo_required = yes
smtpd_helo_restrictions = permit_mynetworks,permit_sasl_authenticated, check_helo_access pcre:/etc/postfix/helo_access.pcre
smtpd_recipient_restrictions = reject_unknown_sender_domain, reject_unknown_recipient_domain, reject_non_fqdn_sender, reject_non_fqdn_recipient, reject_unlisted_recipient, check_policy_service inet:127.0.0.1:7777, check_policy_service inet:127.0.0.1:10031, permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination, reject_non_fqdn_helo_hostname, reject_invalid_helo_hostname
smtpd_reject_unlisted_recipient = yes
smtpd_reject_unlisted_sender = yes
smtpd_sasl_auth_enable = yes
smtpd_sasl_authenticated_header = no
smtpd_sasl_local_domain =
smtpd_sasl_path = ./dovecot-auth
smtpd_sasl_security_options = noanonymous
smtpd_sasl_type = dovecot
smtpd_sender_login_maps = proxy:ldap:/etc/postfix/ldap/sender_login_maps.cf
smtpd_sender_restrictions = permit_mynetworks, reject_sender_login_mismatch, permit_sasl_authenticated
smtpd_tls_CAfile = /etc/ssl/certs/iRedMail_CA.pem
smtpd_tls_cert_file = /etc/ssl/certs/iRedMail_CA.pem
smtpd_tls_key_file = /etc/ssl/private/iRedMail.key
smtpd_tls_loglevel = 0
smtpd_tls_security_level = may
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes
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
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:1002
virtual_mailbox_base = /home/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 = 1002
virtual_transport = dovecot
virtual_uid_maps = static:1002

The domains:

gratisnethotel.dk works but jakobbrobak.dk doesnt. I have played around with the settings, but if i remember correctly, this install got the standard configuration.

Hope this helps you out smile

4

Re: Problem receiving e-mails from external domains for second domain

Could you please show me output of below commands:

# cd /etc/postfix/ldap/
# for cf in $(ls *cf); do echo ${cf}; postmap -q 'jakobbrobak.dk' ldap:./${cf}; done

5

Re: Problem receiving e-mails from external domains for second domain

catchall_maps.cf
recipient_bcc_maps_domain.cf
recipient_bcc_maps_user.cf
relay_domains.cf
sender_bcc_maps_domain.cf
sender_bcc_maps_user.cf
sender_login_maps.cf
transport_maps_domain.cf
dovecot
transport_maps_user.cf
virtual_alias_maps.cf
virtual_group_maps.cf
virtual_group_members_maps.cf
virtual_mailbox_domains.cf
jakobbrobak.dk
virtual_mailbox_maps.cf

6

Re: Problem receiving e-mails from external domains for second domain

Domain jakobbrobak.dk has MX record pointed to domain name smtp.saix.net which has IP address 196.43.2.142, is it the server hosting mail domain jakobbrobak.dk?

I tried to perform basic debug with telnet, but it doesn't seem right (not a iRedMail server):

$ telnet smtp.saix.net 25
Trying 196.43.2.142...
Connected to smtp.saix.net.
Escape character is '^]'.
220 wblv-ip-mesg-1-1.saix.net ESMTP Postfix
EHLO testing.com
250-wblv-ip-mesg-1-1.saix.net
250-PIPELINING
250-SIZE 102400000
250-ETRN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
STARTTLS
502 5.5.2 Error: command not recognized

Do you have correct DNS setting for this domain?

I tried a local iRedMail server with same SMTP commands, it returns different result. Please compare the output marked in red:

# telnet localhost 25
Trying ::1...
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 u104.iredmail.org ESMTP Postfix (Ubuntu)
EHLO testing.com
250-u104.iredmail.org
250-PIPELINING
250-SIZE 15728640
250-ETRN
250-STARTTLS
250-AUTH PLAIN LOGIN
250-AUTH=PLAIN LOGIN

250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
STARTTLS
220 2.0.0 Ready to start TLS

7

Re: Problem receiving e-mails from external domains for second domain

I think, I have realised where the problem is. You are right, I thought I was doing the right thing, by pointing both domains to the smtp server I am using. But it is only the primary domain, which need to point to it, the other domains, need to point at my server right ? - That must be it. Now I just need to wait for the dns to replicate. Thank you very much ZhangHuangbin, you are a godsend smile