Skip to content

Commit

Permalink
Merge pull request #238 from fixthestatusquo/chore/remove-reply-to
Browse files Browse the repository at this point in the history
Temporarily remove the reply-to option, can be abused
  • Loading branch information
tttp authored Feb 26, 2024
2 parents c79a8c0 + c391d0c commit c11807f
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 67 deletions.
129 changes: 64 additions & 65 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,79 +2,78 @@ name: Proca Server CI

on:
push:
branches: [ main ]
branches: [main]
pull_request:
branches: [ main ]
branches: [main]

jobs:
build:
name: Build and test
runs-on: ubuntu-latest
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v2
- name: Set up Elixir
uses: erlef/setup-elixir@885971a72ed1f9240973bd92ab57af8c1aa68f24
with:
elixir-version: '1.12.0' # Define the elixir version [required]
otp-version: '23.3.1' # Define the OTP version [required]
- name: Install and setup PostgreSQL with PostgreSQL extensions and unprivileged user
# You may pin to the exact commit or the version.
# uses: Daniel-Marynicz/postgresql-action@0dcc196f0ddffbdf095921877c6577132ab35756
uses: Daniel-Marynicz/[email protected]
with:
# Docker postgres image tag for available image tags please see https://hub.docker.com/_/postgres
postgres_image_tag: 12.7 # optional, default is latest
postgres_user: proca
postgres_password: proca
# POSTGRES_USER - create the user with the superuser power
#postgres_user: # optional, default is postgres
# POSTGRES_DB - postgres database
#postgres_db: # optional, default is postgres
# POSTGRES_PASSWORD - superuser password
#postgres_password: # optional
# POSTGRES_EXTENSIONS - List of postgres extensions separated by space to install in template1 database
postgres_extensions: citext # optional
# APP_USER - unprivileged postgres user
#app_user: proca # optional, default is app
# APP_PASSWORD_USER - password for unprivileged postgres user
#app_user_password: proca # optional, default is app
# APP_DB - database or list of databases separated by space for unprivileged postgres user
#app_db: proca_test # optional, default is app
# EXPOSED_POSTGRES_PORT - exposed postgres port
#exposed_postgres_port: # optional, default is 5432
- name: Install RabbitMQ
# You may pin to the exact commit or the version.
# uses: mer-team/rabbitmq-mng-action@8efa214ee17181617aada9d7aab74a701a6a49bb
uses: mer-team/[email protected]
with:
RABBITMQ_USER: '' ## XXX GH action is broken and we need to unset these vars
RABBITMQ_PASS: '' ## as they are deprecated
RABBITMQ_PORT: 5672
RABBITMQ_MNG_PORT: 15672
RABBITMQ_TAG: 3-management-alpine # optional, default is 3-alpine
- name: Restore dependencies cache
uses: actions/cache@v2
with:
path: deps
key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }}
restore-keys: ${{ runner.os }}-mix-
- uses: actions/checkout@v2
- name: Set up Elixir
uses: erlef/setup-beam@v1
with:
elixir-version: "1.12.0" # Define the elixir version [required]
otp-version: "23.3.1" # Define the OTP version [required]
- name: Install and setup PostgreSQL with PostgreSQL extensions and unprivileged user
# You may pin to the exact commit or the version.
# uses: Daniel-Marynicz/postgresql-action@0dcc196f0ddffbdf095921877c6577132ab35756
uses: Daniel-Marynicz/[email protected]
with:
# Docker postgres image tag for available image tags please see https://hub.docker.com/_/postgres
postgres_image_tag: 12.7 # optional, default is latest
postgres_user: proca
postgres_password: proca
# POSTGRES_USER - create the user with the superuser power
#postgres_user: # optional, default is postgres
# POSTGRES_DB - postgres database
#postgres_db: # optional, default is postgres
# POSTGRES_PASSWORD - superuser password
#postgres_password: # optional
# POSTGRES_EXTENSIONS - List of postgres extensions separated by space to install in template1 database
postgres_extensions: citext # optional
# APP_USER - unprivileged postgres user
#app_user: proca # optional, default is app
# APP_PASSWORD_USER - password for unprivileged postgres user
#app_user_password: proca # optional, default is app
# APP_DB - database or list of databases separated by space for unprivileged postgres user
#app_db: proca_test # optional, default is app
# EXPOSED_POSTGRES_PORT - exposed postgres port
#exposed_postgres_port: # optional, default is 5432
- name: Install RabbitMQ
# You may pin to the exact commit or the version.
# uses: mer-team/rabbitmq-mng-action@8efa214ee17181617aada9d7aab74a701a6a49bb
uses: mer-team/[email protected]
with:
RABBITMQ_USER: "" ## XXX GH action is broken and we need to unset these vars
RABBITMQ_PASS: "" ## as they are deprecated
RABBITMQ_PORT: 5672
RABBITMQ_MNG_PORT: 15672
RABBITMQ_TAG: 3-management-alpine # optional, default is 3-alpine
- name: Restore dependencies cache
uses: actions/cache@v2
with:
path: deps
key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }}
restore-keys: ${{ runner.os }}-mix-

- name: Setup RabbitMQ
run: ./utils/configure-rabbitmq-develop.sh -D
working-directory: proca
- name: Setup RabbitMQ
run: ./utils/configure-rabbitmq-develop.sh -D
working-directory: proca

- name: Install dependencies
run: mix deps.get
working-directory: proca
- name: Install dependencies
run: mix deps.get
working-directory: proca

- name: Setup app db (migrate)
run: mix ecto.setup
env:
MIX_ENV: test
working-directory: proca

- name: Run tests
run: mix test
working-directory: proca
- name: Setup app db (migrate)
run: mix ecto.setup
env:
MIX_ENV: test
working-directory: proca

- name: Run tests
run: mix test
working-directory: proca
2 changes: 0 additions & 2 deletions proca/lib/proca/service/email_backend.ex
Original file line number Diff line number Diff line change
Expand Up @@ -181,13 +181,11 @@ defmodule Proca.Service.EmailBackend do
from_email == org.email_from ->
email
|> Email.from({from_name, "#{via_username}+#{domain}@#{via_domain}"})
|> Email.header("Reply-To", from_email)

# Any from email - we will use the username here
true ->
email
|> Email.from({from_name, "#{via_username}+#{username}@#{via_domain}"})
|> Email.header("Reply-To", from_email)
end
end

Expand Down

0 comments on commit c11807f

Please sign in to comment.