Diff
Logged in as anonymous

Differences From Artifact [931424421b]:

To Artifact [bccbf7228d]:


122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
			if headers.to.is_empty() {
				bail!("No recipient addresses.");
			}
			for item in &headers.to {
				match self.recipients.get(item) {
					Some(addr) => rcpt.insert(addr),
					None => {
						self.debug(format!("Recipient [{}] not found.", &item)).await?;
						rcpt.insert(self.recipients.get("_")
							.ok_or(anyhow!("Missing default address in recipient table."))?)
					}
				};
			};
			if rcpt.is_empty() {
				self.debug("No recipient or envelope address.").await?;
				rcpt.insert(self.recipients.get("_")
					.ok_or(anyhow!("Missing default address in recipient table."))?);
			};

			// prepating message header
			let mut reply: Vec<Cow<'_, str>> = vec![];
			if let Some(subject) = mail.subject() {
				reply.push(format!("**Subject:** `{}`", subject).into());
			} else if let Some(thread) = mail.thread_name() {
				reply.push(format!("**Thread:** `{}`", thread).into());
			}
			reply.push(format!("**From:** `{}`", headers.from).into());
			reply.push("".into());
			let header_size = reply.join("\n").len() + 1;

			let html_parts = mail.html_body_count();
			let text_parts = mail.text_body_count();
			let attachments = mail.attachment_count();
			if html_parts != text_parts {
				self.debug(format!("Hm, we have {} HTML parts and {} text parts.", html_parts, text_parts)).await?;
			}
			//let mut html_num = 0;
			let mut text_num = 0;
			let mut file_num = 0;
			// let's display first html or text part as body
			let mut body = "".into();
			/*







|

|




|



















|







122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
			if headers.to.is_empty() {
				bail!("No recipient addresses.");
			}
			for item in &headers.to {
				match self.recipients.get(item) {
					Some(addr) => rcpt.insert(addr),
					None => {
						self.debug(format!("Recipient [{}] not found\\.", &item)).await?;
						rcpt.insert(self.recipients.get("_")
							.ok_or(anyhow!("Missing default address in recipient table\\."))?)
					}
				};
			};
			if rcpt.is_empty() {
				self.debug("No recipient or envelope address\\.").await?;
				rcpt.insert(self.recipients.get("_")
					.ok_or(anyhow!("Missing default address in recipient table."))?);
			};

			// prepating message header
			let mut reply: Vec<Cow<'_, str>> = vec![];
			if let Some(subject) = mail.subject() {
				reply.push(format!("**Subject:** `{}`", subject).into());
			} else if let Some(thread) = mail.thread_name() {
				reply.push(format!("**Thread:** `{}`", thread).into());
			}
			reply.push(format!("**From:** `{}`", headers.from).into());
			reply.push("".into());
			let header_size = reply.join("\n").len() + 1;

			let html_parts = mail.html_body_count();
			let text_parts = mail.text_body_count();
			let attachments = mail.attachment_count();
			if html_parts != text_parts {
				self.debug(format!("Hm, we have {} HTML parts and {} text parts\\.", html_parts, text_parts)).await?;
			}
			//let mut html_num = 0;
			let mut text_num = 0;
			let mut file_num = 0;
			// let's display first html or text part as body
			let mut body = "".into();
			/*