1

Topic: Configure another server to send mail

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

Hi,

I've just installed iRedMail on a fresh install ubuntu, mail working perfect and i was able to login to my e-mails from my laptop on Thunder Baird.

The thing is i have another fresh server (ubuntu 16.04 LTS) with LAMP insalled on it, but i can't make web apps send mail (like WordPress), from what i  understand i need to install postfix to send mails. i tried configure postfix to work with my first server (iRedMail server one) but no luck.

I'm i walking in the right path? or i'm missing something here?

Thanks!

----

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

2

Re: Configure another server to send mail

ve3lst wrote:

I'm i walking in the right path?

Wrong.

Just configure your web application to use correct smtp server address (your iRedMail server), smtp port number (587), secure connection type (TLS, or STARTTLS), and a mail user and password.

3 (edited by ve3lst 2017-08-28 19:07:59)

Re: Configure another server to send mail

Thank you for your replay. i wasn't able to work on my server until today.

So i tried configure SMTP in WP using 2 plugins neither worked, both have a problem connecting to the SMTP server.

one plugin error output:

Test Message Sent
The result was:
bool(false)
The full debugging output is shown below:
object(PHPMailer)#583 (76) {
  ["Version"]=>
  string(6) "5.2.22"
  ["Priority"]=>
  NULL
  ["CharSet"]=>
  string(5) "UTF-8"
  ["ContentType"]=>
  string(10) "text/plain"
  ["Encoding"]=>
  string(4) "7bit"
  ["ErrorInfo"]=>
  string(43) "SMTP Error: Could not connect to SMTP host."
  ["From"]=>
  string(18) "postmaster@mail.ve"
  ["FromName"]=>
  string(10) "TSUN Sites"
  ["Sender"]=>
  string(0) ""
  ["ReturnPath"]=>
  string(0) ""
  ["Subject"]=>
  string(46) "WP Email SMTP: Test mail to postmaster@mail.ve"
  ["Body"]=>
  string(69) "This is a test email generated by the WP Email SMTP WordPress plugin."
  ["AltBody"]=>
  string(0) ""
  ["Ical"]=>
  string(0) ""
  ["MIMEBody":protected]=>
  string(70) "This is a test email generated by the WP Email SMTP WordPress plugin.
"
  ["MIMEHeader":protected]=>
  string(338) "Date: Mon, 28 Aug 2017 11:06:42 +0000
