Update of /cvsroot/mahogany/M/src/mail
In directory usw-pr-cvs1:/tmp/cvs-serv15283/src/mail

Modified Files:
        SendMessageCC.cpp 
Log Message:
bounced messaged should include Resent-From (RFC 2822)

Index: SendMessageCC.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/mail/SendMessageCC.cpp,v
retrieving revision 1.189
retrieving revision 1.190
diff -b -u -2 -r1.189 -r1.190
--- SendMessageCC.cpp   11 Jun 2002 20:22:28 -0000      1.189
+++ SendMessageCC.cpp   12 Jun 2002 17:19:02 -0000      1.190
@@ -272,4 +272,13 @@
    // --------------------------------------------
 
+   // set up default value for From (Reply-To is set in InitNew() as it isn't
+   // needed for the resent messages)
+   AddressList_obj addrList(AddressList::CreateFromAddress(m_profile));
+   Address *addrFrom = addrList->GetFirst();
+   if ( addrFrom )
+   {
+      m_From = addrFrom->GetAddress();
+   }
+
    // remember the default hostname to use for addresses without host part
    m_DefaultHost = READ_CONFIG_TEXT(profile, MP_HOSTNAME);
@@ -304,4 +313,5 @@
 void SendMessageCC::InitNew()
 {
+   // FIXME: why do we do it here, it seems to be overwritten in Build()??
    m_Body->type = TYPEMULTIPART;
    m_Body->nested.part = mail_newbody_part();
@@ -310,12 +320,4 @@
    m_LastPart = m_NextPart;
 
-   // set up default values for From/Reply-To headers
-   AddressList_obj addrList(AddressList::CreateFromAddress(m_profile));
-   Address *addrFrom = addrList->GetFirst();
-   if ( addrFrom )
-   {
-      m_From = addrFrom->GetAddress();
-   }
-
    m_ReplyTo = READ_CONFIG_TEXT(m_profile, MP_REPLY_ADDRESS);
 
@@ -400,8 +402,8 @@
    m_Envelope->remail = cpystr(hdr.c_str());
 
-   // now copy the body: note that we have to use ENCOTHER here to prevent
+   // now copy the body: note that we have to use ENC7BIT here to prevent
    // c-client from (re)encoding the body
    m_Body->type = TYPETEXT;
-   m_Body->encoding = ENCOTHER;
+   m_Body->encoding = ENC7BIT;
    m_Body->subtype = cpystr("PLAIN");
 
@@ -986,9 +988,11 @@
    m_wasBuilt = true;
 
+   // this must be done for the new as well as resent messages: RFC 2822 says
+   // that Resent-From should be always present (section 3.6.6)
+   SetupFromAddresses();
+
    // don't add any more headers to the message being resent
    if ( !m_Envelope->remail )
    {
-      SetupFromAddresses();
-
       /*
          Is the message supposed to be sent later? In that case, we need


_______________________________________________________________

Sponsored by:
ThinkGeek at http://www.ThinkGeek.com/
_______________________________________________
Mahogany-cvsupdates mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates

Reply via email to