wiki:emailserver

Setting up an email server

  • an email server is needed to support email in genapp html5 instances.
  • you can set it up yourself or use an existing smtp server.
  • you will need to add email addresses specific to each app's appconfig.json.
  • if you have an available smtp server, you can configure it directly in appconfig.json under the "smtp" tag
    • N.B. just leave off the smtp tag if sendmail is working on your host server

installing postfix

  • we generally use postfix for a mail server on web servers
    • Ubuntu : $ sudo apt-get -y install postfix
    • CentOS/RedHat : $ sudo yum -y install postfix
  • then we edit /etc/postfix/main.cf to allow only the local server to send email
    inet_interfaces = loopback-only
    
  • then $ sudo service postfix restart

testing email

  • to make sure email is working
    $ cd /opt/genapp/genapptest/output/html5/util
    $ php test_mail.php me@my-email.address
    
  • a good result will look something like
    from /opt/genapp/genapptest/appconfig.json:
    stdClass Object
    (
        [admin] => me@my-email.address,someone@their-email.address
        [feedback] => feedback@some-google-group-or-whatever, me@my-email.address
        [from] => 149.165.169.58
    )
    test message to emre@flash.net using sendmail
    send looks ok, now check the mail for me@my-email.address to make sure it went through
    
Last modified 5 years ago Last modified on Sep 15, 2016, 10:20:43 PM