To: postmaster@mail.ve
From: TSUN Sites 
Subject: WP Email SMTP: Test mail to postmaster@mail.ve
Message-ID: <623bb5425cdc8c6a3586538c011738b2@sites.ve>
X-Mailer: PHPMailer 5.2.22 (https://github.com/PHPMailer/PHPMailer)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8

"
  ["mailHeader":protected]=>
  string(0) ""
  ["WordWrap"]=>
  int(0)
  ["Mailer"]=>
  string(4) "smtp"
  ["Sendmail"]=>
  string(18) "/usr/sbin/sendmail"
  ["UseSendmailOptions"]=>
  bool(true)
  ["PluginDir"]=>
  string(0) ""
  ["ConfirmReadingTo"]=>
  string(0) ""
  ["Hostname"]=>
  string(0) ""
  ["MessageID"]=>
  string(0) ""
  ["MessageDate"]=>
  string(31) "Mon, 28 Aug 2017 11:06:42 +0000"
  ["Host"]=>
  string(7) "mail.ve"
  ["Port"]=>
  string(3) "587"
  ["Helo"]=>
  string(0) ""
  ["SMTPSecure"]=>
  string(3) "tls"
  ["SMTPAutoTLS"]=>
  bool(true)
  ["SMTPAuth"]=>
  bool(false)
  ["SMTPOptions"]=>
  array(0) {
  }
  ["Username"]=>
  string(0) ""
  ["Password"]=>
  string(0) ""
  ["AuthType"]=>
  string(0) ""
  ["Realm"]=>
  string(0) ""
  ["Workstation"]=>
  string(0) ""
  ["Timeout"]=>
  int(300)
  ["SMTPDebug"]=>
  bool(true)
  ["Debugoutput"]=>
  string(4) "echo"
  ["SMTPKeepAlive"]=>
  bool(false)
  ["SingleTo"]=>
  bool(false)
  ["SingleToArray"]=>
  array(0) {
  }
  ["do_verp"]=>
  bool(false)
  ["AllowEmpty"]=>
  bool(false)
  ["LE"]=>
  string(1) "
"
  ["DKIM_selector"]=>
  string(0) ""
  ["DKIM_identity"]=>
  string(0) ""
  ["DKIM_passphrase"]=>
  string(0) ""
  ["DKIM_domain"]=>
  string(0) ""
  ["DKIM_private"]=>
  string(0) ""
  ["DKIM_private_string"]=>
  string(0) ""
  ["action_function"]=>
  string(0) ""
  ["XMailer"]=>
  string(0) ""
  ["smtp":protected]=>
  object(SMTP)#679 (14) {
    ["Version"]=>
    string(6) "5.2.22"
    ["SMTP_PORT"]=>
    int(25)
    ["CRLF"]=>
    string(2) "
"
    ["do_debug"]=>
    bool(true)
    ["Debugoutput"]=>
    string(4) "echo"
    ["do_verp"]=>
    bool(false)
    ["Timeout"]=>
    int(300)
    ["Timelimit"]=>
    int(300)
    ["smtp_transaction_id_patterns":protected]=>
    array(3) {
      ["exim"]=>
      string(21) "/[0-9]{3} OK id=(.*)/"
      ["sendmail"]=>
      string(29) "/[0-9]{3} 2.0.0 (.*) Message/"
      ["postfix"]=>
      string(35) "/[0-9]{3} 2.0.0 Ok: queued as (.*)/"
    }
    ["smtp_conn":protected]=>
    NULL
    ["error":protected]=>
    array(4) {
      ["error"]=>
      string(0) ""
      ["detail"]=>
      string(0) ""
      ["smtp_code"]=>
      string(0) ""
      ["smtp_code_ex"]=>
      string(0) ""
    }
    ["helo_rply":protected]=>
    NULL
    ["server_caps":protected]=>
    NULL
    ["last_reply":protected]=>
    string(347) "MIA2t�h`H���
�����k7`"��ŧ��v�A���?��Ձf\�F^�&Z��@lz��/�b�d�ئ�a�:�NU-���W(��K!Y%����S�������Q���(EڍL    Z�J���A�LN}�^�=#8�7V��mM�n�n0Ga��q���n-�b�}$�/
��n~2ؙ���yN=J��V�+r@kg�Ջ_�K��~��([ Z���P���-@&��Ь'}��������Z�� ���U:��;�n�F}�MH��ڥo�I����bz��$x���1Ҿops�J���P�`h��"
  }
  ["to":protected]=>
  array(1) {
    [0]=>
    array(2) {
      [0]=>
      string(18) "postmaster@mail.ve"
      [1]=>
      string(0) ""
    }
  }
  ["cc":protected]=>
  array(0) {
  }
  ["bcc":protected]=>
  array(0) {
  }
  ["ReplyTo":protected]=>
  array(0) {
  }
  ["all_recipients":protected]=>
  array(1) {
    ["postmaster@mail.ve"]=>
    bool(true)
  }
  ["RecipientsQueue":protected]=>
  array(0) {
  }
  ["ReplyToQueue":protected]=>
  array(0) {
  }
  ["attachment":protected]=>
  array(0) {
  }
  ["CustomHeader":protected]=>
  array(0) {
  }
  ["lastMessageID":protected]=>
  string(43) "<623bb5425cdc8c6a3586538c011738b2@sites.ve>"
  ["message_type":protected]=>
  string(5) "plain"
  ["boundary":protected]=>
  array(3) {
    [1]=>
    string(35) "b1_623bb5425cdc8c6a3586538c011738b2"
    [2]=>
    string(35) "b2_623bb5425cdc8c6a3586538c011738b2"
    [3]=>
    string(35) "b3_623bb5425cdc8c6a3586538c011738b2"
  }
  ["language":protected]=>
  array(19) {
    ["authenticate"]=>
    string(35) "SMTP Error: Could not authenticate."
    ["connect_host"]=>
    string(43) "SMTP Error: Could not connect to SMTP host."
    ["data_not_accepted"]=>
    string(30) "SMTP Error: data not accepted."
    ["empty_message"]=>
    string(18) "Message body empty"
    ["encoding"]=>
    string(18) "Unknown encoding: "
    ["execute"]=>
    string(19) "Could not execute: "
    ["file_access"]=>
    string(23) "Could not access file: "
    ["file_open"]=>
    string(33) "File Error: Could not open file: "
    ["from_failed"]=>
    string(35) "The following From address failed: "
    ["instantiate"]=>
    string(36) "Could not instantiate mail function."
    ["invalid_address"]=>
    string(17) "Invalid address: "
    ["mailer_not_supported"]=>
    string(25) " mailer is not supported."
    ["provide_address"]=>
    string(54) "You must provide at least one recipient email address."
    ["recipients_failed"]=>
    string(45) "SMTP Error: The following recipients failed: "
    ["signing"]=>
    string(15) "Signing Error: "
    ["smtp_connect_failed"]=>
    string(22) "SMTP connect() failed."
    ["smtp_error"]=>
    string(19) "SMTP server error: "
    ["variable_set"]=>
    string(30) "Cannot set or reset variable: "
    ["extension_missing"]=>
    string(19) "Extension missing: "
  }
  ["error_count":protected]=>
  int(2)
  ["sign_cert_file":protected]=>
  string(0) ""
  ["sign_key_file":protected]=>
  string(0) ""
  ["sign_extracerts_file":protected]=>
  string(0) ""
  ["sign_key_pass":protected]=>
  string(0) ""
  ["exceptions":protected]=>
  bool(true)
  ["uniqueid":protected]=>
  string(32) "623bb5425cdc8c6a3586538c011738b2"
}
The SMTP debugging output is shown below:
2017-08-28 11:06:42    Connection: opening to mail.ve:587, timeout=300, options=array (
                                         )
