Saving generated emails locally
Added an option to save the generated emails locally instead of sending through an SMTP server. This is useful if you're signing keys from an air gapped machine.
You then just hand these to postfix or sendmail or whatever?
I'd been asked for a similar feature, but had been planning it differently - write out the signatures and some metadata, and then have another option to slurp that in and send them off...
I'm not entirely sure which I like better.
Your approach is definitely simpler and less code. Less to keep track of, less to refactor. The downside is that it requires more know-how on the part of the user to then send those messages off... for example, at the very least you have to have a mailserver configured to send properly - which many don't (which is why pius can speak to remote mailservers directly with auth).
Let me ponder it it for a bit. I'll get back to you. :)
Yup, I transferred the emails to my mail server and handed each of them off to sendmail.
for f in $(ls); do sendmail -t < $f; done
The -t option just tells sendmail to use the header fields for the recipient and sender information instead of specifying them on the commandline.
I see your point that a fair number of people don't have an MTA setup for this to work. If you don't want to add another mode to Pius for just sending the generated emails, perhaps we can get mailx to send the emails in a fashion similar to sendmail. This is what I have so far but it doesn't seem to be pulling the recipients out of the email metadata like sendmail does.
mailx -t -S smtp="mail.example.com:25" -S smtp-auth=login -S smtp-auth-user="[email protected]" -S smtp-auth-password="password" < emailFile
@mborger - you still interested in finishing this?
Sure. What's next on your mind to look into?
I think all that's left is:
- Documentation on how to hand this to an MTA
- the ability to handle email_override and the BCC-the-user options
- rebase on current master
And then we're good.
Check out my changes. I combined the two address override conditionals to the beginning of the _send_mail method.
@mborger - This code looks great! Thanks for working through the long review process on this one. The only thing left before merging is some docs. Probably a simple command people can run to send off all the emails, in the help for -L is sufficient, but I"m also open to a separate doc explaining the use-case.
Hey @mborger - wanna rebase and add some simple comments to the README on this and I can merge it?
@mborger ?
Looks like this PR grew a bit stale. Should it be closed?
one last call, @mborger ?