sendmail removes bcc header unconditionally

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

sendmail removes bcc header unconditionally

Gordon Messmer-2
I'm working on improving my "sentfolder" mail filter.  This filter works
like GMail's SMTP system, copying messages that a user sends into their
sent folder, so that messages only need to traverse the network once.  
Courier IMAP has a better option, but no client support to speak of.

I've updated the sendfolder filter to examine the recipients in the
control files and the message file headers, and add a Bcc: header for
any addresses that don't appear in the message headers.  It then uses
sendmail to send a copy to the user, along with a header that marks it
for delivery to their sent folder. The problem here is that sendmail
unconditionally removes the bcc: header.  I think it might be better if
sendmail removed the bcc header only if it uses headers for the
destination addresses, and left the bcc header if it uses destinations
given as command line arguments.  Would that be an acceptable change?

I could work around the problem by using SMTP rather than sendmail, but
I prefer to use sendmail to avoid passing through the courier filters
(at least, in the default configuration).


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
courier-users mailing list
[hidden email]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: sendmail removes bcc header unconditionally

Sam Varshavchik
Gordon Messmer writes:

> I'm working on improving my "sentfolder" mail filter.  This filter works  
> like GMail's SMTP system, copying messages that a user sends into their sent  
> folder, so that messages only need to traverse the network once.  Courier  
> IMAP has a better option, but no client support to speak of.
>
> I've updated the sendfolder filter to examine the recipients in the control  
> files and the message file headers, and add a Bcc: header for any addresses  
> that don't appear in the message headers.  It then uses sendmail to send a  
> copy to the user, along with a header that marks it for delivery to their  
> sent folder. The problem here is that sendmail unconditionally removes the  
> bcc: header.  I think it might be better if sendmail removed the bcc header  
> only if it uses headers for the destination addresses, and left the bcc  
> header if it uses destinations given as command line arguments.  Would that  
> be an acceptable change?
>
> I could work around the problem by using SMTP rather than sendmail, but I  
> prefer to use sendmail to avoid passing through the courier filters (at  
> least, in the default configuration).
Would it work to simply use a custom header name instead of "Bcc:". Most  
email clients won't show it by default, but it's going to be there and can  
be looked at, in some way; and the email clients will also ignore it if the  
message is replied to.


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
courier-users mailing list
[hidden email]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users

