Set up mail
  • Someone has already managed to configure Superdesk to send e-mail, because it's been 30 days since I'm having trouble creating USERS in Superdesck, because I could not configure the emial server

    Additional Information
    Web server; Nginx
    Email server: postfix

    I look forward to who can help me
  • 12 Comments sorted by
  • Have you managed to set up your email?

    I will appreciate some help if you did.

    I have the same issue. 
  • Hi Ioannis,

    Please make sure you have setup the right values for the following env vars in your installation



    Best,

  • Vote Up0Vote Down ChuxChux
    Posts: 11Member
    Hi Ioannis,

    Please make sure you have setup the right values for the following env vars in your installation



    Best,



    The problem is that it's not obvious where the mail settings should go.  There is no config directories in /etc (not in init.d, not in /etc/default .. no /etc/superdesk, etc )

    I used the auto-install via the shell script, and the only places I camn see the mail settings can go are:
    • /opt/superdesk/docker/common.yml
    • /opt/superdesk/env/lib/python3.6/site-packages/flask_mail.py 
    • /opt/superdesk/env/lib/python3.6/site-packages/superdesk/default_settings.py
    Since I am not running on docker, I guess the first option is ruled out .. so, which of the other two should I use for settings?

    Or perhaps there is another way ?

    Ideally, there should be a known central config file .. 
  • Hi Ioannis,


    Please make sure you have setup the right values for the following env vars in your installation



    Best,



    Should i install Postfix or just setup these values in my installation?
  • Hi Chux,

    Those are env vars as I mentioned in my original email, you can set them up in your system environment. If you don't know how to work with env vars, have a look here https://help.ubuntu.com/community/EnvironmentVariables

    These settings live in the following config file https://github.com/superdesk/superdesk-core/blob/master/superdesk/default_settings.py ... but that's the place where default values are defined, so you shouldn't edit this file, instead, you can override it by creating a settings.py in your installation, place it under the same directory where default_settings.py is located, and add to it the settings you need to define.

    However, the first method is preferred in many cases, it is a good practice to define those settings at the system level.

    Hope this helps.


    Best,

  • Hi Ioannis,

    You must have an email server Superdesk can use, it can be Postfix or any other. The env vars are just to provide Superdesk with the connection data to the email server so that Superdesk can make use of it.


    Best,

  • Hi Ioannis,


    You must have an email server Superdesk can use, it can be Postfix or any other. The env vars are just to provide Superdesk with the connection data to the email server so that Superdesk can make use of it.


    Best,



    I have installed a Postfix server. I tested it and it sends emails.
    I have set the user and password on the /opt/superdesk/env.sh file but when i try to reset a password on a created user i don't get an email.

    Is there a log file i should search?
  • Hi Ioannis,


    You must have an email server Superdesk can use, it can be Postfix or any other. The env vars are just to provide Superdesk with the connection data to the email server so that Superdesk can make use of it.


    Best,



    Haven't applied this yet, but thanks a million.  This certainly does help a lot.

    The default settings file also includes comments describing the purpose for the respective env settings.
  • Im totally new on setting up servers and working in Ubuntu. I have the same problem that I can´t set up new users as they don´t get their confirmation token. Superdesk is on a VPS installation. I spend around 5 hours googeling and reading a lot of documentations for example the ones linked above. I understand that I need to have a mailserver and I understand how that work. I tried to figure out how Flask works but as Im a totally newbie on servers and Ubuntu I got more and more confused and around midnight I gave up.

    So i wonder if someone could give some simple hand on instructions on how to setup the mailserver on Superdesk on a VPS.

    Thanks

    Carl
  • Ioannis said:

    Hi Ioannis,


    You must have an email server Superdesk can use, it can be Postfix or any other. The env vars are just to provide Superdesk with the connection data to the email server so that Superdesk can make use of it.


    Best,



    I have installed a Postfix server. I tested it and it sends emails.
    I have set the user and password on the /opt/superdesk/env.sh file but when i try to reset a password on a created user i don't get an email.

    Is there a log file i should search?


    From what I have understood, even as you have already setup your mail server and it works, it's likely that Superdesk itself is not reading your env vars, and is thus unaware of your definitions in your env.sh and is still using the default settings.

    If you on an ubuntu or debian based system, then the best place to define your system level env variables is in /etc/environment .. ideally, reboot your system afterwards to ensure all processes see the new variables you have defined.

    Something else to be aware of is that the default values send emails to a directory you can access by going to http://superdesk-fqdn/mail .. so, you could perhaps go there to check for emails being sent out by the system.
  • Im totally new on setting up servers and working in Ubuntu. I have the same problem that I can´t set up new users as they don´t get their confirmation token. Superdesk is on a VPS installation. I spend around 5 hours googeling and reading a lot of documentations for example the ones linked above. I understand that I need to have a mailserver and I understand how that work. I tried to figure out how Flask works but as Im a totally newbie on servers and Ubuntu I got more and more confused and around midnight I gave up.


    So i wonder if someone could give some simple hand on instructions on how to setup the mailserver on Superdesk on a VPS.

    Thanks

    Carl


    You don't need to know how flask works.  Just have a mailserver that works (whether on the same local server) or remote.  You can even setup a gmail account to send out your emails, and as long as you supply the correct env variables to logon and send out emails (and your firewall(s) allow sending out emails), then it should work.

    Since you are running ubuntu, define the correct mail variables in /etc/environment, and reboot and it should work.

    The important mail variables are indicated below 

    For example to use a gmail account .. 


    # assuming your gmail account is somegai@gmail.com (and you are using tls)

    #  for TLS: set MAIL_PORT=587, MAIL_USE_TLS=True and MAIL_USE_SSL=False

    # for SSL: set MAIL_PORT=465, MAIL_USE_TLS=False and MAIL_USE_SSL=True


    # settings in /etc/envirnment

    MAIL_SERVER='smtp.gmail.com'

    MAIL_PORT=587

    MAIL_USE_TLS=True

    MAIL_USE_SSL=False

    MAIL_USERNAME='somegai@gmail.com'

    MAIL_PASSWORD='your-gmail-password' # or configured app password if using 2-factor auth 

    MAIL_DEFAULT_SENDER='somegai@gmail.com'

    ADMINS=['user1','user2'] # this is not so important to setup for starters


    Just read up Gmail guide on setting up an imap mail client like thunderbird .. or setup thunderbird to read your gmail, and then copy the settings from thunderbird and add them to /etc/environment 













    Post edited by Chux at 2018-09-05 18:38:34
  • Thanks Chux.

    I found help on freelancer to set up the superdesk- and publisher-servers. I will ask him to setup the email server according to your instructions otherwise I may have to reach out here for help.

    There is now one superdesk server installed but I can't create users as the mail server isn´t installed. I also noticed that I can't create a "Desk" as there is nothing in the Desk type dropdown. And without a Desk I can't submit to publisher server.

    The publisher server is up and running and there is one web template created.

    We are going to use the superdesk and publisher for evaluation for a news project we are planning to start early 2019. I'm pretty sure that superdesk provide everything we need, but I can listen from my partners in the project that they hasn´t bought in on Superdesk yet. I really look forward to have a working test environment to show them how easy the workflow would be.

    //Carl