Last active
November 28, 2022 22:21
-
-
Save endymion/97ddb51e61a488a5746fec4399718c4a to your computer and use it in GitHub Desktop.
Revisions
-
endymion revised this gist
Nov 28, 2022 . 1 changed file with 6 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -10,7 +10,13 @@ puts "To line after: " puts ' ' + mime_message.match(/^(To\:.*)$/)[1] # Remove the BCC: line. mime_message.gsub!(/^BCC\:.*\n/,'') puts "Removed BCC:" puts mime_message __END__ BCC: [email protected] To: Guest <[email protected]> From: Some One <[email protected]> MIME-Version: 1.0 -
endymion created this gist
Nov 28, 2022 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,34 @@ mime_message = DATA.read puts "To line before: " puts ' ' + mime_message.match(/^(To\:.*)$/i)[1] # Massage the To: line. changed_to = '[email protected]' mime_message.gsub!(/^To\:.*$/i, "To: #{changed_to}") puts "To line after: " puts ' ' + mime_message.match(/^(To\:.*)$/)[1] __END__ To: Guest <[email protected]> From: Some One <[email protected]> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="XXXXboundary text" This is a multipart message in MIME format. --XXXXboundary text Content-Type: text/plain this is the body text --XXXXboundary text Content-Type: text/plain; Content-Disposition: attachment; filename="test.txt" this is the attachment text --XXXXboundary text--