Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
gianfj opened this issue May 18, 2023 · 1 comment
Open

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

gianfj opened this issue May 18, 2023 · 1 comment
Assignees
Labels

Comments

@gianfj
Copy link

gianfj commented May 18, 2023

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
@yosefy
Copy link

yosefy commented Mar 22, 2024

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
Labels
Projects
None yet
Development

No branches or pull requests

3 participants