<div dir="ltr"><div><div><div>That&#39;s base64 encoded.  Do this:<br><br></div>1. Copy the file out of the queue<br></div>2. Open it up in a text editor and remove everything except the encoded junk<br></div>3. Run: base64 -d encoded_junk_file &gt; thisisthe.pdf<br>
<div><div><br></div></div><div class="gmail_extra"><br clear="all"><div>❧ Brian Mathis</div>
<br><br><div class="gmail_quote">On Thu, Aug 15, 2013 at 5:03 PM, Lightner, Jeff <span dir="ltr">&lt;<a href="mailto:JLightner@water.com" target="_blank">JLightner@water.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">








<div link="blue" vlink="purple" lang="EN-US">
<p></p>
<div>
<p class="MsoNormal">OK – Given I have unsent email in /var/spool/mqueue how can I extract an attachment from the file?<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Note I am NOT asking how to SEND attachments – the attachment is already in the file.   What I can’t figure out is how I could get just the attachment and either view it on the local host or forward it in a new email.<u></u><u></u></p>

<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">So for example for a given message I have two files:<u></u><u></u></p>
<p class="MsoNormal">-rw------- 1 root smmsp 332042 Aug 15 10:58 dfr7FEwI9R025512<u></u><u></u></p>
<p class="MsoNormal">-rw------- 1 root smmsp   1163 Aug 15 14:02 qfr7FEwI9R025512<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">The qfr is the one with the original header information.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">The dfr is the one with the actual mail body which in this case is mainly a pdf attachment.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">What I see in the dfr is something along the lines of:<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">------=_Part_288_32765629.1376578698499<u></u><u></u></p>
<p class="MsoNormal">Content-Type: text/plain; charset=us-ascii<u></u><u></u></p>
<p class="MsoNormal">Content-Transfer-Encoding: 7bit<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Your Doc<u></u><u></u></p>
<p class="MsoNormal">------=_Part_288_32765629.1376578698499<u></u><u></u></p>
<p class="MsoNormal">Content-Type: application/pdf;<u></u><u></u></p>
<p class="MsoNormal">        name=thisisthe.pdf<u></u><u></u></p>
<p class="MsoNormal">Content-Transfer-Encoding: base64<u></u><u></u></p>
<p class="MsoNormal">Content-Disposition: attachment;<u></u><u></u></p>
<p class="MsoNormal">        filename=thisisthe.pdf<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">KTYMCLi0xLjQKJaqrrK0KNCAwIG9iago8PAovQ3JlYXRvciAoQXBhY2hlIEZPUCBWZXJzaW9ujclis<u></u><u></u></p>
<p class="MsoNormal">KCkZL1Byb2R1Y2VyIChBcGFjaGUgRk9QIFZlcnNpb24gMS4wKQovQ3JlYXRpb25EYXRlIChEOjkm<u></u><u></u></p>
<p class="MsoNormal">QTMwOKE1MTA1ODE3LTA0JzAwJykKPj4KZW5kb2JqCjUgMCBvYmoKPDwKICAvTiAzCiAgL0xlbill0<u></u><u></u></p>
<p class="MsoNormal">------=_Part_288_32765629.1376578698499—<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">There is a lot more between the “ Part_288” lines that I’ve left out.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">So my question is how could I get the “thisisthe.pdf” file to actually be a pdf that I could open?<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">I tried using mutt’s –a facility with just the encoded stuff but no go.  Using it with just the stuff after Your Doc is no go.    Web search just gives me hit after hit about either how to read an attachment after it has been delivered
 or how to send an attachment in the first place and neither of those is my question.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Again my question is how to get the EXISTING attachment out of the /var/spool/mqueue files.<u></u><u></u></p>
</div>
<p></p>
<p> </p>
<p> </p>
<p></p>
<p><font face="Arial"><font color="fuchsia"><font style="FONT-FAMILY:Arial;FONT-SIZE:10pt"></font></font></font> </p>
<p> </p>
<p><font face="Arial"><font color="fuchsia"><font style="FONT-FAMILY:Arial;FONT-SIZE:10pt">Athena<font size="1">®</font>, Created for the Cause</font><font size="1">™
</font></font></font></p>
<p><font face="Arial">Making a Difference in the Fight Against Breast Cancer</font></p>
<p><font face="Arial"></font> </p>
<p><font face="Arial"></font> </p>
<p><font face="Arial"><font><b>How and Why I Should Support Bottled Water!<br>
</b>Do not relinquish your right to choose bottled water as a healthy alternative to beverages that contain sugar, calories, etc. Your support of bottled water will make a difference! Your signatures count! Go to
<a href="http://www.bottledwatermatters.org/luv-bottledwater-iframe/dswaters" target="_blank">http://www.bottledwatermatters.org/luv-bottledwater-iframe/dswaters</a> and sign a petition to support your right to always choose bottled water. Help fight federal and state issues,
 such as bottle deposits (or taxes) and organizations that want to ban the sale of bottled water. Support community curbside recycling programs. Support bottled water as a healthy way to maintain proper hydration. Our goal is 50,000 signatures. Share this petition
 with your friends and family today!</font></font></p>
<p><font face="Arial"></font> </p>
<p><span style="FONT-FAMILY:Arial;FONT-SIZE:10pt">---------------------------------<br>
CONFIDENTIALITY NOTICE: This e-mail may contain privileged or confidential information and is for the sole use of the intended recipient(s). If you are not the intended recipient, any disclosure, copying, distribution, or use of the contents of this information
 is prohibited and may be unlawful. If you have received this electronic transmission in error, please reply immediately to the sender that you have received the message in error, and delete it. Thank you.<br>
----------------------------------</span><span style="FONT-FAMILY:&#39;Courier New&#39;;FONT-SIZE:9pt"><u></u><u></u></span></p>
<p> </p>
<p></p>
<p></p>
</div>

<br>_______________________________________________<br>
Ale mailing list<br>
<a href="mailto:Ale@ale.org">Ale@ale.org</a><br>
<a href="http://mail.ale.org/mailman/listinfo/ale" target="_blank">http://mail.ale.org/mailman/listinfo/ale</a><br>
See JOBS, ANNOUNCE and SCHOOLS lists at<br>
<a href="http://mail.ale.org/mailman/listinfo" target="_blank">http://mail.ale.org/mailman/listinfo</a><br>
<br></blockquote></div><br></div></div>