1

Topic: relay access denied rejection of mail after adding domain alias

==== Required information ====
- iRedMail version (check /etc/iredmail-release): 0.9.6 MYSQL edition
- Linux/BSD distribution name and version:  Ubuntu 16.04 LTS
- Store mail accounts in which backend (LDAP/MySQL/PGSQL):  MYSQL
- Web server (Apache or Nginx): Nginx
- Manage mail accounts with iRedAdmin-Pro? Yes
- Related log if you're reporting an issue:  mail.log
====
After setting up and verifying an alias domain  which is added properly in iredmail pro admin I did not se deliveries of email for this domain.
checking the log I noted that the messages were being rejected with a relay access denied message.  this occurs on domains located on the server and also testing using gmail.

Is there anything else that is required to allow this to work i.e at command line level.

----

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

2

Re: relay access denied rejection of mail after adding domain alias

Please show us the original error log and full log related to your testing email  in Postfix log file.

3 (edited by jwmcgregor 2017-03-18 05:06:46)

Re: relay access denied rejection of mail after adding domain alias

is the log you are referring to /var/log/mail.log ?
here is the extract from there.

Mar 18 08:04:48 mail postfix/smtpd[18271]: Anonymous TLS connection established from mail-wm0-f50.google.com[74.125.82.50]: TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)
Mar 18 08:04:49 mail postfix/smtpd[18271]: NOQUEUE: reject: RCPT from mail-wm0-f50.google.com[74.125.82.50]: 454 4.7.1 <jim@mcga.net.au>: Relay access denied; from=<jim@mcga.com.au> to=<jim@mcga.net.au> proto=ESMTP helo=<mail-wm0-f50.google.com>
Mar 18 08:04:49 mail postfix/smtpd[18271]: disconnect from mail-wm0-f50.google.com[74.125.82.50] ehlo=2 starttls=1 mail=1 rcpt=0/1 data=0/1 quit=1 commands=5/7

4

Re: relay access denied rejection of mail after adding domain alias

jwmcgregor wrote:

Mar 18 08:04:49 mail postfix/smtpd[18271]: NOQUEUE: reject: RCPT from mail-wm0-f50.google.com[74.125.82.50]: 454 4.7.1 <jim@mcga.net.au>: Relay access denied; from=<jim@mcga.com.au> to=<jim@mcga.net.au> proto=ESMTP helo=<mail-wm0-f50.google.com>

Please try command below, i need this info for troubleshooting:

cd /etc/postfix/mysql/
for cf in $(ls *.cf); do echo $cf; postmap -q 'mcga.net.au' mysql:./$cf; done

And what's the primary domain? Does account jim@<primary_domain> exist? Please run command below:

cd /etc/postfix/mysql/
for cf in $(ls *.cf); do echo $cf; postmap -q 'jim@<primary_domain>' mysql:./$cf; done

Replace '<primary_domain>' by the real primary domain name.

5

Re: relay access denied rejection of mail after adding domain alias

Here is the output
for cf in $(ls *.cf); do echo $cf; postmap -q 'mcga.net.au' mysql:./$cf; done

root@mail:/etc/postfix/mysql# for cf in $(ls *.cf); do echo $cf; postmap -q 'mcga.net.au' mysql:./$cf; done
catchall_maps.cf
domain_alias_catchall_maps.cf
domain_alias_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_dependent_relayhost_maps.cf
sender_login_maps.cf
transport_maps_domain.cf
dovecot
transport_maps_user.cf
virtual_alias_maps.cf
virtual_mailbox_domains.cf
mcga.net.au
virtual_mailbox_maps.cf

for cf in $(ls *.cf); do echo $cf; postmap -q 'jim@sydneywebcreations.com.au' mysql:./$cf; done

catchall_maps.cf
domain_alias_catchall_maps.cf
domain_alias_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_dependent_relayhost_maps.cf
sender_login_maps.cf
jim@sydneywebcreations.com.au
transport_maps_domain.cf
transport_maps_user.cf
virtual_alias_maps.cf
jim@sydneywebcreations.com.au
virtual_mailbox_domains.cf
virtual_mailbox_maps.cf
vmail1/sydneywebcreations.com.au/j/i/m/jim-2017.03.17.04.34.07//Maildir/

6

Re: relay access denied rejection of mail after adding domain alias

I just realized that the log shows "from=<jim@mcga.com.au> to=<jim@mcga.net.au> "
The alias domain you have is .net.au, but the sender is .com.au. Is this correct?

Does it work if you send email from same server to this alias address?

7

Re: relay access denied rejection of mail after adding domain alias

the jim@mcgs.com.au is a gmail account the  alias the account jim@mcga.net.au  is attached to is jim@sydneywebcreations.com.au   I have tried it with a test domain as well. still getting relay access denied.

8

Re: relay access denied rejection of mail after adding domain alias

I would like to know what is causing this but for now I have taken out the alias domain and added it back as a standard tld and a forwarder from mcga.net.au to sydneywebcreations.com.au  There was too much being rejected.

I can set up a couple of test domains to work the problem if you want me to.

9

Re: relay access denied rejection of mail after adding domain alias

The output of "for ... postmap ..." commands looks just fine, so the data in SQL db should be fine, there might be something wrong in other part, i cannot figure it out with pasted log or output of commands. Have to test it with direct ssh access.

Is it possible to give me the direct ssh access for this troubleshooting? Since you add the alias domain with iRedAdmin-Pro, if it turns out it's a bug of iRedAdmin-Pro, the support will be free. but if it's an improper configuration by you, we will charge you a support ticket ($49). Fair enough?

10

Re: relay access denied rejection of mail after adding domain alias

Sounds fine.
I'll email you when your ssh key is in place.


ZhangHuangbin wrote:

The output of "for ... postmap ..." commands looks just fine, so the data in SQL db should be fine, there might be something wrong in other part, i cannot figure it out with pasted log or output of commands. Have to test it with direct ssh access.

Is it possible to give me the direct ssh access for this troubleshooting? Since you add the alias domain with iRedAdmin-Pro, if it turns out it's a bug of iRedAdmin-Pro, the support will be free. but if it's an improper configuration by you, we will charge you a support ticket ($49). Fair enough?