1

Topic: use iRedmail as relay for web server

==== Required information ====
- iRedMail version (check /etc/iredmail-release): 0.9.7 MARIADB edition.
- Linux/BSD distribution name and version: ubuntu 16,04
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): mysql
- Web server (Apache or Nginx):nginx
- Manage mail accounts with iRedAdmin-Pro? no
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

Hi,

I run iredmail to manage a handful of client domains and addresses. I also run a webserver where php sends out emails. Currently, the webserver has exim set up with dkim support etc. to send out emails directly from itself.

I'd like to transition to relaying all emails through my iredmail server, using it as a "smarthost", to simplify my management. I've tested this already, and it works ok after adding my webserver to "mynetworks", however it will only relay mail for addresses that actually exist on the system.

Is there a way to make iredmail/postfix relay all messages regardless of if the domain/address is present on the system?

Also, the messages being relayed didn't have the dkim signature appended by iredmail like other mail do sent through authenticated smtp. Can this be enabled too?

----

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

2

Re: use iRedmail as relay for web server

How about setup your web applications running on web server to send email from iRedMail server directly with SMTP authentication? This way all issues will be gone.

3 (edited by swiftoid 2018-01-28 17:22:46)

Re: use iRedmail as relay for web server

The server sends from a variety of domains and addresses including noreply. I was hoping to just be able to send all mail including from system accounts etc. via a relay and not have to create every an account for every combination and authenticate individually.

4

Re: use iRedmail as relay for web server

Do you own all these domains? if not, it's like sending spams.

swiftoid wrote:

however it will only relay mail for addresses that actually exist on the system.

What's the error message in Postfix log file on iRedMail server?

5

Re: use iRedmail as relay for web server

Jan 28 01:48:00 mail postfix/smtpd[2298]: NOQUEUE: reject: RCPT from WEBSERVER.com[2001:---:2aa3]: 550 5.1.0 <noreply@CLIENTDOMAIN.com>: Sender address rejected: User unknown in virtual mailbox table; from=<noreply@CLIENTDOMAIN.com> to=<TESTEMAIL@gmail.com> proto=ESMTP helo=<WEBSERVER.com>

6

Re: use iRedmail as relay for web server

Is "clientdomain.com" hosted on your iRedMail server?

7

Re: use iRedmail as relay for web server

Yes. It is configured as a domain, with a few mail boxes. But noreply is not a valid mailbox. I could just create it, but there are many other use cases. For example, what if a cronjob or other process on WEBSERVER.com needs to send out an email. I don't want to have to create a mailbox for every system account from WEBSERVER.com on MAILSERVER.com. I'd prefer if I could configure iredmail to just assume that any email sent from the ip of webserver.com is allowed, add a dkim header to it (from the catch-all dkim setup already in place) and then send it.

8

Re: use iRedmail as relay for web server

Got any ideas?

9

Re: use iRedmail as relay for web server

My solution is to use the ssmtp package to send emails from other servers via the iRedmail server.
And if I send emails from websites, I do with with port 587 (submission) and auth to an account that I have added to the allowed_login_mismatch_senders in /opt/iredapd/settings.py


ALLOWED_LOGIN_MISMATCH_SENDERS = ['admin@domain.se','admin@somedomain.com']

10

Re: use iRedmail as relay for web server

Interesting. Would I be able to get exim to log in that way for relaying all mail? I think I saw a passwd.client file in the exam config.