1

Topic: Problems sending internal mail and mail to outside

==== Required information ====
- iRedMail version: 0.8.3
- Store mail accounts in which backend (LDAP/MySQL/PGSQL):  MySQL
- Linux/BSD distribution name and version:  Ubuntu 12.04 LTS
- Related log if you're reporting an issue:
====

I have instaled iRedMail on a FRESH, working Ubuntu 12.04 LTS version.
I have installed iRedMail 0.8.3 without no problems during the installation.
I have access to admin it via web from the other computers of the network.
Until here everything is OK.

I have a network with various (20) windows pc, all of them with their mail accounts configured on Thunderbird (2 different domains).
I have the mail service contracted with an external enterprise but want to send it all by postfix with iRedMail and test it to probably buy iRedMail-pro.

I have registered the 2 different domains that I use and registered one user on each one to test the system.
I have some problems with the mail sending system and I don't know how to solve them:
    - The mails sent between these two users are accessible by roundcube but do not arrive in their thunderbird accounts (for incoming mails I initially want to continue using the external contracted service)
    - These 2 users cannot send mails to the other users of the network (Recipient address rejected: User unknown in virtual mailbox table)
    - These 2 users cannot send mails to outside directions containing the symbol "-" in the domain (Recipient address rejected: Domain not found)

main.cf wrote:

# See /usr/share/postfix/main.cf.dist for a commented, more complete version


# Debian specific:  Specifying a file name will cause the first
# line of that file to be used as the name.  The Debian default
# is /etc/mailname.
#myorigin = /etc/mailname

smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no

# appending .domain is the MUA's job.
append_dot_mydomain = no

# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h

readme_directory = no

# TLS parameters
smtpd_tls_cert_file = /etc/ssl/certs/iRedMail_CA.pem
smtpd_tls_key_file = /etc/ssl/private/iRedMail.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache

# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.

myhostname = ubuntuserver.fopertek.com
alias_maps = hash:/etc/postfix/aliases
alias_database = hash:/etc/postfix/aliases
myorigin = ubuntuserver.fopertek.com
mydestination = $myhostname, localhost, localhost.localdomain, localhost.$myhostname
relayhost =
mynetworks = 127.0.0.0/8
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = ipv4
virtual_alias_domains =
mydomain = fopertek.com
mynetworks_style = subnet
smtpd_data_restrictions = reject_unauth_pipelining
smtpd_reject_unlisted_recipient = yes
smtpd_reject_unlisted_sender = yes
smtpd_sender_restrictions = permit_mynetworks, reject_sender_login_mismatch, permit_sasl_authenticated
delay_warning_time = 0h
maximal_queue_lifetime = 1d
bounce_queue_lifetime = 1d
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
smtp_data_init_timeout = 240s
smtp_data_xfer_timeout = 600s
smtpd_helo_required = yes
smtpd_helo_restrictions = permit_mynetworks,permit_sasl_authenticated, check_helo_access pcre:/etc/postfix/helo_access.pcre
queue_run_delay = 300s
minimal_backoff_time = 300s
maximal_backoff_time = 4000s
enable_original_recipient = no
disable_vrfy_command = yes
home_mailbox = Maildir/
allow_min_user = no
message_size_limit = 15728640
virtual_minimum_uid = 1001
virtual_uid_maps = static:1001
virtual_gid_maps = static:1001
virtual_mailbox_base = /var/vmail
transport_maps = proxy:mysql:/etc/postfix/mysql/transport_maps_user.cf, proxy:mysql:/etc/postfix/mysql/transport_maps_domain.cf
virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql/virtual_mailbox_domains.cf
virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql/virtual_mailbox_maps.cf
virtual_alias_maps = proxy:mysql:/etc/postfix/mysql/virtual_alias_maps.cf, proxy:mysql:/etc/postfix/mysql/domain_alias_maps.cf, proxy:mysql:/etc/postfix/mysql/catchall_maps.cf, proxy:mysql:/etc/postfix/mysql/domain_alias_catchall_maps.cf
sender_bcc_maps = proxy:mysql:/etc/postfix/mysql/sender_bcc_maps_user.cf, proxy:mysql:/etc/postfix/mysql/sender_bcc_maps_domain.cf
recipient_bcc_maps = proxy:mysql:/etc/postfix/mysql/recipient_bcc_maps_user.cf, proxy:mysql:/etc/postfix/mysql/recipient_bcc_maps_domain.cf
relay_domains = $mydestination, proxy:mysql:/etc/postfix/mysql/relay_domains.cf
smtpd_sender_login_maps = proxy:mysql:/etc/postfix/mysql/sender_login_maps.cf
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain =
broken_sasl_auth_clients = yes
smtpd_sasl_security_options = noanonymous
smtpd_sasl_authenticated_header = no
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_end_of_data_restrictions = check_policy_service inet:127.0.0.1:10031
smtpd_tls_security_level = may
smtpd_tls_loglevel = 0
smtpd_tls_CAfile = /etc/ssl/certs/iRedMail_CA.pem
tls_random_source = dev:/dev/urandom
mailbox_command = /usr/lib/dovecot/deliver
virtual_transport = dovecot
dovecot_destination_recipient_limit = 1
smtpd_sasl_type = dovecot
smtpd_sasl_path = ./dovecot-auth
content_filter = smtp-amavis:[127.0.0.1]:10024
smtp-amavis_destination_recipient_limit = 1

2

Re: Problems sending internal mail and mail to outside

If you have mail domain "example.com" hosted on your server, all emails sent to "@example.com" will be delivered locally. So i suggest you add two fake mail domains for testing.

These 2 users cannot send mails to outside directions containing the symbol "-" in the domain (Recipient address rejected: Domain not found)

Is this domain available while you perform DNS query? e.g.

# nslookup your-domain.com

3 (edited by Gistek-s 2013-02-25 22:55:55)

Re: Problems sending internal mail and mail to outside

Hello ZhangHuangbin and thanks a lot for your quick reply.
I have the two domains added for testing.
I unnderstand that the mails between the domains added are delivered locally.

The result for "nslookup my-domain.com" is:
Server: 8.8.8.8
Address: 8.8.8.8#53

Non-authoritative answer:
Name: my-domain.com
Address: 212.142.144.10
Name: my-domanin.com
Address: 212.142.144.9

I have solved the prolblem adding the 2 google dns directions on /etc/resolv.conf

But the main problem (send mail to outside) is still ocurring.
When I send a mail to outside I receive this answer:

"<maildir@maildomain.com>: host mail.domain.es[194.30.0.71] said: 550 5.1.8
    <myiredmailuser@myiredmaildomain.com>: Sender address rejected: Domain not found (in
    reply to RCPT TO command)"

4

Re: Problems sending internal mail and mail to outside

Gistek-s wrote:

But the main problem (send mail to outside) is still ocurring.
When I send a mail to outside I receive this answer:
"<maildir@maildomain.com>: host mail.domain.es[194.30.0.71] said: 550 5.1.8
    <myiredmailuser@myiredmaildomain.com>: Sender address rejected: Domain not found (in
    reply to RCPT TO command)"

Seems Postfix cannot find recipient domain (maildomain.com in your case).

5

Re: Problems sending internal mail and mail to outside

ZhangHuangbin wrote:

If you have mail domain "example.com" hosted on your server, all emails sent to "@example.com" will be delivered locally. So i suggest you add two fake mail domains for testing.

Can this type of sending be skipped by using a relay or a similar way?
What I want to test is to send a mail with the default user postmaster@mydomain.com to one of the accounts that already exists (contracted with an external enterprise ) with the same domain, for example gistek@mydomain.com
When I try to do it the program says me that the user gistek@mydomain.com does not exists (because I have not created it) and if I create it the mail is sent locally.




ZhangHuangbin wrote:
Gistek-s wrote:

But the main problem (send mail to outside) is still ocurring.
When I send a mail to outside I receive this answer:
"<maildir@maildomain.com>: host mail.domain.es[194.30.0.71] said: 550 5.1.8
    <myiredmailuser@myiredmaildomain.com>: Sender address rejected: Domain not found (in
    reply to RCPT TO command)"

