All of lore.kernel.org
 help / color / mirror / Atom feed
* Treatment of Delivered-To headers (Re: mlmmj-recieve silently
@ 2006-01-21  3:10 Charlie Brady
  2006-01-21  8:44 ` Treatment of Delivered-To headers (Re: mlmmj-recieve silently discarding messagesail?) Mads Martin Joergensen
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Charlie Brady @ 2006-01-21  3:10 UTC (permalink / raw)
  To: mlmmj


On Fri, 20 Jan 2006, Morten K. Poulsen wrote:

> (now also sent to the list)
>
> Quoting Thomas Goirand <thomas@goirand.fr>:
>> Delivered-To: xen010503-gplhost-com-test-subscribe@xen010503.gplhost.com
> [snip]
>> Would it be possible that mlmmj discrads the message because of the 
>> Delivered-To:?
>
> Yes.
>
> Most likely because of this (mlmmj-process.c):
>
> 519         if(whichto && whichto->emaillist && whichto->emaillist[0]){
> 520                 recipextra = strstr(whichto->emaillist[0], 
> listdelim);
> 521                 if (recipextra)
> 522                         recipextra += strlen(listdelim);
> 523         } else
> 524                 recipextra = NULL;
> 525         myfree(listdelim);

And this:

...
         if(readhdrs[4].token) { /* Delivered-To: (envelope to) */
                 for(i = 0; i < readhdrs[4].valuecount; i++) {
                         find_email_adr(readhdrs[4].values[i], &dtoemails);
                 }
         }
...

The error here is that the Delivered-To header may not match the "envelope 
to", and in the case of virtual domains, it definitely won't. But there is 
no need to guess, just check $RECIPIENT in the environment.

Unless you tell me I'm way off track, I'll try to get a patch together. It 
should be safe to assume that $RECIPIENT won't be set under other MTAs. If 
you think it's not, then we could use a command line flag to only activate 
the environment check under qmail.

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

* Re: Treatment of Delivered-To headers (Re: mlmmj-recieve silently discarding messagesail?)
  2006-01-21  3:10 Treatment of Delivered-To headers (Re: mlmmj-recieve silently Charlie Brady
@ 2006-01-21  8:44 ` Mads Martin Joergensen
  2006-01-21 11:55 ` Treatment of Delivered-To headers (Re: mlmmj-recieve silently Morten K. Poulsen
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Mads Martin Joergensen @ 2006-01-21  8:44 UTC (permalink / raw)
  To: mlmmj

* Charlie Brady <charlieb@budge.apana.org.au> [Jan 21. 2006 04:10]:
> >Quoting Thomas Goirand <thomas@goirand.fr>:
> >>Delivered-To: xen010503-gplhost-com-test-subscribe@xen010503.gplhost.com
> >[snip]
> >>Would it be possible that mlmmj discrads the message because of the 
> >>Delivered-To:?
> >
> >Yes.
> >
> >Most likely because of this (mlmmj-process.c):
> >
> >519         if(whichto && whichto->emaillist && whichto->emaillist[0]){
> >520                 recipextra = strstr(whichto->emaillist[0], 
> >listdelim);
> >521                 if (recipextra)
> >522                         recipextra += strlen(listdelim);
> >523         } else
> >524                 recipextra = NULL;
> >525         myfree(listdelim);
> 
> And this:
> 
> ...
>         if(readhdrs[4].token) { /* Delivered-To: (envelope to) */
>                 for(i = 0; i < readhdrs[4].valuecount; i++) {
>                         find_email_adr(readhdrs[4].values[i], &dtoemails);
>                 }
>         }
> ...
> 
> The error here is that the Delivered-To header may not match the "envelope 
> to", and in the case of virtual domains, it definitely won't. But there is 
> no need to guess, just check $RECIPIENT in the environment.
> 
> Unless you tell me I'm way off track, I'll try to get a patch together. It 
> should be safe to assume that $RECIPIENT won't be set under other MTAs. If 
> you think it's not, then we could use a command line flag to only activate 
> the environment check under qmail.

I would love a patch doing this, with a a commandline option to
configure it. No need to read environment variables anywhere else than
qmail AFAIK.

But I've to admit, that when I wrote this, I deliberately always had in
mind that I ever would need to support qmail. My rationale was that if
one's using qmail, one would just use ezmlm anyway...

-- 
Mads Martin Joergensen, http://mmj.dk
"Why make things difficult, when it is possible to make them cryptic
 and totally illogical, with just a little bit more effort?"
                                 -- A. P. J.

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

* Re: Treatment of Delivered-To headers (Re: mlmmj-recieve silently
  2006-01-21  3:10 Treatment of Delivered-To headers (Re: mlmmj-recieve silently Charlie Brady
  2006-01-21  8:44 ` Treatment of Delivered-To headers (Re: mlmmj-recieve silently discarding messagesail?) Mads Martin Joergensen
@ 2006-01-21 11:55 ` Morten K. Poulsen
  2006-01-21 11:56 ` Treatment of Delivered-To headers (Re: mlmmj-recieve silently discarding messagesail?) Mads Martin Joergensen
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Morten K. Poulsen @ 2006-01-21 11:55 UTC (permalink / raw)
  To: mlmmj

Quoting Mads Martin Joergensen <mmj@mmj.dk>:
>> Unless you tell me I'm way off track, I'll try to get a patch together. It
>> should be safe to assume that $RECIPIENT won't be set under other MTAs. If
>> you think it's not, then we could use a command line flag to only activate
>> the environment check under qmail.
>
> I would love a patch doing this, with a a commandline option to
> configure it. No need to read environment variables anywhere else than
> qmail AFAIK.

Do we need a commandline switch? If qmail puts the values (which other 
MTAs put in headers) in environment variables, the code could be 
changed to something like the following pseudo code:

envelope_to = getenv("RECIPIENT");

if (!envelope_to)
    envelope_to = getheader("Delivered-To");

if (!envelope_to)
    envelope_to = getheader("To");

if (!envelope_to)
    abort();

... and likewise for sender.

Having an extra commandline switch just makes it a tiny bit more 
difficult to set up.

Morten

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

* Re: Treatment of Delivered-To headers (Re: mlmmj-recieve silently discarding messagesail?)
  2006-01-21  3:10 Treatment of Delivered-To headers (Re: mlmmj-recieve silently Charlie Brady
  2006-01-21  8:44 ` Treatment of Delivered-To headers (Re: mlmmj-recieve silently discarding messagesail?) Mads Martin Joergensen
  2006-01-21 11:55 ` Treatment of Delivered-To headers (Re: mlmmj-recieve silently Morten K. Poulsen
@ 2006-01-21 11:56 ` Mads Martin Joergensen
  2006-01-21 12:05 ` Treatment of Delivered-To headers (Re: mlmmj-recieve silently Morten K. Poulsen
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Mads Martin Joergensen @ 2006-01-21 11:56 UTC (permalink / raw)
  To: mlmmj

* Morten K. Poulsen <morten@afdelingp.dk> [Jan 21. 2006 12:55]:
> Quoting Mads Martin Joergensen <mmj@mmj.dk>:
> >>Unless you tell me I'm way off track, I'll try to get a patch together. It
> >>should be safe to assume that $RECIPIENT won't be set under other MTAs. If
> >>you think it's not, then we could use a command line flag to only activate
> >>the environment check under qmail.
> >
> >I would love a patch doing this, with a a commandline option to
> >configure it. No need to read environment variables anywhere else than
> >qmail AFAIK.
> 
> Do we need a commandline switch? If qmail puts the values (which other 
> MTAs put in headers) in environment variables, the code could be 
> changed to something like the following pseudo code:
> 
> envelope_to = getenv("RECIPIENT");
> 
> if (!envelope_to)
>    envelope_to = getheader("Delivered-To");
> 
> if (!envelope_to)
>    envelope_to = getheader("To");
> 
> if (!envelope_to)
>    abort();
> 
> ... and likewise for sender.
> 
> Having an extra commandline switch just makes it a tiny bit more 
> difficult to set up.

Agreed it's a bit more difficult. I'm just pr. default cautious about
reading environment variables :-)

-- 
Mads Martin Joergensen, http://mmj.dk
"Why make things difficult, when it is possible to make them cryptic
 and totally illogical, with just a little bit more effort?"
                                 -- A. P. J.

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

* Re: Treatment of Delivered-To headers (Re: mlmmj-recieve silently
  2006-01-21  3:10 Treatment of Delivered-To headers (Re: mlmmj-recieve silently Charlie Brady
                   ` (2 preceding siblings ...)
  2006-01-21 11:56 ` Treatment of Delivered-To headers (Re: mlmmj-recieve silently discarding messagesail?) Mads Martin Joergensen
@ 2006-01-21 12:05 ` Morten K. Poulsen
  2006-01-21 15:33 ` Treatment of Delivered-To headers (Re: mlmmj-recieve silently discarding messagesail?) Mads Martin Joergensen
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Morten K. Poulsen @ 2006-01-21 12:05 UTC (permalink / raw)
  To: mlmmj

Quoting Mads Martin Joergensen <mmj@mmj.dk>:
>> Having an extra commandline switch just makes it a tiny bit more
>> difficult to set up.
>
> Agreed it's a bit more difficult. I'm just pr. default cautious about
> reading environment variables :-)

Fair enough :-)

I've been searching a bit, and it appears that Postfix and Exim also 
sets the environment variables, although EXTENSION must be configured 
for Exim.

http://tmda.net/config-pre.html

Morten

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

* Re: Treatment of Delivered-To headers (Re: mlmmj-recieve silently discarding messagesail?)
  2006-01-21  3:10 Treatment of Delivered-To headers (Re: mlmmj-recieve silently Charlie Brady
                   ` (3 preceding siblings ...)
  2006-01-21 12:05 ` Treatment of Delivered-To headers (Re: mlmmj-recieve silently Morten K. Poulsen
@ 2006-01-21 15:33 ` Mads Martin Joergensen
  2006-01-21 19:20 ` Treatment of Delivered-To headers (Re: mlmmj-recieve silently Charlie Brady
  2006-01-21 19:23 ` Charlie Brady
  6 siblings, 0 replies; 8+ messages in thread
From: Mads Martin Joergensen @ 2006-01-21 15:33 UTC (permalink / raw)
  To: mlmmj

* Morten K. Poulsen <morten@afdelingp.dk> [Jan 21. 2006 13:06]:
> Quoting Mads Martin Joergensen <mmj@mmj.dk>:
> >>Having an extra commandline switch just makes it a tiny bit more
> >>difficult to set up.
> >
> >Agreed it's a bit more difficult. I'm just pr. default cautious about
> >reading environment variables :-)
> 
> Fair enough :-)
> 
> I've been searching a bit, and it appears that Postfix and Exim also 
> sets the environment variables, although EXTENSION must be configured 
> for Exim.

If these are set, would it perhaps be possible to invoke it like this
from /etc/aliases or .qmail-foo?

 mlmmj-recieve -L /path/to/list -R $RECIPIENT

-- 
Mads Martin Joergensen, http://mmj.dk
"Why make things difficult, when it is possible to make them cryptic
 and totally illogical, with just a little bit more effort?"
                                 -- A. P. J.

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

* Re: Treatment of Delivered-To headers (Re: mlmmj-recieve silently
  2006-01-21  3:10 Treatment of Delivered-To headers (Re: mlmmj-recieve silently Charlie Brady
                   ` (4 preceding siblings ...)
  2006-01-21 15:33 ` Treatment of Delivered-To headers (Re: mlmmj-recieve silently discarding messagesail?) Mads Martin Joergensen
@ 2006-01-21 19:20 ` Charlie Brady
  2006-01-21 19:23 ` Charlie Brady
  6 siblings, 0 replies; 8+ messages in thread
From: Charlie Brady @ 2006-01-21 19:20 UTC (permalink / raw)
  To: mlmmj


On Sat, 21 Jan 2006, Morten K. Poulsen wrote:

> Do we need a commandline switch? If qmail puts the values (which other MTAs 
> put in headers) in environment variables, the code could be changed to 
> something like the following pseudo code:
>
> envelope_to = getenv("RECIPIENT");
>
> if (!envelope_to)
> envelope_to = getheader("Delivered-To");
>
> if (!envelope_to)
> envelope_to = getheader("To");
>
> if (!envelope_to)
> abort();
>
> ... and likewise for sender.

That looks a fine suggestion to me. Clean and simple.

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

* Re: Treatment of Delivered-To headers (Re: mlmmj-recieve silently
  2006-01-21  3:10 Treatment of Delivered-To headers (Re: mlmmj-recieve silently Charlie Brady
                   ` (5 preceding siblings ...)
  2006-01-21 19:20 ` Treatment of Delivered-To headers (Re: mlmmj-recieve silently Charlie Brady
@ 2006-01-21 19:23 ` Charlie Brady
  6 siblings, 0 replies; 8+ messages in thread
From: Charlie Brady @ 2006-01-21 19:23 UTC (permalink / raw)
  To: mlmmj


On Sat, 21 Jan 2006, Mads Martin Joergensen wrote:

> Agreed it's a bit more difficult. I'm just pr. default cautious about
> reading environment variables :-)

Perhaps because many system designs are incautious about adding 
environment variables. SysV init is one such system. As soon as an admin 
does "/etc/rc.d/init.d/some_daemon restart" the new daemon is likely to 
have a different environment to the old.

See daemontools or runit for an alternative system for running daemons 
with consistent reliable environment variable setup.

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

end of thread, other threads:[~2006-01-21 19:23 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-01-21  3:10 Treatment of Delivered-To headers (Re: mlmmj-recieve silently Charlie Brady
2006-01-21  8:44 ` Treatment of Delivered-To headers (Re: mlmmj-recieve silently discarding messagesail?) Mads Martin Joergensen
2006-01-21 11:55 ` Treatment of Delivered-To headers (Re: mlmmj-recieve silently Morten K. Poulsen
2006-01-21 11:56 ` Treatment of Delivered-To headers (Re: mlmmj-recieve silently discarding messagesail?) Mads Martin Joergensen
2006-01-21 12:05 ` Treatment of Delivered-To headers (Re: mlmmj-recieve silently Morten K. Poulsen
2006-01-21 15:33 ` Treatment of Delivered-To headers (Re: mlmmj-recieve silently discarding messagesail?) Mads Martin Joergensen
2006-01-21 19:20 ` Treatment of Delivered-To headers (Re: mlmmj-recieve silently Charlie Brady
2006-01-21 19:23 ` Charlie Brady

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.