Join the community today
Register Now

Wordpress wp-cli send emails from WP Admin address?!

Discussion in 'Blogs & CMS usage' started by neverminder, Apr 26, 2018.

  1. neverminder

    neverminder Member

    44
    3
    8
    Nov 23, 2017
    Ratings:
    +5
    Local Time:
    2:01 PM
    1.13.6
    10.0.33
    Hi Eva2000,

    Just noticed that Wordpress wp-cli installer and updater are sending notification emails from WP Admin address related to vhost. As my email server is on a different VPS, this behavior generates 550 smtp auth required errors.

    How can I solve this?
     
  2. eva2000

    eva2000 Administrator Staff Member

    41,102
    9,196
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,107
    Local Time:
    9:01 PM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    Wouldn't that be your email server smtp config issue ? wp-cli sent emails use Centmin Mod server's postfix MTA for outbound email and not the email addresses smtp server.

    Or do you mean you disabled Centmin Mod server's installed postfix MTA and are using a remote email smtp server on different VPS for all Centmin Mod server's outbound email sending ? Solution would be passing smtp login details and smtp server details to the mail sending command - but not sure how comfortable it would be in exposing your email address login details permanently on your server as they would need to be contained within wp-cli auto update cronjob file.
     
  3. neverminder

    neverminder Member

    44
    3
    8
    Nov 23, 2017
    Ratings:
    +5
    Local Time:
    2:01 PM
    1.13.6
    10.0.33
    Well, as long as the installer is trying to send emails from the WP admin email, I don't see how I can change this. For example, if the admin email address is [email protected], wp-cli will send notifications from [email protected]il.com to [email protected], all emails ending in junk folder.
     
  4. neverminder

    neverminder Member

    44
    3
    8
    Nov 23, 2017
    Ratings:
    +5
    Local Time:
    2:01 PM
    1.13.6
    10.0.33
    I'm not talking about wp-cli updater, where I can change the FROM email in config. This is about wp-cli installer.
     
  5. eva2000

    eva2000 Administrator Staff Member

    41,102
    9,196
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,107
    Local Time:
    9:01 PM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    oh i see from email can be changed easily, each centmin.sh menu option 22 wordpress auto installed vhost as a wp_updater script for auto updates at /root/tools/wp_updater_${vhostname}.sh where ${vhostname} = your domain.com name and there's 2 variables at top
    Code (Text):
    EMAIL=
    EMAILFROM=
    

    change the EMAILFROM variable :)
     
  6. eva2000

    eva2000 Administrator Staff Member

    41,102
    9,196
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,107
    Local Time:
    9:01 PM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    Ah that's hardcoded in Centmin Mod centmin.sh menu option 22 routine. I can make some code changes so you can override from email for that at persistent config file /etc/centminmod/custom_config.inc level so it overrides both wp-cli install and wp-cli updater scripts.
     
  7. neverminder

    neverminder Member

    44
    3
    8
    Nov 23, 2017
    Ratings:
    +5
    Local Time:
    2:01 PM
    1.13.6
    10.0.33
    IMHO, it would be better if, even hardcoded, that would be something like [email protected]${vhostname}, don't you think?
     
  8. eva2000

    eva2000 Administrator Staff Member

    41,102
    9,196
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,107
    Local Time:
    9:01 PM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    • Like Like x 1
  9. neverminder

    neverminder Member

    44
    3
    8
    Nov 23, 2017
    Ratings:
    +5
    Local Time:
    2:01 PM
    1.13.6
    10.0.33
    As usual, you rock! (y)
     
  10. neverminder

    neverminder Member

    44
    3
    8
    Nov 23, 2017
    Ratings:
    +5
    Local Time:
    2:01 PM
    1.13.6
    10.0.33
    The 550 error can also be solved on the email server by adding the centmin server IP (XXX.XXX.XXX.XXX) in exim.conf:
    Code:
    hostlist relay_from_hosts = 127.0.0.1 : XXX.XXX.XXX.XXX
     
    • Informative Informative x 1