Skip to content

Update single.sh - Added MTA auth processing#326

Open
BogdanEraser wants to merge 1 commit intoimmauss:masterfrom
BogdanEraser:MTA_auth
Open

Update single.sh - Added MTA auth processing#326
BogdanEraser wants to merge 1 commit intoimmauss:masterfrom
BogdanEraser:MTA_auth

Conversation

@BogdanEraser
Copy link
Copy Markdown

Hello.
We have faced with case when we need to use MTA authentication.
According to Greenbone docs - https://greenbone.github.io/docs/latest/22.4/container/workflows.html#id22 - they are using gvmd with msmtp client as MTA. And something like this should be used (if using Docker):
- MTA_HOST=smtp.gmail.com
- MTA_PORT=587
- MTA_TLS=on
- MTA_STARTTLS=on
- MTA_AUTH=on
- MTA_USER=
- MTA_PASSWORD=<some_password>
- MTA_FROM=@gmail.com

As far as I understand you have reworked this part and used Postfix with only two parameters - RELAYHOST and SMTPPORT.
I have made some refactoring of single.sh script to make MTA authentication be available. Considering that:

  • MTA_HOST and MTA_PORT = RELAYHOST and SMTP_PORT (from your script parameter)

  • MTA_TLS and MTA_STARTTLS are already set up by default and due to "#Make postfix more secureish thanks @rkoosaar" in your code

  • MTA_AUTH, MTA_USER and MTA_PASSWORD are not processed and can be configured in /etc/postfix/main.cf as:
    smtp_sasl_auth_enable = yes
    smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
    smtp_sasl_security_options = noanonymous
    smtp_sasl_tls_security_options = noanonymous

where /etc/postfix/sasl_passwd contents is :
${RELAYHOST}:${SMTPPORT} ${MTA_USER}:${MTA_PASSWORD}

and secured with "chmod 600 /etc/postfix/sasl_passwd && postmap /etc/postfix/sasl_passwd"

  • MTA_FROM is set in alert config in OpenVAS (in "From Address" field)

So, minor additions to your single.sh script allows to use MTA authentication.
Please, review and, if possible, accept pull request.
With best regards, Bogdan

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.

1 participant