Seems Postfix cannot find recipient domain (maildomain.com in your case).

The problem is that the destination domain does not recognize the fake domain I have created to test so it does not accept the mail. Is there any way to solve this error (ussing a relay or similar)?

6

Re: Problems sending internal mail and mail to outside

Is it possible for you to use a non-existing domain for testing?

7 (edited by Gistek-s 2013-02-26 23:34:25)

Re: Problems sending internal mail and mail to outside

ZhangHuangbin wrote:

Is it possible for you to use a non-existing domain for testing?

Yes I can create a domain @test.com; but when I have tried to send with a non existing domain the receiver rejects it indicating that the sender domain is unknown.

8

Re: Problems sending internal mail and mail to outside

I have tried to use the test domain i have added in iRedMail to send a mail from one of my real mail accounts (with the user and password from de iRedMail account) and I receive this message.

Error 553 "realaccount@myrealdomain.com" sender address rejected: not owned by user "postmaster@mytestiRedMaildomain.com"

How can I resolve this too?

9

Re: Problems sending internal mail and mail to outside

Hello,

#transport_maps = proxy:mysql:/etc/postfix/mysql/transport_maps_user.cf
#virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql/virtual_mailbox_domains.cf
#virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql/virtual_mailbox_maps.cf
#virtual_alias_maps = proxy:mysql:/etc/postfix/mysql/virtual_alias_maps.cf, proxy:mysql:/etc/postfix/mysql/domain_alias_maps.cf, proxy:mysql:/etc/postfix/mysql/catchall_maps.cf, proxy:mysql:/etc/postfix/mysql/domain_alias_catchall_maps.cf
#sender_bcc_maps = proxy:mysql:/etc/postfix/mysql/sender_bcc_maps_user.cf, proxy:mysql:/etc/postfix/mysql/sender_bcc_maps_domain.cf
#recipient_bcc_maps = proxy:mysql:/etc/postfix/mysql/recipient_bcc_maps_user.cf, proxy:mysql:/etc/postfix/mysql/recipient_bcc_maps_domain.cf


I commented these lines, as i have no use of it. Its sending mail out from my intranet to internet (other network) for same domain.

10

Re: Problems sending internal mail and mail to outside

Gistek-s wrote:

I have tried to use the test domain i have added in iRedMail to send a mail from one of my real mail accounts (with the user and password from de iRedMail account) and I receive this message.

Error 553 "realaccount@myrealdomain.com" sender address rejected: not owned by user "postmaster@mytestiRedMaildomain.com"

How can I resolve this too?

Reference: http://www.iredmail.org/forum/topic342- … -user.html
It's a good idea to search this forum before asking.

11

Re: Problems sending internal mail and mail to outside

ZhangHuangbin wrote:
Gistek-s wrote:

I have tried to use the test domain i have added in iRedMail to send a mail from one of my real mail accounts (with the user and password from de iRedMail account) and I receive this message.

Error 553 "realaccount@myrealdomain.com" sender address rejected: not owned by user "postmaster@mytestiRedMaildomain.com"

How can I resolve this too?

Reference: http://www.iredmail.org/forum/topic342- … -user.html
It's a good idea to search this forum before asking.

Sorry for that!!
I have done what appeared in that topic and that problem I had was solved (I have added a question to the topic)
This configuration can resolve the problem and migth work "near" that the way I want the system to work.


I have a network with various (20) windows pc, all of them with their mail accounts (2 different domains) configured on Thunderbird that send internal e-mails and e-mails to outside and receive internal e-mails and mails from outside.
I have the mail service contracted with an external enterprise and what I want is:

1.- Send emails (internal and to outside) from the 2 domains I have by postfix+iRedMail; but only having to modify the thunderbird configuration in each pc to send mails, not to receive the mails (mails recieved by the mail service I have contracted).

2.- Once the point 1 is achieved the next step is to receive all the mails (internal and from outside) by postfix+iRedMail, and configure thunderbird on all pcs to receive the mails from my server.