mirror of
				https://github.com/Unstructured-IO/unstructured.git
				synced 2025-10-31 18:14:51 +00:00 
			
		
		
		
	 ccf0477080
			
		
	
	
		ccf0477080
		
			
		
	
	
	
	
		
			
			### Summary Closes #2489, which reported an inability to process `.p7s` files. PR implements two changes: - If the user selected content type for the email is not available and there is another valid content type available, fall back to the other valid content type. - For signed message, extract the signature and add it to the metadata ### Testing ```python from unstructured.partition.auto import partition filename = "example-docs/eml/signed-doc.p7s" elements = partition(filename=filename) # should get a message about fall back logic print(elements[0]) # "This is a test" elements[0].metadata.to_dict() # Will see the signature ```
		
			
				
	
	
		
			18 lines
		
	
	
		
			494 B
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			18 lines
		
	
	
		
			494 B
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
| MIME-Version: 1.0
 | |
| Content-Type: multipart/signed; protocol="application/x-pkcs7-signature"; micalg="sha-256"; boundary="----DA7C0B64AB4D78BAFBED70C0FA340877"
 | |
| 
 | |
| This is an S/MIME signed message
 | |
| 
 | |
| ------DA7C0B64AB4D78BAFBED70C0FA340877
 | |
| This is a test
 | |
| 
 | |
| ------DA7C0B64AB4D78BAFBED70C0FA340877
 | |
| Content-Type: application/x-pkcs7-signature; name="smime.p7s"
 | |
| Content-Transfer-Encoding: base64
 | |
| Content-Disposition: attachment; filename="smime.p7s"
 | |
| 
 | |
| <SIGNATURE>
 | |
| 
 | |
| ------DA7C0B64AB4D78BAFBED70C0FA340877--
 | |
| 
 |