1

Topic: Can't send email with one of the domain.

==== ==== ==== Provide required information ====
- iRedMail version and backend (LDAP/MySQL/PGSQL):MySQL
- Linux/BSD distribution name and version: CentOS 6.2 64bit
- Any related log? Log is helpful for troubleshooting. Yes
====

Hi Mr. Zhang.

I have this funky problem that I couldn't figure out what the source of the problem.  I have 3 domains running on the same iredmail server.

Server1.mydomain.com
server2.mydomain.net
myotherdomain.com

I'm trying to send email from server1.mydomain.com using server2.mydomain.net smtp and I got this error.  However I can send email using myotherdomain.com smtp.  I have no problem receiving email from any of the domains mentioned above.  I'd like to believe that if I could send and receive email from myotherdomain.com, I shouldn't have problem with server1.mydomain.com and server2.mydomain.net account though right?  Any suggestion based on the log I included from the bounced email?  Please advise?  Many thanks in advance for all of your help..


Here is the log:

This is the mail system at host server1.mydomain.com.

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

<myaccount@gmail.com>: unknown mail transport error
Reporting-MTA: dns; server1.mydomain.com
X-Postfix-Queue-ID: 917E61E11A2
X-Postfix-Sender: rfc822; support@myotherdomain.com
Arrival-Date: Thu, 14 Jun 2012 09:46:17 -0700 (PDT)

Final-Recipient: rfc822; myaccount@gmail.com
Original-Recipient: rfc822;myaccount@gmail.com
Action: failed
Status: 4.3.0
Diagnostic-Code: X-Postfix; unknown mail transport error
Return-Path: <support@myotherdomain.com>
Received: from localhost (localhost [127.0.0.1])
    by server1.mydomain.com (Postfix) with ESMTP id 917E61E11A2
    for <myaccount@gmail.com>; Thu, 14 Jun 2012 09:46:17 -0700 (PDT)
X-Virus-Scanned: amavisd-new at server1.mydomain.com
Received: from server1.mydomain.com ([127.0.0.1])
    by localhost (server1.mydomain.com [127.0.0.1]) (amavisd-new, port 10024)
    with ESMTP id PThk6RJk0Y1T for <myaccount@gmail.com>;
    Thu, 14 Jun 2012 09:46:16 -0700 (PDT)
Received: from server2.mydomain.net (localhost [127.0.0.1])
    by server1.mydomain.com (Postfix) with ESMTPA id CA3641E118B
    for <myaccount@gmail.com>; Thu, 14 Jun 2012 09:46:16 -0700 (PDT)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8;
 format=flowed
Content-Transfer-Encoding: 7bit
Date: Thu, 14 Jun 2012 09:46:16 -0700
From: support@myotherdomain.com
To: <myaccount@gmail.com>
Subject: can you see me?
Message-ID: <d41656ed64d8cc47223987cfa920c351@myotherdomain.com>
X-Sender: support@myotherdomain.com
User-Agent: RoundCube WebMail 

----

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

2

Re: Can't send email with one of the domain.

<myaccount@gmail.com>: unknown mail transport error
Reporting-MTA: dns; server1.mydomain.com

It looks like a DNS issue: your server cannot resolve gmail.com (neither MX  nor A record).

- Did you test DNS related stuffs?
- Does /var/spool/postfix/etc/resolv.conf exist and same as /etc/resolv.conf?
- Does /var/spool/postfix/etc/hosts exist and same as /etc/hosts?

3 (edited by westdude 2012-06-21 14:11:19)

Re: Can't send email with one of the domain.

ZhangHuangbin wrote:

<myaccount@gmail.com>: unknown mail transport error
Reporting-MTA: dns; server1.mydomain.com

It looks like a DNS issue: your server cannot resolve gmail.com (neither MX  nor A record).

- Did you test DNS related stuffs?
- Does /var/spool/postfix/etc/resolv.conf exist and same as /etc/resolv.conf?
- Does /var/spool/postfix/etc/hosts exist and same as /etc/hosts?

Thanks Mr.Zhang.

- Did you test DNS related stuffs?  Yes I did.
- Does /var/spool/postfix/etc/resolv.conf exist and same as /etc/resolv.conf?  It exists and the same as resolv.conf.  But I saw it was missing the search and domain.  So I fix it.
- Does /var/spool/postfix/etc/hosts exist and same as /etc/hosts?  It exists but different than the /etc/hosts.  I just change it.


Now I'm going to reboot the machine and see whether this solve the problem.  Many thanks for the suggestion.   But still though.  With the same old configuration prior to changing to your spec, why does it work with myotherdomain.com?  Very mind boggling.   I'll keep you updated after the reboot.  :-)  Many thanks again.

4

Re: Can't send email with one of the domain.

BTW, is there a log file somewhere that I can check to see more in details what the potential issue is with the smtp?  Please advise?

5

Re: Can't send email with one of the domain.

westdude wrote:

BTW, is there a log file somewhere that I can check to see more in details what the potential issue is with the smtp?  Please advise?

I found the location of the log file from one of your article. 

Related log files could be: /var/log/maillog, /var/log/dovecot.log, /var/log/iredapd.log.

Here is the copy of the error even after I fixed the resolv.conf and hosts.

