diff --git a/.github/workflows/close_old_issues_and_prs.yml b/.github/workflows/close_old_issues_and_prs.yml new file mode 100644 index 00000000..5b86aed1 --- /dev/null +++ b/.github/workflows/close_old_issues_and_prs.yml @@ -0,0 +1,34 @@ +name: 'Close stale issues and PRs' +on: + schedule: + # Once every day at midnight UTC + - cron: "0 0 * * *" + workflow_dispatch: + +jobs: + stale: + runs-on: ubuntu-latest + permissions: + issues: write + pull-requests: write + steps: + - name: Mark/Close Stale Issues and Pull Requests 🗑️ + uses: actions/stale@v3 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + days-before-stale: 60 + days-before-close: 7 + stale-issue-message: > + This issue has been automatically marked as stale because it has not had + recent activity. It will be closed if no further activity occurs. + stale-pr-message: > + This pull request has been automatically marked as stale because it has not had + recent activity. It will be closed if no further activity occurs. + exempt-issue-labels: "pinned,security,enhancement" + exempt-pr-labels: "pinned,security,enhancement" + stale-issue-label: "stale" + stale-pr-label: "stale" + operations-per-run: "250" + ascending: "true" + #DRY-RUN + debug-only: "false" \ No newline at end of file diff --git a/data/web/inc/spf.inc.php b/data/web/inc/spf.inc.php index a3abcbe4..55e164b4 100644 --- a/data/web/inc/spf.inc.php +++ b/data/web/inc/spf.inc.php @@ -24,7 +24,7 @@ function get_spf_allowed_hosts($check_domain, $expand_ipv6 = false) { $mod = explode('=', $mech); if ($mod[0] == 'redirect') // handle a redirect { - $hosts = get_spf_allowed_hosts($mod[1]); + $hosts = get_spf_allowed_hosts($mod[1],true); return $hosts; } } @@ -79,13 +79,13 @@ function get_spf_allowed_hosts($check_domain, $expand_ipv6 = false) { } foreach ($hosts as &$host) { if (filter_var($host, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) { - if ($expand_ipv6 === true) { - $hex = unpack("H*hex", inet_pton($host)); - $host = substr(preg_replace("/([A-f0-9]{4})/", "$1:", $hex['hex']), 0, -1); - } - else { - $host = $host; - } + if ($expand_ipv6 === true) { + $hex = unpack("H*hex", inet_pton($host)); + $host = substr(preg_replace("/([A-f0-9]{4})/", "$1:", $hex['hex']), 0, -1); + } + else { + $host = $host; + } } } return $hosts; diff --git a/update.sh b/update.sh index f4f058d8..c53f3759 100755 --- a/update.sh +++ b/update.sh @@ -123,7 +123,7 @@ while (($#)); do exit 99 fi if [[ -z $(git log HEAD --pretty=format:"%H" | grep "${LATEST_REV}") ]]; then - echo "Updated code is available." + echo -e "Updated code is available.\nThe changes can be found here: https://github.com/mailcow/mailcow-dockerized/commits/master" git log --date=short --pretty=format:"%ad - %s" $(git rev-parse --short HEAD)..origin/master exit 0 else