EString DSN::dsnBody() const { EString r; // [ original-envelope-id-field CRLF ] if ( !envelopeId().isEmpty() ) r.append( "Original-Envelope-Id: " + envelopeId() + "\r\n" ); // reporting-mta-field CRLF r.append( "Reporting-Mta: dns;" + Configuration::hostname() + "\r\n" ); // [ received-from-mta-field CRLF ] if ( !receivedFrom().isEmpty() ) r.append( "Received-From-Mta: dns;" + receivedFrom() + "\r\n" ); // [ arrival-date-field CRLF ] if ( arrivalDate() ) r.append( "Arrival-Date: " + arrivalDate()->rfc822() + "\r\n" ); List<Recipient>::Iterator i( recipients() ); while ( i ) { r.append( "\r\n" ); r.append( i->dsnParagraph().wrapped( 72, "", "", true ).crlf() ); ++i; } return r; }
EString DSN::plainBody() const { EString r; List<Recipient>::Iterator recipient( recipients() ); while ( recipient ) { EString tmp = recipient->plainTextParagraph(); if ( !tmp.isEmpty() ) { r.append( tmp.wrapped( 72, "", "", true ).crlf() ); r.append( "\r\n" ); } ++recipient; } // this code sneakily ensures that the ideal line wrap point is // just before the server name, almost independent of the server // name's length. fine for testing. r.append( "This message was generated by Archiveopteryx " ); r.append( Configuration::compiledIn( Configuration::Version ) ); r.append( ", running on mail server \r\n" ); r.append( Configuration::hostname() ); r.append( ".\r\n" ); if ( arrivalDate() && !receivedFrom().isEmpty() ) { EString tmp = "\nThe message arrived at "; tmp.append( arrivalDate()->isoDate() ); tmp.append( ", " ); tmp.append( arrivalDate()->isoTime() ); tmp.append( " from host " ); tmp.append( receivedFrom() ); tmp.append( "." ); r.append( tmp.wrapped( 72, "", "", true ).crlf() ); } else if ( arrivalDate() ) { EString tmp = "\nThe message arrived at "; tmp.append( arrivalDate()->isoDate() ); tmp.append( "." ); r.append( tmp.wrapped( 72, "", "", true ).crlf() ); } else if ( !receivedFrom().isEmpty() ) { EString tmp = "\nThe message was received from host "; tmp.append( receivedFrom() ); tmp.append( "." ); r.append( tmp.wrapped( 72, "", "", true ).crlf() ); } return r; }
void MailListView::writeConfig( QSettings *conf) { QString temp; if (!singleColumnMode()) { for (int x = 0; x < columnCount(); x++) { temp.setNum(x); conf->setValue("querycol" + temp, columnWidth(x) ); conf->setValue("querycollabelpos" + temp, labelPos(x) ); } conf->setValue( "querycolsort", sortedColumn() ); conf->setValue( "querycolsortascending", isAscending() ); conf->setValue( "arrivaldate", arrivalDate() ); conf->setValue( "showheader", horizontalHeader()->isHidden() ); } }