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

Fix using multiple email addresses for sendmail #3598

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

caderobinson
Copy link

busybox sendmail wants space separated list but To: is comma separated so let sendmail just parse the email body for To:

Before submitting your PR, please review the following checklist:

  • CHOOSE CORRECT BRANCH: if filing a bugfix/enhancement
    against certain release version, choose 0.9, 0.10 or 0.11 branch,
    for dev-edition use master branch
  • CONSIDER adding a unit test if your PR resolves an issue
  • LIST ISSUES this PR resolves
  • MAKE SURE this PR doesn't break existing tests
  • KEEP PR small so it could be easily reviewed.
  • AVOID making unnecessary stylistic changes in unrelated code
  • ACCOMPANY each new failregex for filter X with sample log lines
    within fail2ban/tests/files/logs/X file

busybox sendmail wants space separated list but To: is comma separated
so let sendmail just parse the email body for To:
@@ -62,7 +62,7 @@ actionunban =

# Your system mail command
#
mailcmd = /usr/sbin/sendmail -f "<sender>" "<dest>"
mailcmd = /usr/sbin/sendmail -f "<sender>" -t
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can provide certain backwards incompatibility for actions based on sendmail-common which doesn't contain recipients in the message body (e. g. <dest> is not included in To: or message doesn't contain To: header).

@@ -175,6 +175,7 @@ filter = %(__name__)s[mode=%(mode)s]

# Destination email address used solely for the interpolations in
# jail.{conf,local,d/*} configuration files.
# comma separated list for multiple addresses
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May be valid for sendmail actions (after the "fix"), but not for mail (GNU Mailutils, etc) actions.

@Neustradamus
Copy link

@caderobinson: Have you progressed on your PR?

@caderobinson
Copy link
Author

@caderobinson: Have you progressed on your PR?

I haven't done anything with it. This change worked for me on several machines just fine but there isn't really any validation and as sebres said it may not work in all cases.

For the use I found it not working in it was a container so I just mounted my modified file into it and called it good.

I am not a coder, I am a system admin that knows enough python to hack something that fixed my issue.
I am not sure what to do with this PR if it isn't going to be used.
Just close it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants