mirror of
https://github.com/decke/smtprelay.git
synced 2026-04-25 12:55:54 +03:00
[GH-ISSUE #81] How to use variables instead of config file #17
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/smtprelay#17
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @HakunMatat4 on GitHub (Jul 13, 2022).
Original GitHub issue: https://github.com/decke/smtprelay/issues/81
First of all, thank you for this gold tool :)
Long story short, everything has been fine via Docker and Kubernetes.
But I do require to use variables instead of config files and I am lost a bit.
The config files does mention:
So, I would have something like this:
The problem I am having is how to convert
/usr/local/bin/smtprelay -config /etc/smtprelay/smtprelay.inito use the above.I would try it like
/usr/local/bin/smtprelay SMTPRELAY_LISTEN = starttls://127.0.0.1:587 SMTPRELAY_LOCAL_CERT = /etc/smtprelay/tls_pem.pembut it fails and use its own internal config..I have also tried something like
/usr/local/bin/smtprelay SMTPRELAY="127.0.0.1:25" SMTPRELAY_LOGFILE="/var/log/smtprelay.log"but it again ignores it and uses its internal config.I cannot find much reference about how to use those variables.
Thank you
@decke commented on GitHub (Jul 16, 2022):
You need to provide this as environment variables not parameters to the binary. And please make sure you are using latest code from git because this code is fresh and not included in any release yet.
@decke commented on GitHub (Jul 16, 2022):
I don't quite get the question you are asking if it works in docker and kubernetes environment. Do you need it on a shell or shell script?
@decke commented on GitHub (Jul 16, 2022):
If you want to do this in a shell it needs to look like:
SMTPRELAY_LOGFILE="/var/log/smtprelay.log" SMTPRELAY_LISTEN="starttls://127.0.0.1:587" /usr/local/bin/smtprelay@HakunMatat4 commented on GitHub (Jul 19, 2022):
That makes sense now, I have been using smtprelay v1.8.0 from May
My issue was to get it to accept environment and not the file but the above explains now what is wrong.
Even so it is not released yet, it would be nice to have the main page updated with it and example.
My silly mistake I guess was downloading
smartreply.inifrom the main page which is updated and then using the latest release which does not support environment vars.I will look into how to compile the latest code as you recommended.
So far I have been using the smtprelay-v1.8.0-linux-amd64.tar.gz and got it working with docker and kubernetes as I mentioned, and literally few minutes ago I got it working with the secure e-mail Proton.
That is freaking awesome since everybody uses Postfix with a lot of changes here and there, smtprelay does it like a charm with 4 lines.
Time to spread the word :)
Thanks a lot for the reply