packages icon indicating copy to clipboard operation
packages copied to clipboard

emailrelay: more options

Open stokito opened this issue 2 years ago • 2 comments

Maintainer: @fededim Compile tested: nothing to compile

Description: fix of a bug when server_tls option break daemon start. Add more essential options.

stokito avatar May 14 '22 17:05 stokito

Also I think we should support --interface which is list. It may have a prefix so maybe it should be a separate section with advanced configuration.

Another big problem is that users still must edit emailrelay.auth and pop.auth manually. This makes the UCI conf useless because ideally everything must be configurable from LUCI without a terminal.

stokito avatar May 14 '22 18:05 stokito

Also there is a new version v2.3. Could you please update it?

stokito avatar May 14 '22 18:05 stokito

All options seem to work but one.

E-MailRelay V2.2 does not accept --server-tls-key option (tested on OpenWrt v22.03.2): emailrelay: error: invalid option: "--server-tls-key"

nor second --server-tls-certificate: emailrelay: error: duplicate use of "--server-tls-certificate"

So only way to pass both fullchain.pem and privkey.pem is to cat them into one file and pass that to E-MailRelay.

rodajc avatar Nov 21 '22 23:11 rodajc

yes, the --server-tls-key was added in v2.3 But the PR can be merged separately: just don't use the unsupported (yet) option

stokito avatar Nov 21 '22 23:11 stokito

Ok. Well, looking forward to E-MailRelay V2.3 for OpenWrt then.

rodajc avatar Nov 22 '22 15:11 rodajc

There is a newer version 2.4 with a cool feature of direct delivery to SMTP by MX lookup. The maintainer of the package doesn't response so maybe we should created a PR with a newer version ourselves.

stokito avatar Nov 22 '22 15:11 stokito

@stokito I don't know how to do that. Do you?

And do you know where I can get the new sources to compile them myself meanwhile?

rodajc avatar Dec 05 '22 19:12 rodajc

@rodajc if you have a time you can try to make the PR yourself. I never did it but steps should be:

  1. git clone https://github.com/openwrt/packages.git
  2. Update version in the openwrt/packages/blob/master/mail/emailrelay/Makefile
  3. PKG_VERSION: 2.4.1 PKG_HASH=cff8cf5bff19fd1721cefdbd6207da67af01d2b1b4a51d147c33f4429a79766e
  4. Remove mail/emailrelay/patches/010-gcc11.patch
  5. Build and test it on a router
  6. Send the PR

Sources are here in SVN https://sourceforge.net/p/emailrelay/code/HEAD/tree/ there is also a git repo but it's outdated and author didn't migrated yet fully to the git

stokito avatar Dec 06 '22 09:12 stokito

I do have time but I don't have a clue. After step one in packages/mail/emailrelay I have:

./Makefile
./files/emailrelay.config
./files/emailrelay.init
./files/emailrelay.auth
./patches/010-gcc11.patch

I can modify Makefile and remove the patch, but I don't see the new source to compile. I can't find the source either in the openwrt directory that I used to compile the firmware with emailrelay 2.2 that I am using currently, so you can safely say that I don't know what I'm doing...

rodajc avatar Dec 06 '22 17:12 rodajc

@rodajc I created the PR with version update.

You don't see sources of the EmailRelay because they are downloaded by OpenWrt's makefile during a build. This is a complicated procedure. You may find on wiki "OpenWrt Create package" or something like that. I'm not experienced here too so I don't want to give a bad instruction.

stokito avatar Dec 06 '22 23:12 stokito

@stokito Many thanks!

Tomorrow I'll try and build a new emailrelay.

rodajc avatar Dec 07 '22 00:12 rodajc

If you just want to use tls you can do that even with the old version. You just need to merge privkey and fullchain and specify tls option with ext_command e.g. pass them manualy

stokito avatar Dec 07 '22 00:12 stokito

I know. The new version is more compatible with Let's Encrypt exactly because you don't need to merge keys anymore. One more thing, emailrelay does not appear in the available updates on my OpenWrt router. Do you know why not?

rodajc avatar Dec 07 '22 23:12 rodajc

Maybe there is no a package for your version of the OpenWrt. If you have a last version... my PR wasn't merged yet so you wont see it soon :(

stokito avatar Dec 08 '22 00:12 stokito

I'll wait for the next OpenWrt stable release then.

rodajc avatar Dec 08 '22 18:12 rodajc

So I waited for the new OpenWrt stable release which is OpenWrt 22.03.3. I checked it out and compiled it, I flashed the result to the router and then there was a deep disappointment. E-MailRelay is still on V2.2! What now? Will it ever merge into OpenWrt at all? If so, when? Isn't there any workaround to compile it already?

rodajc avatar Jan 14 '23 16:01 rodajc

I finally managed to compile E-MailRelay V2.4.1. @stokito Your instructions were right but if only you had mentioned this path: feeds/packages/mail/emailrelay. So now I could test the config and the init script. There seems to be an error in the init script for E-MailRelay:

[ -n "$server_tls_key" ] && procd_append_param command --server-tls-certificate "$server_tls_certificate" should be: [ -n "$server_tls_key" ] && procd_append_param command --server-tls-certificate "$server_tls_key"

The same may apply for $client_tls_key, but I don't use that, so I can't confirm.

rodajc avatar Jan 14 '23 22:01 rodajc

you right, will change that latter. Meanwhile author of the ER preparing v2.5 with many other changes that I waiting https://sourceforge.net/p/emailrelay/support-requests/75/ Going to test it latter.

stokito avatar Jan 14 '23 23:01 stokito

Please do no longer set PKG_RELEASE to AUTORELEASE as the feature is deprecated. Please use an integer instead. Below is a list of affected packages including correct PKG_RELEASE:

  • mail/emailrelay/Makefile: PKG_RELEASE:=14

github-actions[bot] avatar Jan 28 '23 18:01 github-actions[bot]

@rodajc I added a fix for the missing var. Please test. I can't compile for my router now

stokito avatar Jan 28 '23 19:01 stokito

@rodajc I added a fix for the missing var. Please test. I can't compile for my router now

Sorry for the delay. I will check the modification. Is that still with: PKG_VERSION:=2.4.1 in Makefile?

rodajc avatar Feb 26 '23 22:02 rodajc

yes, the change is in the openwrt scripts but not in the ER itself. Currently the next version of ER v2.5 is prepared and tested. Soon it should be released then I'll send a PR with the version upgrade

stokito avatar Feb 27 '23 05:02 stokito

With: PKG_VERSION:=2.4.1 in Makefile exactly the same package is compiled. Containing the same init script. Without the modification.

I assume this is as expected. The modification will be in a new version, right?

rodajc avatar Mar 03 '23 00:03 rodajc

This is a pull (merge) request (PR) with my patch. OpenWrt devs didn't reviewed it yet and not merged into sources.

stokito avatar Mar 03 '23 05:03 stokito