I am moving an app to a new server. Previously on pythonanywhere and could 
send email for password resets. So the email settings are correct.

New server is using docker. web2py + nginx

Trying to send email I am getting the following error: 
web2py:Mail.send failure:[SSL: WRONG_VERSION_NUMBER]

from googling it looks like this is often due to using the wrong port but I 
am using 465 which was working before.

Dockerfile:
FROM python:2.7

RUN apt update && \
 apt install -y  python-pip gcc python-dev libpq-dev && \
 pip install --upgrade pip && \
 pip install gunicorn && \
 pip install eventlet && \
 pip install psycopg2 && \
 pip install pillow

RUN addgroup act && useradd -rm -d /home/act -s /bin/bash -g act -G sudo -u 
1000 act

# USER act 

COPY ./web2py /home/act/web2py

WORKDIR /home/act/web2py

EXPOSE 80 465 # not sure if port 465 needs to be exposed

CMD gunicorn -b 0.0.0.0:80 -w 3 wsgihandler

.yml file:
version: '3'

services:

  adminer:
    image: adminer
    restart: always
    ports:
      - 8080:8080

  db:
    image: postgres:11 
    restart: always
    env_file:
        ./config/db/db_env
    expose:
        - 5432
    volumes:
      - db_volume:/var/lib/postgresql/data
      
  angebotstool:
    build: .
    volumes:
      - web2py_apps:/home/act/web2py/applications
    expose:
      - 80
      - 443
    ports:
      - 465:465 # not sure if this is correct / required
    environment:
      VIRTUAL_HOST: my.host.com
      LETSENCRYPT_HOST: my.host.com
      LETSENCRYPT_EMAIL: m...@email.com
    depends_on:
      - db

      
volumes:
    db_volume:
        driver: local
        driver_opts:
            type: 'none'
            o: 'bind'
            device: '/home/act/databases/'
    web2py_apps:
        driver: local
        driver_opts:
            type: 'none'
            o: 'bind'
            device: '/home/act/web2py-gunicorn/web2py/applications'
        
networks:
    default:
        external:
            name: nginx-proxy

nginx .yml file
version: '3'

services:
  nginx:
    image: nginx:1.13.1
    container_name: nginx-proxy
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - conf:/etc/nginx/conf.d
      - vhost:/etc/nginx/vhost.d
      - html:/usr/share/nginx/html
      - certs:/etc/nginx/certs
    labels:
      - "com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy=true"

  dockergen:
    image: jwilder/docker-gen:0.7.3
    container_name: nginx-proxy-gen
    depends_on:
      - nginx
    command: -notify-sighup nginx-proxy -watch -wait 5s:30s /etc/docker-gen/
templates/nginx.tmpl /etc/nginx/conf.d/default.conf
    volumes:
      - conf:/etc/nginx/conf.d
      - vhost:/etc/nginx/vhost.d
      - html:/usr/share/nginx/html
      - certs:/etc/nginx/certs
      - /var/run/docker.sock:/tmp/docker.sock:ro
      - ./nginx.tmpl:/etc/docker-gen/templates/nginx.tmpl:ro

  letsencrypt:
    image: jrcs/letsencrypt-nginx-proxy-companion
    container_name: nginx-proxy-le
    depends_on:
      - nginx
      - dockergen
    environment:
      NGINX_PROXY_CONTAINER: nginx-proxy
      NGINX_DOCKER_GEN_CONTAINER: nginx-proxy-gen
    volumes:
      - conf:/etc/nginx/conf.d
      - vhost:/etc/nginx/vhost.d
      - html:/usr/share/nginx/html
      - certs:/etc/nginx/certs
      - /var/run/docker.sock:/var/run/docker.sock:ro

volumes:
  conf:
  vhost:
  html:
  certs:

# Do not forget to 'docker network create nginx-proxy' before launch, and 
to add '--network nginx-proxy' to proxied containers. 

networks:
  default:
    external:
      name: nginx-proxy


What am I missing here?

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to