2017-08-28 11:06:42    Connection: opened
2017-08-28 11:06:52    SMTP -> get_lines(): $data is ""
2017-08-28 11:06:52    SMTP -> get_lines(): $str is  "220 m.mail.ve ESMTP Postfix
                                         "
2017-08-28 11:06:52    SERVER -> CLIENT: 220 m.mail.ve ESMTP Postfix
2017-08-28 11:06:52    CLIENT -> SERVER: EHLO sites.ve
2017-08-28 11:06:52    SMTP -> get_lines(): $data is ""
2017-08-28 11:06:52    SMTP -> get_lines(): $str is  "250-m.mail.ve
                                         "
2017-08-28 11:06:52    SMTP -> get_lines(): $data is "250-m.mail.ve
                                         "
2017-08-28 11:06:52    SMTP -> get_lines(): $str is  "250-PIPELINING
                                         "
2017-08-28 11:06:52    SMTP -> get_lines(): $data is "250-m.mail.ve
                                         250-PIPELINING
                                         "
2017-08-28 11:06:52    SMTP -> get_lines(): $str is  "250-SIZE 15728640
                                         "
2017-08-28 11:06:52    SMTP -> get_lines(): $data is "250-m.mail.ve
                                         250-PIPELINING
                                         250-SIZE 15728640
                                         "
2017-08-28 11:06:52    SMTP -> get_lines(): $str is  "250-ETRN
                                         "
2017-08-28 11:06:52    SMTP -> get_lines(): $data is "250-m.mail.ve
                                         250-PIPELINING
                                         250-SIZE 15728640
                                         250-ETRN
                                         "
2017-08-28 11:06:52    SMTP -> get_lines(): $str is  "250-STARTTLS
                                         "
2017-08-28 11:06:52    SMTP -> get_lines(): $data is "250-m.mail.ve
                                         250-PIPELINING
                                         250-SIZE 15728640
                                         250-ETRN
                                         250-STARTTLS
                                         "
2017-08-28 11:06:52    SMTP -> get_lines(): $str is  "250-ENHANCEDSTATUSCODES
                                         "
2017-08-28 11:06:52    SMTP -> get_lines(): $data is "250-m.mail.ve
                                         250-PIPELINING
                                         250-SIZE 15728640
                                         250-ETRN
                                         250-STARTTLS
                                         250-ENHANCEDSTATUSCODES
                                         "
2017-08-28 11:06:52    SMTP -> get_lines(): $str is  "250-8BITMIME
                                         "
2017-08-28 11:06:52    SMTP -> get_lines(): $data is "250-m.mail.ve
                                         250-PIPELINING
                                         250-SIZE 15728640
                                         250-ETRN
                                         250-STARTTLS
                                         250-ENHANCEDSTATUSCODES
                                         250-8BITMIME
                                         "
