Add "Received:" header to email msg in correct position?

Discussion in 'Python' started by Grant Edwards, May 5, 2014.

  1. Does procmail implement the server-side of SMTP?
     
    Grant Edwards, May 7, 2014
    #21
    1. Advertisements

  2. Grant Edwards

    Burak Arslan Guest

    Seeing how discussion is still going on about this, I'd like to state
    once more what I said above in other words: You just need to do this:

    "Received: blah\r\n" + message.to_string()

    or better:

    socket.write("Received: blah\r\n")
    socket.write(message.to_string())

    And again, this is not a hack, this is how it's supposed to work.

    Burak
     
    Burak Arslan, May 7, 2014
    #22
    1. Advertisements

  3. Yes, that method does work... if you're taking it in and sending it
    right out again. But it means you have to hang onto two pieces of data
    - the message and the new Received header - until you write it to a
    file/socket.

    (By the way, side point: I tend to avoid calling a socket "socket", as
    that's the name of the module. I'd use "sock" in examples. Otherwise
    someone's liable to go digging for a top-level method "write" in the
    "socket" module, and get confused. And then think that sockets are
    confusing, which they're not!)

    ChrisA
     
    Chris Angelico, May 7, 2014
    #23
  4. Grant Edwards

    Ian Kelly Guest

     
    Ian Kelly, May 7, 2014
    #24
  5. Nevermind, I originally hadn't thought things completly through.
     
    Antoon Pardon, May 8, 2014
    #25
  6.  
    Grant Edwards, May 8, 2014
    #26
  7. Grant Edwards

    Ethan Furman Guest

    Some filtering of your sigs would be appreciated.
     
    Ethan Furman, May 8, 2014
    #27
  8. That would be correct, fwiw.

    ChrisA
     
    Chris Angelico, May 8, 2014
    #28
  9. Skip Montanaro, May 8, 2014
    #29
  10. Yep. I've removed a few of them from the file over the years because
    some people were offended by them. And I'll continue to do so...
     
    Grant Edwards, May 8, 2014
    #30
  11. Grant Edwards

    Tim Chase Guest

    I'm kinda disappointed having the curtain pulled back like that. I'd
    just assumed it was some nifty tool that turned a GPG/PGP signature
    into MadLibsâ„¢-style fill-in-the-blank and then flowed into various
    templates, allowing Grant to confirm/deny message authorship based on
    the unspoofability of the signature with any other message-body.

    Sounds like a fun weekend project ;-)

    -tkc
     
    Tim Chase, May 8, 2014
    #31
  12. Grant Edwards

    Ethan Furman Guest

    Thanks, much appreciated.
     
    Ethan Furman, May 9, 2014
    #32
  13. That would be cool...
     
    Grant Edwards, May 9, 2014
    #33
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.