Jun 21 09:12:20 seamail1 postfix/master[1803]: warning: /usr/libexec/postfix/smtp: bad command startup -- throttling
Jun 21 09:12:20 seamail1 postfix/error[6842]: 9F96F1E11E3: to=<myaccount@gmail.com>, relay=none, delay=48827, delays=48826/1/0/0.01, dsn=4.3.0, status=deferred (unknown mail transport error)

Any other suggestion Mr. Zhang?  Please advise?

6

Re: Can't send email with one of the domain.

Here is the info I gathered from this command.

postconf -n

alias_database = hash:/etc/postfix/aliases
alias_maps = hash:/etc/postfix/aliases
allow_min_user = no
biff = no
bounce_queue_lifetime = 1d
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/libexec/postfix
data_directory = /var/lib/postfix
debug_peer_level = 2
delay_warning_time = 0h
disable_vrfy_command = yes
enable_original_recipient = no
home_mailbox = Maildir/
html_directory = no
inet_interfaces = all
inet_protocols = ipv4
mail_owner = postfix
mailbox_command = /usr/libexec/dovecot/deliver
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
maximal_backoff_time = 4000s
maximal_queue_lifetime = 1d
message_size_limit = 15728640
minimal_backoff_time = 300s
mydestination = $myhostname, localhost, localhost.localdomain, localhost.$myhostname
mydomain = mydomain.net
myhostname = server1.mydomain.com
mynetworks = 127.0.0.0/8
mynetworks_style = subnet
myorigin = server1.mydomain.com
newaliases_path = /usr/bin/newaliases.postfix
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
queue_run_delay = 300s
readme_directory = /usr/share/doc/postfix-2.6.6/README_FILES
recipient_bcc_maps = proxy:mysql:/etc/postfix/mysql/recipient_bcc_maps_domain.cf, proxy:mysql:/etc/postfix/mysql/recipient_bcc_maps_user.cf
recipient_delimiter = +
relay_domains = $mydestination, proxy:mysql:/etc/postfix/mysql/relay_domains.cf
relayhost = smtp:[other_mail_server]:587
sample_directory = /usr/share/doc/postfix-2.6.6/samples
sender_bcc_maps = proxy:mysql:/etc/postfix/mysql/sender_bcc_maps_domain.cf, proxy:mysql:/etc/postfix/mysql/sender_bcc_maps_user.cf
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
smtp_data_init_timeout = 240s
smtp_data_xfer_timeout = 600s
smtpd_data_restrictions = reject_unauth_pipelining
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, permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination, reject_non_fqdn_helo_hostname, reject_invalid_helo_hostname, check_policy_service inet:127.0.0.1:10031
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:mysql:/etc/postfix/mysql/sender_login_maps.cf
smtpd_sender_restrictions = permit_mynetworks, reject_sender_login_mismatch, permit_sasl_authenticated
smtpd_tls_CAfile = /etc/pki/tls/certs/iRedMail_CA.pem
smtpd_tls_cert_file = /etc/pki/tls/certs/iRedMail_CA.pem
smtpd_tls_key_file = /etc/pki/tls/private/iRedMail.key
smtpd_tls_loglevel = 0
smtpd_tls_security_level = may
tls_random_source = dev:/dev/urandom
transport_maps = proxy:mysql:/etc/postfix/mysql/transport_maps_user.cf, proxy:mysql:/etc/postfix/mysql/transport_maps_domain.cf
unknown_local_recipient_reject_code = 550
virtual_alias_domains =
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
virtual_gid_maps = static:502
virtual_mailbox_base = /var/vmail
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_minimum_uid = 501
virtual_transport = dovecot
virtual_uid_maps = static:501

7

Re: Can't send email with one of the domain.

No comment from anyone?

8

Re: Can't send email with one of the domain.

Postfix config file looks fine. Still no idea at all, sorry. sad

9 (edited by westdude 2012-06-26 08:55:15)

Re: Can't send email with one of the domain.

I got mine working now.

I did some testing around to see what's happening.  I keep seeing this error

fatal: valid hostname or network address required in server description: smtp:[other_mail_server]:587

So I checked on /etc/postfix/main.cf and mod couple of these lines.

myhostname = server1.mydomain.com

mydomain = mydomain.com

Disable the relayhost.

#relayhost = smtp:[other_mail_server]:587

Run this command

postfix reload

I also opened up the firewall port on the host machine to allow port 110 and 587.  My email server is actually a virtual machine running on Virtuabox and I'm not sure why opening up the port on host machine will affect the port on the Guest machine.  But I have nothing to lose so I tried it.  I also found out that my search and domain information inside resolv.conf wasn't properly configured.
After doing all of the above, what do you know.  Voila......  Mail starting to transfer.  Also strange that for whatever reason iredmail script didn't modify this line in main.cf.  Not sure whether it's just me but o well, it's now working.  So I thought I share with all of you on how I fix the issue.  Good luck and many thanks..

10

Re: Can't send email with one of the domain.

Oops, i didn't check your relayhost setting... Sorry about my mistake. sad

11

Re: Can't send email with one of the domain.

ZhangHuangbin wrote:

Oops, i didn't check your relayhost setting... Sorry about my mistake. sad

No worries Mr.Zhang.

Thanks for all of your help..  :-)