Envelopes using ActionMailer

Hello,

I have been developing a web application using ROR (hosted on
webricks/windows) which makes use of ActionMailer to send out mails to
various mailing lists. Recently, we came across a use case which
required that a particular user belonging to a mailing list should not
be sent out the mails. He cannot be removed from the mailing list
either. So I devised something like a negative subscriber list, where we
remove the user after expanding the mailing lists. The downside here was
that 'outlook-client' specific rules started breaking for other members
of the mailing-list. I came to know that Actionmailer supports envelope
viz., ''Return-Path'' header for reply-to component of e-mail. I was
wondering if there is any way that we can specify such envelopes for TO
and CC fields too.

I'm looking for something like what we have in sendmail of unix,

$sendmail user@dom.com

Hello,

I have been developing a web application using ROR (hosted on
webricks/windows) which makes use of ActionMailer to send out mails to
various mailing lists. Recently, we came across a use case which
required that a particular user belonging to a mailing list should not
be sent out the mails. He cannot be removed from the mailing list
either. So I devised something like a negative subscriber list,
where we
remove the user after expanding the mailing lists. The downside here
was
that 'outlook-client' specific rules started breaking for other
members
of the mailing-list. I came to know that Actionmailer supports
envelope
viz., ''Return-Path'' header for reply-to component of e-mail. I was
wondering if there is any way that we can specify such envelopes for
TO
and CC fields too.

You can set any header you want. In your mailer, set

@headers = {'return-path' => 'foo@bar.com', ...}

Fred

Frederick Cheung wrote:

remove the user after expanding the mailing lists. The downside here
was
that 'outlook-client' specific rules started breaking for other
members
of the mailing-list. I came to know that Actionmailer supports
envelope
viz., ''Return-Path'' header for reply-to component of e-mail. I was
wondering if there is any way that we can specify such envelopes for
TO
and CC fields too.

You can set any header you want. In your mailer, set

@headers = {'return-path' => 'foo@bar.com', ...}

Fred

Fred,

Many thanks for your lightning-quick inputs on this. I had tried doing
this with something like

@cc = ["x@bar.com","y@bar.com"]
.
.
@headers = {'cc' => 'foo@bar.com'}

The mails actually went through to foo@bar.com where as I wanted them to
go only to x@bar.com, y@bar.com.

Please let me know if I am missing something gross here.

Regards,
Shankar.

Many thanks for your lightning-quick inputs on this. I had tried doing
this with something like

@cc = ["x@bar.com","y@bar.com"]
.
.
@headers = {'cc' => 'foo@bar.com'}

The mails actually went through to foo@bar.com where as I wanted
them to
go only to x@bar.com, y@bar.com.

Well you'd have to say {'cc' => @cc} for this to have a chance of
working.

Fred

Frederick Cheung wrote:

Well you'd have to say {'cc' => @cc} for this to have a chance of
working.

Fred

Ah! my mistake. If I understand this right, once we set the header
fields, they would be ones to which the mails will be sent. What I want
is something like sendmail where the recipients are different from what
is indicated by the headers..

I'll put it this way...

x,y ,z are members of the list 'foo' and:

@cc = ["x@bar.com","y@bar.com","z@bar.com"]

Here z should not be sent a mail, and the cc fields for the mails sent
to x and y should still read the cc fields as 'foo'.

~Shankar.

Frederick Cheung wrote:

Well you'd have to say {'cc' => @cc} for this to have a chance of
working.

Fred

Ah! my mistake. If I understand this right, once we set the header
fields, they would be ones to which the mails will be sent. What I
want
is something like sendmail where the recipients are different from
what
is indicated by the headers..

ActionMailer doesn't have anything for specifiying recipients as
arguments to sendmail. You'd have to do that yourself

Fred

Frederick Cheung wrote: