1

Topic: Sending mail from laravel via iRedMail

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 1.2.1 MARIADB edition.
- Deployed with iRedMail Easy or the downloadable installer? No
- Linux/BSD distribution name and version: Ubuntu 18.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.
====

Hello,

I have set up my iredmail server at mail.rys.com (in this example ip 45.65.36.114). i have a website running laravel at rys.com. i also have installed let's encrypt - with separate instances on each server. i am able to send emails and add accounts fine via the provided email programs, but i need laravel to generate these and have had difficulty getting this to validate

i reviewed the post below and have i have tried a number of examples but have not had success. i haven't changed anything on the iredmail side and i can send mail from the admin@rys.com account but not via laravel

any help would be greatly appreciated.

Regards,

Peter

https://forum.iredmail.org/topic13658-a … dmail.html

Config:
MAIL_DRIVER=smtp
MAIL_HOST=45.65.36.114
MAIL_PORT=587
MAIL_USERNAME=admin
MAIL_PASSWORD=xxxxx
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS=admin@rys.com
MAIL_FROM_NAME="admin@rys.com"


Result:
Swift_TransportException (530)
Expected response code 250 but got code "530", with message "530 5.7.0 Must issue a STARTTLS command first "



Config:
MAIL_DRIVER=smtp
MAIL_HOST=45.65.36.114
MAIL_PORT=587
MAIL_USERNAME=admin
MAIL_PASSWORD=xxxxx
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS=admin@rys.com
MAIL_FROM_NAME="admin@rys.com"



Result:
stream_socket_enable_crypto(): Peer certificate CN=`mail.rys.com' did not match expected CN=`45.65.36.114'


Config:
MAIL_DRIVER=sendmail
MAIL_HOST=45.65.36.114
MAIL_PORT=587
MAIL_USERNAME=admin
MAIL_PASSWORD=xxxxx
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS=admin@rys.com
MAIL_FROM_NAME="admin@rys.com"

Result:
Swift_TransportException
Expected response code 220 but got an empty response

Config:
MAIL_DRIVER=smtp
MAIL_HOST=45.65.36.114
MAIL_PORT=80
MAIL_USERNAME=admin
MAIL_PASSWORD=xxxxx
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS=admin@rys.com
MAIL_FROM_NAME="admin@rys.com"
Result:
Connection to 45.65.36.114:80 Timed Out

----

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

2

Re: Sending mail from laravel via iRedMail

petro1979 wrote:

stream_socket_enable_crypto(): Peer certificate CN=`mail.rys.com' did not match expected CN=`45.65.36.114'

Your Postfix is using a self-signed(?) ssl cert, but your Laravel smtp library is trying to verify the cert.
Possible solutions:

- Get yourself a free let's encrypt cert and configure Postfix (and Dovecot/Nginx) to use it.
- Configure your Laravel code not to verify the cert.

3

Re: Sending mail from laravel via iRedMail

In addition to Zhang's suggestion, shouldn't this also be the full email address?

MAIL_USERNAME=admin@domain.tld

4

Re: Sending mail from laravel via iRedMail

right now i have let's encrypt installed on both servers, however they do not have the same key (i'm assuming as that wasn't part of any of the instructions in setting it up). is this security a requirement or is there a setting within iredmail that i could pass to bypass it.

thanks!

5

Re: Sending mail from laravel via iRedMail

Have you received your certificate from LetsEncrypt AND linked it to the iRedMail default path? because I don't see that LetsEncrypt cert on either rys.com or mail.rys.com.
In fact I'm not seeing iredmail on either of those 2 sites, seems to be some other mail platform?


https://docs.iredmail.org/letsencrypt.h … mbol-links

6

Re: Sending mail from laravel via iRedMail

I do appreciate the help. I was able to find an answer that works for me as the below was not part of laravel mail config provided. Adding that got it working. Thank you iredmail support. good product!


'stream' => [
   'ssl' => [
      'allow_self_signed' => true,
      'verify_peer' => false,
      'verify_peer_name' => false,
   ],
],