Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse

Cloudron Forum

Apps | Demo | Docs | Install

WP Multi-site mail issues

Scheduled Pinned Locked Moved WordPress (Developer)
10 Posts 5 Posters 425 Views
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    moonmeister
    wrote on last edited by
    #1

    When I created a second site on my WP Multi-site setup it had no SMTP config in the new mail plugin(SMTP Mailer). I tried to configure it by copy paste but short of opening up the db or retrieving it from the env var via copy paste I had no way of accessing the SMTP password. Meaning if it ever changed mail would not send. I tried to see if I could setup the config globally but an old discussion confirmed it wasn't possible.

    I switched back to WP Mail SMTP and saw it couldn't be configured via the Network UI without the PRO version. But after some digging I confirmed Setting the config via wp_config.php variables works just fine.

    
    define( 'WPMS_ON', true ); // True turns on the whole constants support and usage, false turns it off.
    
    define( 'WPMS_MAIL_FROM', getenv('CLOUDRON_MAIL_FROM') );
    define( 'WPMS_MAIL_FROM_FORCE', true ); // True turns it on, false turns it off.
    //define( 'WPMS_MAIL_FROM_NAME', 'From Name' );
    define( 'WPMS_MAIL_FROM_NAME_FORCE', true ); // True turns it on, false turns it off.
    define( 'WPMS_MAILER', 'smtp' ); // Possible values: 'mail', 'smtpcom', 'sendinblue', 'mailgun', 'sendgrid', 'gmail', 'smtp'.
    define( 'WPMS_SET_RETURN_PATH', true ); // Sets $phpmailer->Sender if true, relevant only for Other SMTP mailer.
    
    define( 'WPMS_SMTP_HOST', getenv('CLOUDRON_MAIL_SMTP_SERVER')); // The SMTP mail host.
    define( 'WPMS_SMTP_PORT', getenv('CLOUDRON_MAIL_SMTP_PORT') ); // The SMTP server port number.
    define( 'WPMS_SSL', '' ); // Possible values '', 'ssl', 'tls' - note TLS is not STARTTLS.
    define( 'WPMS_SMTP_AUTH', true ); // True turns it on, false turns it off.
    define( 'WPMS_SMTP_USER', getenv('CLOUDRON_MAIL_SMTP_USERNAME') ); // SMTP authentication username, only used if WPMS_SMTP_AUTH is true.
    define( 'WPMS_SMTP_PASS', getenv('CLOUDRON_MAIL_SMTP_PASSWORD') ); // SMTP authentication password, only used if WPMS_SMTP_AUTH is true.
    define( 'WPMS_SMTP_AUTOTLS', true ); // True turns it on, false turns it off.
    

    This config means everything is configured across all sites in the install and each site can individually set the"From Name".

    This seems like a much better default for the multi-site setup. The only thing that's not ideal is it'd be nice to be able to allow sending from different from address, including different domains configured in cloudron. username and password doesn't have to change but allowing different from address would be nice.

    @girish Just read why you switched the plugin to SMTP Mailer...is there a solution I haven't found that can be used with that plugin?

    girishG 1 Reply Last reply
    1
  • girishG Offline
    girishG Offline
    girish Staff
    replied to moonmeister on last edited by
    #2

    @moonmeister Oh, I wasn't aware of this limitation of that plugin. I replaced the email plugin before we enabled multi-site. Maybe, we have to use some other friendlier plugin in multi-site mode. Let me check.

    M 1 Reply Last reply
    1
  • M Offline
    M Offline
    moonmeister
    replied to girish on last edited by
    #3

    @girish Thanks

    girishG 1 Reply Last reply
    0
  • girishG Offline
    girishG Offline
    girish Staff
    replied to moonmeister on last edited by
    #4

    @moonmeister I looked into this more closely and found some issues in the package. It seems all the plugins need to be network activated (like redis/ldap). And also, mail plugin probably has to auto-configured for all the sites. I will make the changes.

    scookeS 1 Reply Last reply
    3
  • scookeS Offline
    scookeS Offline
    scooke
    replied to girish on last edited by
    #5

    @girish Are you sure that auto-activating all plugins is the best thing? From what I recall from my own install, plugins can be installed "centrally", but it is best to activate each per site. This is something the user needs to learn about, and do.
    Or are you talking about enabling the ability to active plugins for all sites?

    A life lived in fear is a life half-lived

    girishG 1 Reply Last reply
    1
  • girishG Offline
    girishG Offline
    girish Staff
    replied to scooke on last edited by
    #6

    @scooke Good question. Don't you think plugins like LDAP and Redis should be network activated when multi-site mode is enabled? Thing is the package needs to be have some logic to configure plugins in multi-site mode (i.e one has to loop through all the sites and set the LDAP configuration).

    C 1 Reply Last reply
    0
  • C Offline
    C Offline
    ccfu
    replied to girish on last edited by ccfu
    #7

    @girish
    In my opinion it should be up to the network admin to decide which plugins to activate network-wide. The two you mentioned I would see as exceptions though. Email in particular needs to be configurable on a per-subsite basis.

    Incidentally, I personally prefer this plugin for mail: https://postmansmtp.com/

    girishG 1 Reply Last reply
    1
  • girishG Offline
    girishG Offline
    girish Staff
    replied to ccfu on last edited by
    #8

    @ccfu Yes, that's the plan. Only the ldap and redis plugin are network activated. Nothing else. For LDAP, if you don't want it, you can of course just opt out of cloudron user management at install time.

    As for email, in the next release (of Cloudron), you can opt out of email configuration as well.

    1 Reply Last reply
    2
  • D Offline
    D Offline
    derin
    wrote on last edited by
    #9

    What if you placed them as MU-plugins?

    1 Reply Last reply
    0
  • girishG Offline
    girishG Offline
    girish Staff
    wrote on last edited by
    #10

    I have tried to fix this in the latest package - https://docs.cloudron.io/apps/wordpress-developer/#email-setup-multisite . I pushed the update last week but it's been rolling out slowly. A new install (which is required for multi-site) will get the latest package.

    1 Reply Last reply
    1

  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Login

  • Don't have an account? Register

  • Login or register to search.