pius icon indicating copy to clipboard operation
pius copied to clipboard

Saving generated emails locally

Open mborger opened this issue 10 years ago • 11 comments

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.

mborger avatar Feb 05 '16 05:02 mborger

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. :)

jaymzh avatar Feb 05 '16 07:02 jaymzh

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 avatar Feb 05 '16 08:02 mborger

@mborger - you still interested in finishing this?

jaymzh avatar Jan 14 '18 20:01 jaymzh

Sure. What's next on your mind to look into?

mborger avatar Jan 16 '18 05:01 mborger

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.

jaymzh avatar Jan 16 '18 09:01 jaymzh

Check out my changes. I combined the two address override conditionals to the beginning of the _send_mail method.

mborger avatar Jan 17 '18 06:01 mborger

@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.

jaymzh avatar Jan 28 '18 22:01 jaymzh

Hey @mborger - wanna rebase and add some simple comments to the README on this and I can merge it?

jaymzh avatar Mar 19 '18 01:03 jaymzh

@mborger ?

jaymzh avatar Mar 24 '18 00:03 jaymzh

Looks like this PR grew a bit stale. Should it be closed?

abrahamcuenca avatar Mar 07 '20 06:03 abrahamcuenca

one last call, @mborger ?

jaymzh avatar Mar 09 '20 23:03 jaymzh