| 
									
										
										
										
											2013-08-18 13:07:51 -04:00
										 |  |  | #!/usr/bin/perl -w | 
					
						
							|  |  |  | # mailman-archive-create-real-mbox.plx                                         -*- Perl -*- | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # Copyright (C) 2013 Bradley M. Kuhn <bkuhn@ebb.org> | 
					
						
							|  |  |  | # | 
					
						
							|  |  |  | # This software's license gives you freedom; you can copy, convey, | 
					
						
							|  |  |  | # propogate, redistribute and/or modify this program under the terms of | 
					
						
							|  |  |  | # the GNU  General Public License (GPL) as published by the Free | 
					
						
							|  |  |  | # Software Foundation (FSF), either version 3 of the License, or (at your | 
					
						
							|  |  |  | # option) any later version of the GPL published by the FSF. | 
					
						
							|  |  |  | # | 
					
						
							|  |  |  | # This program is distributed in the hope that it will be useful, but | 
					
						
							|  |  |  | # WITHOUT ANY WARRANTY; without even the implied warranty of | 
					
						
							|  |  |  | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU | 
					
						
							|  |  |  | # General Public License for more details. | 
					
						
							|  |  |  | # | 
					
						
							|  |  |  | # You should have received a copy of the GNU General Public License | 
					
						
							|  |  |  | # along with this program in a file in the toplevel directory called | 
					
						
							|  |  |  | # "GPLv3".  If not, see <http://www.gnu.org/licenses/>. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | use strict; | 
					
						
							|  |  |  | use warnings; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | while (<>) { | 
					
						
							| 
									
										
										
										
											2013-08-25 12:48:31 -04:00
										 |  |  |   if (/^From\s+(\S+)(?:\s+at\s+|\@)(\S+)\s+(.+)$/) { | 
					
						
							| 
									
										
										
										
											2013-08-18 13:07:51 -04:00
										 |  |  |     print "From ${1}\@${2} ${3}\n"; | 
					
						
							| 
									
										
										
										
											2013-08-25 12:48:31 -04:00
										 |  |  |   } elsif (/^From\s+=\?ISO\S+\s+(Mon|Tue|Wed|Thu|Fri|Sat|Sun)/) { | 
					
						
							|  |  |  |     print $_; | 
					
						
							| 
									
										
										
										
											2013-08-18 13:07:51 -04:00
										 |  |  |   } elsif (/^From\s+/) { | 
					
						
							| 
									
										
										
										
											2013-08-25 12:48:31 -04:00
										 |  |  |     warn "just quoting line $_"; | 
					
						
							|  |  |  |     print ">$_"; | 
					
						
							| 
									
										
										
										
											2013-08-18 13:07:51 -04:00
										 |  |  |   } else { | 
					
						
							|  |  |  |     print $_; | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # | 
					
						
							|  |  |  | # Local variables: | 
					
						
							|  |  |  | # compile-command: "perl -c mailman-archive-create-real-mbox.plx" | 
					
						
							|  |  |  | # End: |