Discussion:
Has anyone created code for reply to author on yahoogroups?
Steinar Bang
2014-09-07 20:20:54 UTC
Permalink
Some time ago yahoogroups started changing the From emails, so that
emails from me to a yahoogroups list, looks like:
"Steinar Bang ***@dod.no [somelist]" <***@yahoogroups.com>
(where "somelist" is the name of a yahoogroups mailing list).

This meant that my old gnus setup for the mail group in gnus, which was
to do "f" to reply to the list and "r" to reply only to the author, no
longer worked.

Has anyone here created code to make "r" extract the sender email
address from the From field and reply directly to that?

If not, any ideas for the most elegant and simple solution?

Thanks!
lee
2014-09-08 00:45:22 UTC
Permalink
Post by Steinar Bang
Some time ago yahoogroups started changing the From emails, so that
(where "somelist" is the name of a yahoogroups mailing list).
This meant that my old gnus setup for the mail group in gnus, which was
to do "f" to reply to the list and "r" to reply only to the author, no
longer worked.
Has anyone here created code to make "r" extract the sender email
address from the From field and reply directly to that?
If not, any ideas for the most elegant and simple solution?
Look at the group setup (Gc in the group buffer) and set up the mailing
list address? I do that for lists, and it works fine, plus I have


(setq message-subscribed-address-functions
'(gnus-find-subscribed-addresses))


in .gnus, though I'm not too sure about this having the effect I would
assume it has.
--
Knowledge is volatile and fluid. Software is power.
Steinar Bang
2014-09-08 07:18:31 UTC
Permalink
Post by lee
Look at the group setup (Gc in the group buffer) and set up the mailing
list address?
No, that won't help. Setting to-address and (broken-reply-to . t) in
the group parameters work with the old style at yahoogroups and other
mailing list agents, where a reply-to header redirects repliers to the
list.

What Yahoogroups now does, is to mangle the sender, so that the actual
email address there is the list address. The address of the sender is
Post by lee
I do that for lists, and it works fine, plus I have
(setq message-subscribed-address-functions
'(gnus-find-subscribed-addresses))
in .gnus, though I'm not too sure about this having the effect I would
assume it has.
I don't know... what effect do you think it has...? :-)

(If you always reply, or post, inside the list's mail group, or if you
do 'C-u a' on top of the list's mail group, then you don't need it, I
think)
lee
2014-09-08 20:25:47 UTC
Permalink
Post by Steinar Bang
Post by lee
Look at the group setup (Gc in the group buffer) and set up the mailing
list address?
No, that won't help. Setting to-address and (broken-reply-to . t) in
the group parameters work with the old style at yahoogroups and other
mailing list agents, where a reply-to header redirects repliers to the
list.
What Yahoogroups now does, is to mangle the sender, so that the actual
email address there is the list address. The address of the sender is
Yahoo needs to fix their broken setup.

Other than that, you could pipe the mails through a perl script that
fixes the headers. The Email::Simple module does a pretty good job at
reading them. If you use an IMAP account, Net::IMAP::Client works well,
too --- only you may have to put in delays when fetching messages
consecutively because otherwise you may obtain a message that has no
body. It goes like this:


sub fix_data {
my ($msgbody) = @_;
#
# $msgbody is a string containing the complete message with all
# headers
#
my @h_subject = decode('MIME-Header', $email->header('Subject'));
my $fixed = [do something here and return fixed message];
return $fixed;
}


my $imap = Net::IMAP::Client->new(
server => SERVER,
user => USER,
pass => PASS,
ssl => 1,
ssl_verify_peer => 0,
port => 993)
or die "connection to imap server failed";

$imap->login or die "login failed\n";
$imap->select('INBOX');

foreach my $id ($imap->search('ALL')) {
foreach my $msg (@$id) {
my $data = $imap->get_rfc822_body($msg);
my $fixed = fix_headers($$data);
[somehow put fixed message as a new one on IMAP server];
#
# delete the original message
#
$imap->add_flags($msg, '\\Deleted');
sleep(20);
}
}
$imap->expunge;
$imap->logout;


If you have the messages in nnml storage or the like, it's much easier
of course.
Post by Steinar Bang
Post by lee
I do that for lists, and it works fine, plus I have
(setq message-subscribed-address-functions
'(gnus-find-subscribed-addresses))
in .gnus, though I'm not too sure about this having the effect I would
assume it has.
I don't know... what effect do you think it has...? :-)
IIRC it should make it so that I do not need to configure the groups I'm
using for mail from mailing lists.
Post by Steinar Bang
(If you always reply, or post, inside the list's mail group, or if you
do 'C-u a' on top of the list's mail group, then you don't need it, I
think)
I do either F, a or, rarely, R.
--
Knowledge is volatile and fluid. Software is power.
Steinar Bang
2014-09-09 05:16:39 UTC
Permalink
Post by lee
Post by Steinar Bang
I don't know... what effect do you think it has...? :-)
IIRC it should make it so that I do not need to configure the groups I'm
using for mail from mailing lists.
You still would have to set to-address, or something in the group
parameters, unless I'm misreading things...?
Steinar Bang
2014-09-09 05:22:20 UTC
Permalink
Post by lee
Yahoo needs to fix their broken setup.
Quite. I'm wondering if hiring a dedicated VPS and setting it up with
mailman wouldn't be simpler than dealing with yahoogroups' quirks...

The recent From-stuff is actually simple, compared to the problems I
have had with just getting people subscribed to the lists.
Post by lee
Other than that, you could pipe the mails through a perl script that
fixes the headers.
That might be an idea... thanks for the heads up. My yahoogroups'
filtering already has subject tag stripping in them.
Post by lee
The Email::Simple module does a pretty good job at reading them. If
you use an IMAP account, Net::IMAP::Client works well, too --- only
you may have to put in delays when fetching messages consecutively
because otherwise you may obtain a message that has no body.
I use dovecot with procmail(*) for mail filtering, so I would just put
the fix in there.


(*) I know it's old, ancient actually, but it works and setting up mail
filtering is boring...
Steinar Bang
2014-09-21 12:44:19 UTC
Permalink
Post by Steinar Bang
Post by lee
Other than that, you could pipe the mails through a perl script that
fixes the headers.
That might be an idea... thanks for the heads up. My yahoogroups'
filtering already has subject tag stripping in them.
[snip!]
Post by Steinar Bang
I use dovecot with procmail(*) for mail filtering, so I would just put
the fix in there.
Ok, now I've fixed the Yahoogroups.

I changed this:
:0
* ^TO_my-mailing-list@(intl.)?(e[Gg]roups|yahoogroups).com
{
:0 Afhw
| /bin/sed -e "s/\[my-mailing-list\] //g"
}

into this:
:0
* ^TO_my-mailing-list@(intl.)?(e[Gg]roups|yahoogroups).com
{
:0 Afhw
| /usr/bin/perl -ne "s/(^From: \".+) \[my-mailing-list\]\" .*/\1\"/ig; s/(^From: \")'([^']+)'/\1\2/g;s/ ([A-za-z0-9.]+@[A-za-z0-9.]+)\"/\" <\1>/g;s/(^From: .*)\"([A-za-z0-9.]+@[A-za-z0-9.]+)\"/\1<\2>/g; if (/^Subject: /) {s/\[my-mailing-list\] //ig;} print"
}
Post by Steinar Bang
(*) I know it's old, ancient actually, but it works and setting up mail
filtering is boring...
Speaking of ancient, my .procmailrc file also have this recipe, dating
back to the late ninties, but last touched in May of 2014, because of
the Android email client:
#
# Fix Subject RE/SV/AW line for MSExchange/MSMail/MSOutlook
# Also fix Subject field for Norwegian android mailer ("Vedr").
# No X-Mailer field to rely on, unfortunately!
# Remove MSE quotes of type "'Real Name'"
#
:0 fhw
| /usr/bin/perl -ne "s/\?[Ww]indows-1252\?/?iso-8859-1?/g; s/^(Subject:)\s+(S[Vv]:\s*|AW:\s*|Ad:\s*|Vedr:\s*|R[eE](\(\d+\))?:\s*)+/\1 Re: /g;s/^(Subject:)\s+(=\?((iso|ISO)-8859-1|us-ascii)\?Q\?)((S[Vv]|AW|Ad|R[eE](\(\d+\))?)(:|=3[Aa])_*)+/\1 \2Re:_/g; s/\042\'([^\']*)\'\042/\042\1\042/g ; print"

(The answer to the question "How many ways are there to break an email
header?", seems to be "inifinitly many"...)

Loading...