We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 13306
    • 19 Posts
    Hi

    I have a problem with emails not sending from an add-on (Quip). I think this is tied more to the main system, so hopefully this is the right forum.

    I get a server error ’Sender Address Rejected: domain not found’, which I’d like to fix with an -f parameter for a valid from address. (I’m guessing there’s a PHP mail() somewhere). I had a quick grep through the add-on code, but I don’t really understand how add-ons work and I can’t find what I want.

    Could someone point me in the right direction? Maybe I’m missing a UI option in the system settings? I’m looking for the equiv to ’Registration E-mail From Address’, but for add-ons, or anywhere in the code where I can add a from address to emails sent by the system.

    Thanks in advance.


    I do apologise if this needs to be in an add-ons forum somewhere after all. Feel free to move it.
      • 3749
      • 24,544 Posts
      Try downloading and running the QuickEmail extra. It may give you information on what’s wrong.
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 13306
        • 19 Posts
        Thanks. I didn’t run it, but looking at the code helped. It turns out you set email options like this: set(modMail::MAIL_SENDER,’[email protected]’);

        This was an add-on problem and needs moving. Sorry!

        Here, anyway, an option was set to this: mail->set(modMail::MAIL_SENDER,’Quip’); and it needed to be this:
        mail->set(modMail::MAIL_SENDER,$emailFrom);
        ($emailFrom was set to this: xpdo->getOption(’quip.emailsFrom’,null,$this->xpdo->getOption(’emailsender’));). It looks like there was a UI setting after all, it just wasn’t used for the from address.

        I edited a file named quipthread.class.php, and I’m fixed. You could probably label this a server configuration problem. The sendmail ’from’ domain was getting set to my server’s hostname (cat /etc/hostname), which will be a valid domain name in a lot of cases, but isn’t in mine.

        Anyway, hopefully this will be useful to someone. It worked for me.

        Add-on PHP files were owned by my Apache daemon’s user, so I had to chown before I could edit.