msmtp
msmtp copied to clipboard
Port msmtpq from bash to POSIX for busybox ash shell to save space for OpenWRT/embedded
msmtp is a very popular lightweight MTA on OpenWRT and I've been experimenting with it recently.
I've noticed that msmtpq requires bash for it's interpreter and I would like to inquire if porting this to POSIX for the busybox ash shell would be a reasonable feature request.
In OpenWRT, bash requires roughly 420KB of storage, and it's not installed by default. While 420KB seems pathetically small in modern days, it's huge for typical OpenWRT systems, many of which will only have 1-2MB of free overlay space on their 8MB NOR flash chip.
In OpenWRT, the msmtp, msmtp-mta, and msmtp-queue packages themselves total to approximately 57KB in size, which is quite reasonable. The BASH dependency alone is multiples larger, so removing this dependency would be a huge improvement.
The default shell on OpenWRT is busybox's ash shell, While it's not POSIX it's pretty close.
Would you be open to accepting patches to port msmtpq away from bash to a POSIX or ash-compatible variant?
I've already run msmtpq through the shellcheck linter and it's come up with a number of issues. I think the most significant is that ash doesn't have arrays and there's some string indexing issues, but I don't think these would be too difficult to replace.
Please let me know what you think.
The msmtpq scripts are currently unmaintained and any improvements would be welcome. However, please test the changes, we have been bitten in the past by bugs introduced by seemingly obvious removals of bashisms...
Okay. Thanks. I'll come back with a pull request or patch some day or another when I get back to this.
Well, it's been a year, so I'll close this for now.
@CapitalF There is msmtpq-ng
btw