Skip to content

[BUG] The "-f" flag does not work with "mail" #517

Open
@gianfj

Description

@gianfj

Describe the bug

The "-f" flag (Mailgun / Mail From Address) does not work

To Reproduce

Run:
$ update-ngxblocker -f FROM_ADDRESS -e TO_ADDRESS
[...]
mail: conflicting options

And the email is not sent.

Expected behavior

The email should be sent with the specified "from" address

Server (please complete the following information):

  • Operating System:

  • [X ] Ubuntu

  • Specify Exact Version of OS:
    Ubuntu 22.04.2 LTS

Post output of uname -a here
Linux XXXXX 5.15.0-72-generic #79-Ubuntu SMP Wed Apr 19 08:22:18 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

Additional information

The problem is the that "-f" flag (at least on Ubuntu) calls the "mail" command with the "-f FROM_ADDRESS" option (function send_email), but the "-f" flag for the mail command is to specify a mailbox file. I was able to workaround this issue by using the "-a" (add header) specifying the from address as per the following diff:

275c275
< 			cat $EMAIL_REPORT | $mail_path -f "$MG_FROM" -s "Nginx Bad Bot Blocker Updated" $EMAIL
---
> 			cat $EMAIL_REPORT | $mail_path -a "From: $MG_FROM" -s "Nginx Bad Bot Blocker Updated" $EMAIL

Activity

yosefy

yosefy commented on Mar 22, 2024

@yosefy

for me in rocky linux it is mail -r
so there is a little mess in this area i guess :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Participants

    @mitchellkrogza@yosefy@gianfj

    Issue actions

      [BUG] The "-f" flag does not work with "mail" · Issue #517 · mitchellkrogza/nginx-ultimate-bad-bot-blocker