[Dovecot] deliver rewrites envelop-sender

Ralf Becker beckerr at fh-trier.de
Wed Jan 10 08:18:19 UTC 2007


Hello Gerhard,

it is maybe a little bit haarsplitting that I'm insisting to find the
original envelop sender in the "From " line (= FROM_ line). But in my
opinion this is part of the mbox format definition.

[http://www.qmail.org/man/man5/mbox.html]

>           The From_ line always looks like From envsender date
>           moreinfo.  envsender is one word, without spaces or tabs; it
>           is usually the envelope sender of the message. 

and

>      HOW A MESSAGE IS DELIVERED
>           Here is how a program appends a message to an mbox file.
> 
>           It first creates a From_ line given the message's envelope
>           sender and the current date.  If the envelope sender is
>           empty (i.e., if this is a bounce message), the program uses
>           MAILER-DAEMON instead.  If the envelope sender contains
>           spaces, tabs, or newlines, the program replaces them with
>           hyphens.

Dovecot uses mboxcl2, which basically handles the "From " line like
mboxo (=mbox?)

Indeed it's not a bug to ignore the envelop sender and use "From
MAIL-DEAMON ..." when delivering. But in this case deliver should add
  Return-Path: <envelop-sender>
if not already present

Think about bouncing a already delivered message:

This mail can be bounced
  From beckerr at fh-trier.de  Thu Dec  1 05:12:01 2005
  From: some-list <some-list at list-home.org>
  To: some-list <some-list at list-home.org>
  Subject: test

This message too
  From MAILER-DAEMON  Thu Dec  1 05:12:01 2005
  Return-Path: <beckerr at fh-trier.de>
  From: some-list <some-list at list-home.org>
  To: some-list <some-list at list-home.org>
  Subject: test

But this message can not be bounced, because the envelop sender is unknown:
  From MAILER-DAEMON  Thu Dec  1 05:12:01 2005
  From: some-list <some-list at list-home.org>
  To: some-list <some-list at list-home.org>
  Subject: test

ok... actually this messages could be bounced to, but would be bounced
to the mailing list, which is a bad idea :-)



And something completely different:

I've implemented DELIVER_SKIP_PATH testing. I don't want to publish a
patch for a patch. Do you want to put the new patch on your homepage or
should I but it on mine?

This is what I've added:

[src/mailfold.c @216]
  int isinbox = 0;
  if (s_org_mail) isinbox = !strcmp(s_org_mail, boxname);

// rb - start
  if (trydeliver && program)
  {
    char *skip_path = getenv("DELIVER_SKIP_PATH");
    if (skip_path)
    {
        char *i=skip_path;
        while (*i)
        {
            char *j, *k;

            for (j=i; *j && *j!=':'; j++)
                ;
            k=j;
            for (k=j; k>i && k[-1]=='/'; k--)
                ;

            if (i!=k && strncmp(boxname,i,k-i)==0 && (boxname[k-i]=='/'
|| !boxname[k-i]))
            {
                yell("skipping delivering through external program for
", boxname);
                program = NULL;
                break;
            }
            if (!*j) break;
            i=j+1;
        }
    }
  }
// rb - end
  if (trydeliver && program && ((!isinbox && !isabsolute) || (isinbox &&
deliver_inbox) || (isabsolute && deliver_absolute_path)) )
  {


Bye, Ralf


Gerhard Wiesinger schrieb am 09.01.2007 18:37:
> Hello!
> 
> Yes, DELIVER_SKIP_PATH would be a good idea. But I really wanted to
> avoid to use procmail at all.
> 
> BTW: What is your problem with the first FROM line, I really didn't
> unterstand the problem there?
> 
> Ciao,
> Gerhard
> 
> -- 
> http://www.wiesinger.com/
> 
> 
-- 
______________________________________________________________________

 Dipl.-Inform. (FH) Ralf Becker     Rechenzentrum (r/ft) der FH Trier
 (Network|Mail|Web|Firewall)           University of applied sciences
 Administrator                           Schneidershof, D-54293 Trier

 Mail: beckerr at fh-trier.de                      Fon: +49 651 8103 499
 WWW:  http://www.fh-trier.de/~beckerr          Fax: +49 651 8103 214
 PGP:  http://www.fh-trier.de/~beckerr/pgp      ICQ: <available>
______________________________________________________________________

 Wenn Gott gewollt haette, dass E-Mail in HTML geschrieben wuerden,
 endeten Gebete traditionell mit </amen>. (Tom Listen)



More information about the dovecot mailing list