attachment0 (817 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: sendmail removes bcc header unconditionally

Gordon Messmer-2
On 07/06/2017 03:54 AM, Sam Varshavchik wrote:
> Would it work to simply use a custom header name instead of "Bcc:".
> Most email clients won't show it by default, but it's going to be
> there and can be looked at, in some way; and the email clients will
> also ignore it if the message is replied to.


That's the other option I'm looking at, and I'm more likely to go that
route than introduce another message delivery code path in the
framework.  Some record is better than no record, but I feel like that
path would still be very slightly inferior to the solutions that Gmail
and Courier IMAP provide.  Is there a logical reason why sendmail should
remove the Bcc: header when headers aren't used to indicate recipients?


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
courier-users mailing list
[hidden email]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: sendmail removes bcc header unconditionally

Sam Varshavchik
Gordon Messmer writes:

> On 07/06/2017 03:54 AM, Sam Varshavchik wrote:
>> Would it work to simply use a custom header name instead of "Bcc:". Most  
>> email clients won't show it by default, but it's going to be there and can  
>> be looked at, in some way; and the email clients will also ignore it if the  
>> message is replied to.
>
>
> That's the other option I'm looking at, and I'm more likely to go that route  
> than introduce another message delivery code path in the framework.  Some  
> record is better than no record, but I feel like that path would still be  
> very slightly inferior to the solutions that Gmail and Courier IMAP  
> provide.  Is there a logical reason why sendmail should remove the Bcc:  
> header when headers aren't used to indicate recipients?
My recollection is hazy, but I thought that this was sendmail-sendmail's  
behavior, which was to simply strip off the Bcc: header from the mail.

The current version of sendmail's man page suggests – with some  
ambiguity – that only the -t option does that; so I don't know whether this  
was changed some time, or it was always like that.

I was curious as to the historical origin of this, and poking around the  
Intertubes all the references were to RFC 733 which only states that β€œthe  
contents of this field are not included in copies of the message sent to the  
primary and secondary recipients. Some systems may choose to include the  
text of the "Bcc" field only in the author(s)'s copy, while others may also  
include it in the text sent to all those indicated in the "Bcc" list.”  
without going into much detail of how the recipient list is established; but  
the "may" part's only logical intepretation is that the whole thing is  
always optional.

Still, from a certain point of view, sendmail-sendmail's behavior is quite  
reasonable, too. You can say that by explicitly specifying the recipient  
list this places the onus on the sender to identify the so-called "primary  
and secondary" recipients; with the presumption that the sender is  
responsible for formatting the message, and the sender is wholly responsible  
for including or omitting the contents of the Bcc. This is a reasonable  
position to make, so I'll change this.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
courier-users mailing list
[hidden email]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users

attachment0 (817 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: sendmail removes bcc header unconditionally

Gordon Messmer-2
On 07/06/2017 01:58 PM, Sam Varshavchik wrote:
> This is a reasonable position to make, so I'll change this.


Thanks very much, Sam.  If you push a patch into git (github looks a bit
out of date?) I'll test it.  Or, if you'd rather, I can modify sendmail
and send a patch.


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
courier-users mailing list
[hidden email]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: sendmail removes bcc header unconditionally

Sam Varshavchik
Gordon Messmer writes:

> On 07/06/2017 01:58 PM, Sam Varshavchik wrote:
>> This is a reasonable position to make, so I'll change this.
>
>
> Thanks very much, Sam.  If you push a patch into git (github looks a bit out  
> of date?) I'll test it.  Or, if you'd rather, I can modify sendmail and send  
> a patch.

Yeah, github was a couple of commits behind. Just pushed everything out, and  
it's up to date now.



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
courier-users mailing list
[hidden email]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users

attachment0 (817 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: sendmail removes bcc header unconditionally

Gordon Messmer-2
On 07/06/2017 05:09 PM, Sam Varshavchik wrote:
> Yeah, github was a couple of commits behind. Just pushed everything
> out, and it's up to date now.


Thanks, again.  Is this an accurate update to the sendmail document?


diff --git a/courier/courier/doc/sendmail.sgml
b/courier/courier/doc/sendmail.sgml
index 634b262..6f956c3 100644
--- a/courier/courier/doc/sendmail.sgml
+++ b/courier/courier/doc/sendmail.sgml
@@ -74,8 +74,8 @@ message and builds the recipient list from the
<literal moreinfo="none">To:</lit
  <literal moreinfo="none">Cc:</literal> and <literal
moreinfo="none">Bcc:</literal> headers.</para>

      <para>
-<command moreinfo="none">sendmail</command> always removes all <literal
moreinfo="none">Bcc:</literal>
-headers before sending the message.</para>
+<command moreinfo="none">sendmail</command> removes <literal
moreinfo="none">Bcc:</literal>
+headers before sending the message if recipients are not specified on
the command line.</para>

      <para>
  Some of the functionality described below is actually implemented by other
@@ -194,7 +194,7 @@ information.</para>
  Read <literal moreinfo="none">Bcc:</literal> headers only. Normally, if no
  recipients are specified, <command moreinfo="none">sendmail</command>
obtains the list of
  recipients by reading the <literal moreinfo="none">To:</literal>,
<literal moreinfo="none">Cc:</literal> and
-<literal moreinfo="none">Bcc:</literal> headers (<literal
moreinfo="none">Bcc:</literal> headers are always
+<literal moreinfo="none">Bcc:</literal> headers (<literal
moreinfo="none">Bcc:</literal> headers are then
  removed).
  The <literal moreinfo="none">-bcc</literal> option ignores <literal
moreinfo="none">To:</literal> and
  <literal moreinfo="none">Cc:</literal>


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
courier-users mailing list
[hidden email]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: sendmail removes bcc header unconditionally

Gordon Messmer-2
In reply to this post by Sam Varshavchik
Just tested my sentfolder filter, and the new Bcc: support works
nicely.  Thanks for your help, Sam.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
courier-users mailing list
[hidden email]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users
Loading...