/************************************************************************* * * HTCd - Copyright (C) 1998-2006 Henrik Rydberg * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * 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; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #include static fp_stream mout(stdout),merr(stderr); static void Show(mstream& out,const Message& msg) { if(msg.cont_type.empty()|| eqn(msg.cont_type,mime_textplain)|| eqn(msg.cont_type,mime_texthtml)) { if(eqn(msg.cont_trans_enc,trans_quote)) { //decodeQP(out,msg.body); mswrite tmp; decodeQP(tmp,msg.body); encodeQP(out,tmp.str()); } else { //out< [index]\n"; return 1; } Mailbox box; GetMessages(box,argv[1]); merr<<"Found "<2) { Message msg(box[atoi(argv[2])]); //msg.Pick(mime_textplain); mswrite tmp; encodeHeader(tmp,mime_default,msg.subject); msg.subject=tmp.str(); msg.putHead(mout); mout<<"-----------------------------------------\n"; rpile part; if(msg.Multipart(part)) { for(int i=0;i\n"; return 1; } mstring buffer; buffer.load(argv[1]); merr<