Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

blame it on the weather: sender address key hasn\'t been decrypted' #34

Closed
thierbig opened this issue Aug 8, 2018 · 5 comments
Closed

Comments

@thierbig
Copy link

thierbig commented Aug 8, 2018

Error in SMTP using nodemailer. Checked in the code. Looks like the private key is null after decryption..

Anything I could do to fix this?

Something goes wrong in this code

var privateKey *openpgp.Entity for _, e := range u.privateKeys { if e.PrimaryKey.KeyId == encryptedPrivateKey.PrimaryKey.KeyId { privateKey = e break } } if privateKey == nil { return errors.New("sender address key hasn't been decrypted") }

Here's my nodemailer config if it can help.

let transporterSale= nodemailer.createTransport({ host:'127.0.0.1', port:1025, secure:false, auth:{user:"USER",pass:"BRIDGEPW"}, tls:{rejectUnauthorized:false} })

Merci

@thierbig
Copy link
Author

thierbig commented Aug 8, 2018

Okay so I have business acc on proton and I wanted to send from one of my other alias email.
from: "X Sale <sale@x.com>",

Would that be the problem ? If I sent from my main @protonmail.com address would it work?

@thierbig
Copy link
Author

thierbig commented Aug 8, 2018

UPDATE: It's working from my main @protonmail.com address. Is there a way I can make it work from my other mail alias ?

@emersion
Copy link
Owner

emersion commented Aug 8, 2018

Yeah, this is a missing feature. Duplicate of #14

@thierbig
Copy link
Author

thierbig commented Aug 9, 2018

Is there any way for me to implement this feature or hackfix it in the meanwhile?

J’ai juste besoin d’un peu de guidance

@thierbig
Copy link
Author

thierbig commented Aug 9, 2018

Voici une théorie, I have to apply that logic:
for _, priv := range privateKeys { if err := priv.Decrypt(passphraseBytes); err != nil { return nil, err } }

to this in smtp.go :
var privateKey *openpgp.Entity for _, e := range u.privateKeys { //DECRYPT THE KEY HERE privateKey = e}

Now, how can I have access in smtp.go to Decrypt function and passphraseBytes variable in smtp.go ?

EDIT:
I think that would work nicely and quickly for me if I could replace the similar snippet in smtp.go with this one:

		if strings.EqualFold(addr.Email, fromAddrStr) {
			fromAddr = addr
			passphraseBytes := []byte(passphrase)
			keySalt, err := base64.StdEncoding.DecodeString(auth.keySalt)
			passphraseBytes, err = computeKeyPassword(passphraseBytes, keySalt)
			fromAddr.Keys[0].Entity().Decrypt(passphraseBytes)
			break
		} 

I still need to figure out which modules are needed to execute that and how to get auth.keySalt ( and maybe passphrase without having to hardcode.

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

No branches or pull requests

2 participants