jetmore / jetmore/swaks

Expand environment variables in config files

Open
#8 0 comments 0 reactions 0 assignees View on GitHub
idea
Dominant language
Perl
Stars
1.3k
Forks
95
PR merge metrics
No merged PRs in 30d

Description

I'm not sure if this is a good idea, but someone tried it and found it didn't work. Noting it here for future consideration. Perhaps if it is added it should be off by default and turned on with `--config-try-environment` or something.

Repro:

```
mb 0 /Users/jetmore/Documents/git/swaks > cat config
--to $TO
--from from@example.com
--helo server.example.com
mb 0 /Users/jetmore/Documents/git/swaks > TO=recip@example.com ./swaks --dump protocol --config ./config
Protocol Info:
protocol = esmtp
helo = server.example.com
from = from@example.com
to = $TO
force getpwuid = FALSE
quit after =
drop after =
drop after send =
server_only = FALSE
timeout = 30
pipeline = FALSE
prdr = FALSE
mb 0 /Users/jetmore/Documents/git/swaks >
```

If implemented, the "to" option in the output should show recip@example.com, not `$TO`

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by tracing how swaks reads the file passed to `--config` and how the `to` option is parsed, using the provided reproduction with `--dump protocol`. Determine whether environment expansion should be opt-in as proposed. Done means `$TO` in the config resolves to `recip@example.com` only when the new option is enabled, while the default behavior remains unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
perl
Domain
cli
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.