1 (edited by jose 2021-10-14 02:00:29)

Topic: Email address with Special characters: Relay access denied

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 1.4
- Deployed with iRedMail Easy or the downloadable installer?
Downloadable installer
- Linux/BSD distribution name and version:
Ubuntu 20 LTS
- Store mail accounts in which backend (LDAP/MySQL/PGSQL):
MySQL
- Web server (Apache or Nginx):
Apache
- Manage mail accounts with iRedAdmin-Pro?
No
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

Hello,

I'm using one CRM that generates a special unique email ID for each customer. This email ID is generated from the main email address like this first example:

- Customer name: John
- Unique generated email: email+customer+john@midomain.com

Everything is working fine if email id has not white speaces in customer name like first example.

If Customer name has white spaces, my CRM add special characters and I always received a Undelivered Mail Returned to Sender. Second Example:

- Customer Name: John Doe
- Unique generated email: email+customer+john+%20doe@midomain.com

The error log is:

Relay access denied (in reply to RCPT TO command)

If I use an external email account from gmail or similar, is working fine so I think it can be fixed in iRedMail configuration or Postfix.

Any idea please?

Thank you and excuse my poor English.

----

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

2

Re: Email address with Special characters: Relay access denied

then the crm should not do that and just strip out any whitespaces

3

Re: Email address with Special characters: Relay access denied

Cthulhu wrote:

then the crm should not do that and just strip out any whitespaces

The question is not whitespace,
Did % is valid in email
And yes : https://en.wikipedia.org/wiki/Email_address#Local-part

Maybe an issue in iredmail ?

4

Re: Email address with Special characters: Relay access denied

Could you please show me output of commands below? Replace "email+customer+john+%20doe@midomain.com" by the real email address while running.

cd /etc/postfix/mysql/
for cf in $(ls *.cf); do echo $cf; postmap -q "email+customer+john+%20doe@midomain.com" mysql:./$cf; done

5

Re: Email address with Special characters: Relay access denied

ZhangHuangbin wrote:

Could you please show me output of commands below? Replace "email+customer+john+%20doe@midomain.com" by the real email address while running.

cd /etc/postfix/mysql/
for cf in $(ls *.cf); do echo $cf; postmap -q "email+customer+john+%20doe@midomain.com" mysql:./$cf; done

The combination of these two settings in postfix does the trick but I'm not sure if this method is secure

allow_percent_hack = no
allow_untrusted_routing = yes

6

Re: Email address with Special characters: Relay access denied

jose wrote:

The combination of these two settings in postfix does the trick but I'm not sure if this method is secure
allow_percent_hack = no
allow_untrusted_routing = yes

I don't think this is the right solution.
Please check Postfix documents here:
- http://www.postfix.org/postconf.5.html# … rcent_hack
- http://www.postfix.org/postconf.5.html# … ed_routing

allow_percent_hack should be used only for locally generated emails, not email from internet which is not trustable.
allow_untrusted_routing is, well, untrusted...

Please contact your CRM vendor to get it fixed, it should not generate email address with whitespace included in email address.