1

Topic: Proper way to accept email from outside servers for local account

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

Hello,

thanks for this software and all your hard work.

I have the following setup:

I have a domain example.com and an account info@example.com. These work as they should. As example.com is an e-shop, I need to send emails from the e-shop using an outside service (in my case Mailgun) for improved deliverability. This works OK for clients but when the e-shop tries to send an email (for example a New order notification) to the iRedMail server it fails:

Jan 10 15:25:47 mail postfix/smtpd[1690131]: NOQUEUE: reject: RCPT from m239-4.eu.mailgun.net[185.250.239.4]: 550 5.1.0 <bounce+0f28da.2db60-info=example.com@example.com>: Sender address rejected: User unknown; from=<bounce+0f28da.2db60-info=example.com@example.com> to=<info@example.com> proto=ESMTP helo=<m239-4.eu.mailgun.net>

Mailgun reports:

5.1.0 <bounce+0f28da.2db60-info=example.com@example.com>: Sender address rejected: User unknown

Now I understand this is a default security setting, as this could well be a forged email. However I need this functionality.

What is the best way for iRedMail to accept the emails sent from an external service like Mailgun even if the domain and account exist?

Thanks in advance!

----

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

2

Re: Proper way to accept email from outside servers for local account

this can be done with iredapd:

https://docs.iredmail.org/allow.certain … .user.html

you can add info@example.com here as allowed sender forgery, but be sure, this ONLY works for authenicated users! it wont work as an open relay, it still requires legit authentication

3 (edited by afonic 2022-01-11 04:31:01)

Re: Proper way to accept email from outside servers for local account

Thanks for the reply. I tried that but it still bounces the email.

It's also mentioned here: https://docs.iredmail.org/errors.html#r … der-domain
(my situation is like n.3 in that list)

I've even tried with both settings:

ALLOWED_FORGED_SENDERS = ['info@example.com']
ALLOWED_LOGIN_MISMATCH_SENDERS = ['info@example.com']

I read in another post that I should disable:

smtpd_reject_unlisted_sender = yes

but I fear that this will put my other server users into unnecessary risk.

4

Re: Proper way to accept email from outside servers for local account

why does the shop use srs at all?

5

Re: Proper way to accept email from outside servers for local account

That I don't know, I guess I need to reach out to Mailgun and ask?