Gnus development mailing list
 help / color / mirror / Atom feed
* Multiple Mailings
@ 2019-09-08 19:07 Bob Newell
  2019-09-09  3:12 ` Eric Abrahamsen
  2019-09-09 20:11 ` Peter Münster
  0 siblings, 2 replies; 8+ messages in thread
From: Bob Newell @ 2019-09-08 19:07 UTC (permalink / raw)
  To: ding

Aloha everyone,

As many people do, I use the 'alias' feature of BBDB to set up mailing
lists. I typically expand the list into a BCC: field in my message, and
put in a generic address as the To: element. This works fine, as
expected, except that some spam filters don't like mail coming to a
generic address instead of the recipient's real address.

Well, in Gnus all is possible. So I found some code on the web and
modified it, so that an expanded mailing list is parsed and individual
mails get sent to the real address of each recipient. So, say 18 on the
list, 18 separate email transactions.

Very fine, except Gnus insists on prompting me for Each And Every Copy,
and that gets very tiresome. I think there could be a change
made. Looking in message.el, about line 4120 in my version, we have
this code fragment:

	(when (and (or (not (memq (car elem)
				  message-sent-message-via))
		       (message-fetch-field "supersedes")
		       (if (or (message-gnksa-enable-p 'multiple-copies)
			       (not (eq (car elem) 'news)))
			   (y-or-n-p
			    (format
			     "Already sent message via %s; resend? "
			     (car elem)))
			 (error "Denied posting -- multiple copies")))
		   (setq success (funcall (caddr elem) arg)))
	  (setq sent t))))

I thought that by enabling 'multiple-copies in the
'message-gnksa-shoot-feet variable, I would avoid prompting. But as the
code above shows (once I figured out the nestings!) that isn't the
case. 'multiple-copies only comes into play under certain circumstances,
and will never prevent prompting.

But shouldn't it? Is there really a reason to force prompting all the
time? Is that perhaps my use case--- automated single mailings to
multiple users--- is out of scope? (Or potentially very spammy, but I
should take responsibility for that.)

My workaround was to do temporary :around advice on y-or-n-p forcing 't'
but that's hackish to say the least.

Comments welcome. I could propose a patch but the logic is a little
complex and I would likely miss a paren somewhere.

-- 
Bob Newell
Honolulu, Hawai`i
* Via Gnus/BBDB/Org/Emacs/Linux *



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Multiple Mailings
  2019-09-08 19:07 Multiple Mailings Bob Newell
@ 2019-09-09  3:12 ` Eric Abrahamsen
  2019-09-09  4:33   ` Bob Newell
  2019-09-09 20:11 ` Peter Münster
  1 sibling, 1 reply; 8+ messages in thread
From: Eric Abrahamsen @ 2019-09-09  3:12 UTC (permalink / raw)
  To: ding

Bob Newell <bobnewell@bobnewell.net> writes:

> Aloha everyone,
>
> As many people do, I use the 'alias' feature of BBDB to set up mailing
> lists. I typically expand the list into a BCC: field in my message, and
> put in a generic address as the To: element. This works fine, as
> expected, except that some spam filters don't like mail coming to a
> generic address instead of the recipient's real address.
>
> Well, in Gnus all is possible. So I found some code on the web and
> modified it, so that an expanded mailing list is parsed and individual
> mails get sent to the real address of each recipient. So, say 18 on the
> list, 18 separate email transactions.
>
> Very fine, except Gnus insists on prompting me for Each And Every Copy,
> and that gets very tiresome. I think there could be a change
> made. Looking in message.el, about line 4120 in my version, we have
> this code fragment:
>
> 	(when (and (or (not (memq (car elem)
> 				  message-sent-message-via))
> 		       (message-fetch-field "supersedes")
> 		       (if (or (message-gnksa-enable-p 'multiple-copies)
> 			       (not (eq (car elem) 'news)))
> 			   (y-or-n-p
> 			    (format
> 			     "Already sent message via %s; resend? "
> 			     (car elem)))
> 			 (error "Denied posting -- multiple copies")))
> 		   (setq success (funcall (caddr elem) arg)))
> 	  (setq sent t))))
>
> I thought that by enabling 'multiple-copies in the
> 'message-gnksa-shoot-feet variable, I would avoid prompting. But as the
> code above shows (once I figured out the nestings!) that isn't the
> case. 'multiple-copies only comes into play under certain circumstances,
> and will never prevent prompting.
>
> But shouldn't it? Is there really a reason to force prompting all the
> time? Is that perhaps my use case--- automated single mailings to
> multiple users--- is out of scope? (Or potentially very spammy, but I
> should take responsibility for that.)

Looking at uses of `message-gnksa-enable-p', the behavior of that
function is to make the specified foot-gun *possible*, ie it won't be
denied automatically. But in all call sites (not just 'multiple-copies)
a prompt is still required. In other words the choice is between
automatic denial and prompting, not between prompting and automatic
acceptance.

I don't think we'd want to change that behavior, as it's pretty baked
in, and when you step back and look at it, what you're doing is actually
sending multiple messages, not multiple copies of the same message. I
would just write a little program to compose and send multiple messages,
using `compose-mail':

(dolist (rec (bbdb-do-records))
  (compose-mail (bbdb-dwim-mail rec)
		"Hi there"
		'(("Bcc" . "me@myself.com")))
  ;; If you're using message-mode
  (message-goto-body)
  (insert "Dear so-and-so,")
  (message-send-and-exit))

Untested! But hopefully an okay starting place.

(Obligatory shameless plug: EBDB has `ebdb-mail-each' which does this
for you.)




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Multiple Mailings
  2019-09-09  3:12 ` Eric Abrahamsen
@ 2019-09-09  4:33   ` Bob Newell
  2019-09-09  7:48     ` Eric Abrahamsen
       [not found]     ` <87lfuxq57r.fsf@ericabrahamsen.net>
  0 siblings, 2 replies; 8+ messages in thread
From: Bob Newell @ 2019-09-09  4:33 UTC (permalink / raw)
  To: Eric Abrahamsen; +Cc: ding


I see what you are doing in your code, but it didn't quite work for me
although I'm sure with some tweaking it could.

I solved the issue another way, which is hackish but at least a little
less so. The code is below; it's for my own environment, but could be
generally useful if the connectivity check were to be removed. I can't
take much credit; it's mostly stuff found on the web with a few of my
own changes.

I now get around the prompting by resetting 'message-sent-message-via to
nil, so gnus doesn't realize I'm sending duplicates and therefore
doesn't nag.

I tie 'message-send-and-exit-multiple to C-c C-m C-m in 'message-mode-map.

(defun message-send-and-exit-multiple ()
  (interactive) 
;;; Check connectivity once, assume(!) it stays up for the duration of
;;; the mass mailing.
  (if (outbound-port-test "smtp.gmail.com" 587)
      (progn
	(let ((addresses
	       (split-string
		(message-fetch-field "To")
		"," t)))
	  (while addresses
	    ;; Avoid prompts for mailing duplicate copies.
	    (setq message-sent-message-via nil)
	    (let ((address (car addresses)))
	      (setq addresses (cdr addresses))
	      (message-remove-header "To")
	      (message-add-header (format "To: %s" address))
	      (if addresses
  	        (message-send)
		(message-send-and-exit))))))
       (message "No smtp connectivity, save as draft instead")))

-- 
Bob Newell
Honolulu, Hawai`i
* Via Gnus/BBDB/Org/Emacs/Linux *



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Multiple Mailings
  2019-09-09  4:33   ` Bob Newell
@ 2019-09-09  7:48     ` Eric Abrahamsen
       [not found]     ` <87lfuxq57r.fsf@ericabrahamsen.net>
  1 sibling, 0 replies; 8+ messages in thread
From: Eric Abrahamsen @ 2019-09-09  7:48 UTC (permalink / raw)
  To: Bob Newell; +Cc: ding


On 09/08/19 18:33 PM, Bob Newell wrote:
> I see what you are doing in your code, but it didn't quite work for me
> although I'm sure with some tweaking it could.
>
> I solved the issue another way, which is hackish but at least a little
> less so. The code is below; it's for my own environment, but could be
> generally useful if the connectivity check were to be removed. I can't
> take much credit; it's mostly stuff found on the web with a few of my
> own changes.
>
> I now get around the prompting by resetting 'message-sent-message-via to
> nil, so gnus doesn't realize I'm sending duplicates and therefore
> doesn't nag.
>
> I tie 'message-send-and-exit-multiple to C-c C-m C-m in 'message-mode-map.
>
> (defun message-send-and-exit-multiple ()
>   (interactive) 
> ;;; Check connectivity once, assume(!) it stays up for the duration of
> ;;; the mass mailing.
>   (if (outbound-port-test "smtp.gmail.com" 587)
>       (progn
> 	(let ((addresses
> 	       (split-string
> 		(message-fetch-field "To")
> 		"," t)))
> 	  (while addresses
> 	    ;; Avoid prompts for mailing duplicate copies.
> 	    (setq message-sent-message-via nil)
> 	    (let ((address (car addresses)))
> 	      (setq addresses (cdr addresses))
> 	      (message-remove-header "To")
> 	      (message-add-header (format "To: %s" address))
> 	      (if addresses
>   	        (message-send)
> 		(message-send-and-exit))))))
>        (message "No smtp connectivity, save as draft instead")))

I don't suppose it really matters in the end, though the one thing I
would be wary of is the potential of sending multiple messages with the
same message ID. You're probably not going to end up breaking the
internet if you do, but I wouldn't be surprised if there's plenty of
software out there (including Gnus) that might get confused by identical
IDs.

Let's see if that actually happens...



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Multiple Mailings
       [not found]     ` <87lfuxq57r.fsf@ericabrahamsen.net>
@ 2019-09-09  7:50       ` Eric Abrahamsen
  0 siblings, 0 replies; 8+ messages in thread
From: Eric Abrahamsen @ 2019-09-09  7:50 UTC (permalink / raw)
  To: Bob Newell; +Cc: ding

Eric Abrahamsen <eric@ericabrahamsen.net> writes:

> On 09/08/19 18:33 PM, Bob Newell wrote:
>> I see what you are doing in your code, but it didn't quite work for me
>> although I'm sure with some tweaking it could.
>>
>> I solved the issue another way, which is hackish but at least a little
>> less so. The code is below; it's for my own environment, but could be
>> generally useful if the connectivity check were to be removed. I can't
>> take much credit; it's mostly stuff found on the web with a few of my
>> own changes.
>>
>> I now get around the prompting by resetting 'message-sent-message-via to
>> nil, so gnus doesn't realize I'm sending duplicates and therefore
>> doesn't nag.
>>
>> I tie 'message-send-and-exit-multiple to C-c C-m C-m in 'message-mode-map.
>>
>> (defun message-send-and-exit-multiple ()
>>   (interactive) 
>> ;;; Check connectivity once, assume(!) it stays up for the duration of
>> ;;; the mass mailing.
>>   (if (outbound-port-test "smtp.gmail.com" 587)
>>       (progn
>> 	(let ((addresses
>> 	       (split-string
>> 		(message-fetch-field "To")
>> 		"," t)))
>> 	  (while addresses
>> 	    ;; Avoid prompts for mailing duplicate copies.
>> 	    (setq message-sent-message-via nil)
>> 	    (let ((address (car addresses)))
>> 	      (setq addresses (cdr addresses))
>> 	      (message-remove-header "To")
>> 	      (message-add-header (format "To: %s" address))
>> 	      (if addresses
>>   	        (message-send)
>> 		(message-send-and-exit))))))
>>        (message "No smtp connectivity, save as draft instead")))
>
> I don't suppose it really matters in the end, though the one thing I
> would be wary of is the potential of sending multiple messages with the
> same message ID. You're probably not going to end up breaking the
> internet if you do, but I wouldn't be surprised if there's plenty of
> software out there (including Gnus) that might get confused by identical
> IDs.
>
> Let's see if that actually happens...
>
> Looks like it does?

No it doesn't! It resets the message-id.

Anyway! I still think it would be cleaner just to compose and send a
series of messages.



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Multiple Mailings
  2019-09-08 19:07 Multiple Mailings Bob Newell
  2019-09-09  3:12 ` Eric Abrahamsen
@ 2019-09-09 20:11 ` Peter Münster
  2019-09-09 21:30   ` Bob Newell
  1 sibling, 1 reply; 8+ messages in thread
From: Peter Münster @ 2019-09-09 20:11 UTC (permalink / raw)
  To: ding

[-- Attachment #1: Type: text/plain, Size: 295 bytes --]

On Sun, Sep 08 2019, Bob Newell wrote:

> except that some spam filters don't like mail coming to a generic
> address instead of the recipient's real address.

Then, I would suggest to fix the filter (or remove it), as it would
break also normal mailing-lists...

-- 
           Peter

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 194 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Multiple Mailings
  2019-09-09 20:11 ` Peter Münster
@ 2019-09-09 21:30   ` Bob Newell
  2019-09-09 21:49     ` Peter Münster
  0 siblings, 1 reply; 8+ messages in thread
From: Bob Newell @ 2019-09-09 21:30 UTC (permalink / raw)
  To: Peter Münster; +Cc: ding

>> except that some spam filters don't like mail coming to a generic
>> address instead of the recipient's real address.
>
> Then, I would suggest to fix the filter (or remove it), as it would
> break also normal mailing-lists...

Ideally, you are right, but this is not always under user control. Some
major webmail providers do this as a "service" and the only way around
it is for the user to whitelist the sender. Except ... (a) not all
services even support a whitelist and (b) the user needs to know what to
do.

-- 
Bob Newell
Honolulu, Hawai`i
* Via Gnus/BBDB/Org/Emacs/Linux *



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Multiple Mailings
  2019-09-09 21:30   ` Bob Newell
@ 2019-09-09 21:49     ` Peter Münster
  0 siblings, 0 replies; 8+ messages in thread
From: Peter Münster @ 2019-09-09 21:49 UTC (permalink / raw)
  To: ding

On Mon, Sep 09 2019, Bob Newell wrote:

> this is not always under user control.

It is: the user can change the provider. And I would even say: he
*should* change the provider, if buggy filters are imposed.

-- 
           Peter




^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2019-09-09 21:49 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-08 19:07 Multiple Mailings Bob Newell
2019-09-09  3:12 ` Eric Abrahamsen
2019-09-09  4:33   ` Bob Newell
2019-09-09  7:48     ` Eric Abrahamsen
     [not found]     ` <87lfuxq57r.fsf@ericabrahamsen.net>
2019-09-09  7:50       ` Eric Abrahamsen
2019-09-09 20:11 ` Peter Münster
2019-09-09 21:30   ` Bob Newell
2019-09-09 21:49     ` Peter Münster

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).