2017-08-28 11:06:52    SMTP -> get_lines(): $str is  "250-DSN
                                         "
2017-08-28 11:06:52    SMTP -> get_lines(): $data is "250-m.mail.ve
                                         250-PIPELINING
                                         250-SIZE 15728640
                                         250-ETRN
                                         250-STARTTLS
                                         250-ENHANCEDSTATUSCODES
                                         250-8BITMIME
                                         250-DSN
                                         "
2017-08-28 11:06:52    SMTP -> get_lines(): $str is  "250 SMTPUTF8
                                         "
2017-08-28 11:06:52    SERVER -> CLIENT: 250-m.mail.ve
                                         250-PIPELINING
                                         250-SIZE 15728640
                                         250-ETRN
                                         250-STARTTLS
                                         250-ENHANCEDSTATUSCODES
                                         250-8BITMIME
                                         250-DSN
                                         250 SMTPUTF8
2017-08-28 11:06:52    CLIENT -> SERVER: STARTTLS
2017-08-28 11:06:52    SMTP -> get_lines(): $data is ""
2017-08-28 11:06:52    SMTP -> get_lines(): $str is  "220 2.0.0 Ready to start TLS
                                         "
2017-08-28 11:06:52    SERVER -> CLIENT: 220 2.0.0 Ready to start TLS
2017-08-28 11:06:52    SMTP Error: Could not connect to SMTP host.
2017-08-28 11:06:52    CLIENT -> SERVER: QUIT
2017-08-28 11:06:52    SMTP -> get_lines(): $data is ""
2017-08-28 11:06:52    SMTP -> get_lines(): $str is  "MIA2t�h`H���
                                         �����k7`"��ŧ��v�A���?��Ձf\�F^�&Z��@lz��/�b�d�ئ�a�:�NU-���W(��K!Y%����S�������Q���(EڍL    Z�J���A�LN}�^�=#8�7V��mM�n�n0Ga��q���n-�b�}$�/
                                         ��n~2ؙ���yN=J��V�+r@kg�Ջ_�K��~��([ Z���P���-@&��Ь'}��������Z�� ���U:��;�n�F}�MH��ڥo�I����bz��$x���1Ҿops�J���P�`h��"
2017-08-28 11:06:52    SERVER -> CLIENT: MIA2t�h`H���
                                         �����k7`"��ŧ��v�A���?��Ձf\�F^�&Z��@lz��/�b�d�ئ�a�:�NU-���W(��K!Y%����S�������Q���(EڍL    Z�J���A�LN}�^�=#8�7V��mM�n�n0Ga��q���n-�b�}$�/
                                         ��n~2ؙ���yN=J��V�+r@kg�Ջ_�K��~��([ Z���P���-@&��Ь'}��������Z�� ���U:��;�n�F}�MH��ڥo�I����bz��$x���1Ҿops�J���P�`h��
2017-08-28 11:06:52    SMTP ERROR: QUIT command failed: MIA2t�h`H���
                                         �����k7`"��ŧ��v�A���?��Ձf\�F^�&Z��@lz��/�b�d�ئ�a�:�NU-���W(��K!Y%����S�������Q���(EڍL    Z�J���A�LN}�^�=#8�7V��mM�n�n0Ga��q���n-�b�}$�/
                                         ��n~2ؙ���yN=J��V�+r@kg�Ջ_�K��~��([ Z���P���-@&��Ь'}��������Z�� ���U:��;�n�F}�MH��ڥo�I����bz��$x���1Ҿops�J���P�`h��
2017-08-28 11:06:52    Connection: closed
2017-08-28 11:06:52    SMTP Error: Could not connect to SMTP host.

the settings i used is:


From Email: postmaster@mail.ve
Mailer: Send all WordPress emails via SMTP.
SMTP Options

These options only apply if you have chosen to send mail by SMTP above.
Host: mail.ve
Port: 587
Encryption: Use TLS encryption. This is not the same as STARTTLS. For most servers SSL is the recommended option.
Authentication: Yes: Use SMTP authentication.
Username: postmaster (i also tried postmaster@mail.ve)
Password: mypassword

------

Thunder Bird settings
thunderbird bbcode test

please note that mail.ve is on my local DNS server and i can connect to it from the webserver (WP's server) using thunderbird and via web browser.

also i remember when i had only one server, i installed WP with iRedMail Server on the same machine and email worked without configuring anything.

Thank you