Recent

Author Topic: Synapse forward an email  (Read 2464 times)

HatForCat

  • Sr. Member
  • ****
  • Posts: 293
Synapse forward an email
« on: February 17, 2019, 09:50:33 pm »
Hi, I am using Synapse to build a small mail program and I am wondering if there is an inbuilt "Forward" function.

Or, do I just create an outgoing email with the incoming header+body as the new body and send it out with a new header?

Is Forward something special or am I overthinking it?

Thanks
Acer-i5, 2.6GHz, 6GB, 500GB-SSD, Mint-19.3, Cinnamon Desktop, Lazarus 2.0.6, SQLite3

lucamar

  • Hero Member
  • *****
  • Posts: 4219
Re: Synapse forward an email
« Reply #1 on: February 17, 2019, 11:35:45 pm »
Forward is special in the sense that it's strictly a human activity: There is no provision in the standards (from RFC822 through all its updates) for "forwarding" per-se. Basically you copy the message and send as if it were yours.

As a question of manners, however, it's suggested that something be added to the messsage to indicate it's forwarded and not born of the sender's inspiration. The usual ways are:
  • adding "Fwd:" or similar to the subject;
  • adding a first line saing somthing like: "Forwarded from "someone" <someone@example.org>:"
  • adding special fields to the header, but this should be avoided since they aren't usually shown to the recipient
Do note also that Synapse deals mainly with transfer protocols, whereas forwarding is in the apllication/human level which implies that, as far as Synapse knows, there's no "forward": just a normal message From the Sender To the Recipient. Whatever the message contains ...


Note: I'm by no means an expert in Internet standards; everythng I say is my interpretation of what the standards say ... or don't say. I may well be more or less wrong!
« Last Edit: February 17, 2019, 11:42:26 pm by lucamar »
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

HatForCat

  • Sr. Member
  • ****
  • Posts: 293
Re: Synapse forward an email
« Reply #2 on: February 18, 2019, 12:18:05 am »
Forward is special in the sense that it's strictly a human activity: There is no provision in the standards (from RFC822 through all its updates) for "forwarding" per-se. Basically you copy the message and send as if it were yours.

OK, thanks, I only asked as about a year back my bank asked me to forward a suspicious email to them. If I sent just the body of it with my header assigned, they would not have been able to try and trace it back using the header information on the original incoming (to me) email. So I figured there must be a protocol for forwarding. I was using Thunderbird at the time so no idea how much detail it sent. :)

I think I will just combine the header plus the body as an outgoing "forward," should I ever have to do it. It seems pretty pointless just sending the body. But I am not an expert at any of this either.

As it later turned out the email was from the bank, their web-programmers had screwed up. duh. Thanks again.
Acer-i5, 2.6GHz, 6GB, 500GB-SSD, Mint-19.3, Cinnamon Desktop, Lazarus 2.0.6, SQLite3

lucamar

  • Hero Member
  • *****
  • Posts: 4219
Re: Synapse forward an email
« Reply #3 on: February 18, 2019, 01:47:36 am »
Humm ... A mail message consists, very basically, of an "envelope", i.e. the header with the From, To Date, ID, etc. and separated by a CRLF the mesage body.

Nothing in the standards says what has to go in the body (other than max length of lines and other "formatting" things): It may well be yet another message with its own headers+body.

It's not recommended to do so mainly because some UAs may get completely lost  trying to interpret such a message, but that really is a problem of the UA programmer not the standards per se. That leads to yet another solution: use the "cite" conventions to offset the original so that it can't be interpreted as a message itself.

I have to recognize that I've never received (or sent) a forwarded message so I don't really know what most UAs do in this case. A simple test would be forwarding a message to yourself (on another account) and compare with the original to see what's done.
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

HatForCat

  • Sr. Member
  • ****
  • Posts: 293
Re: Synapse forward an email
« Reply #4 on: February 18, 2019, 04:13:40 pm »
That leads to yet another solution: use the "cite" conventions to offset the original so that it can't be interpreted as a message itself.

Good thought, thanks, but it is way too much reading and work to do for something that may never be needed. If the W3C did not feel the need for a "forward" protocol, that's good enough for me. :D

I will add the option to forward, but will just do as you suggested and send the same body with my normal outgoing header.
Acer-i5, 2.6GHz, 6GB, 500GB-SSD, Mint-19.3, Cinnamon Desktop, Lazarus 2.0.6, SQLite3

lucamar

  • Hero Member
  • *****
  • Posts: 4219
Re: Synapse forward an email
« Reply #5 on: February 18, 2019, 07:44:10 pm »
It's better if you check what other UAs--say Thunderbird--are doing and implement it that way. Less surprises for your users :)
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

dsiders

  • Hero Member
  • *****
  • Posts: 1052
Re: Synapse forward an email
« Reply #6 on: February 18, 2019, 08:04:10 pm »
It's better if you check what other UAs--say Thunderbird--are doing and implement it that way. Less surprises for your users :)

And maybe use the newer RFC for Internet Message Format as a reference. https://tools.ietf.org/html/rfc5322
Preview Lazarus 3.99 documentation at: https://dsiders.gitlab.io/lazdocsnext

rvk

  • Hero Member
  • *****
  • Posts: 6111
Re: Synapse forward an email
« Reply #7 on: February 18, 2019, 09:03:32 pm »
I only asked as about a year back my bank asked me to forward a suspicious email to them. If I sent just the body of it with my header assigned, they would not have been able to try and trace it back using the header information on the original incoming (to me) email.
For this case they wanted you to forward the message as an attachment to a new e-mail. In that case they get the e-mail as attachment as it originally arrived in your inbox with all the headers.

There are lots of forms of 'forwards'. You could also just 'bounce' the mail to another person, as if that person was included in a bcc (blind carbon copy). Just taking the from, body and subject and prefixing fwd: to it, is another form.

 

TinyPortal © 2005-2018