Loading ...
Sorry, an error occurred while loading the content.

Preventing the addition of a 'From ' line with local(8)?

Expand Messages
  • Andrei POPESCU
    Hi, I m using a postfix for local e-mail with Unix user(s) only and mailbox_command = maildrop . As of 2.7 maildrop is not stripping the From line as it
    Message 1 of 11 , Mar 8 8:44 AM
    • 0 Attachment
      Hi,

      I'm using a postfix for local e-mail with Unix user(s) only and
      'mailbox_command = maildrop'. As of 2.7 maildrop is not stripping the
      'From ' line as it used to
      https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=737383 and other mail
      tools are complaining about it.

      Of course, I could plug in 'reformail -f0' as suggested by maildrop
      upstream, but local(8) is able to also deliver without adding the
      additional 'From ' line (external file delivery).

      For the moment I chose to use 'home_mailbox = Maildir/', but I'm
      planning to use postfix for all my e-mail and I need the sorting
      capabilities of maildrop.

      I could also create a 'maildrop' destination and use pipe(8), but this
      requires maildrop to be suid root, which I'd rather avoid (besides
      complicating the setup somewhat).

      Would it make sense to introduce an option to prevent local(8) from
      adding the additional 'From ' line?

      Kind regards,
      Andrei
      --
      If you can't explain it simply, you don't understand it well enough.
      (Albert Einstein)
      http://nuvreauspam.ro/gpg-transition.txt
    • Noel Jones
      ... Hash: SHA1 On 3/8/2014 10:44 AM, Andrei POPESCU wrote: Seems as if adding a trailing / to mail_spool_directory would be sufficient. Then you could leave
      Message 2 of 11 , Mar 8 11:28 AM
      • 0 Attachment
        -----BEGIN PGP SIGNED MESSAGE-----
        Hash: SHA1

        On 3/8/2014 10:44 AM, Andrei POPESCU wrote:



        Seems as if adding a trailing '/' to mail_spool_directory would be
        sufficient. Then you could leave home_mailbox unset.

        http://www.postfix.org/postconf.5.html#mail_spool_directory




        -- Noel Jones
        -----BEGIN PGP SIGNATURE-----
        Version: GnuPG v2.0.22 (MingW32)
        Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

        iQEcBAEBAgAGBQJTG29aAAoJEJGRUHb5Oh6glSoH/0YE2L4WhJZRfuqi2DokoXZG
        JCwFHITbypJD6diuDGvyqRgulryg1PpL46csPfh2ED78fHqz0tp6XKDuI/qAN3Fd
        4yY3aS4WQfTMa7Mge5WVMtTAJRTyY4PVHNdOHWWfgBcJb8ETPjGVVpOd3vSxFoVl
        HXZPiOWg4nxBKc0zTID7sqv121Nkjk8L4Vao9fP24jqUbdXk6ENjaiMqh1woxT2N
        ZLrDFkQrZ9vd1N1KuDeJ9+0GUH0OCw8k1p2JvN+W5MffHUE4h2GS1kBui1eeDlxs
        O5UFxBE6Qwl9NlrKzGEIJS5xw/FFVrhCAZAxdnstxmUegDBditaMZvvn9p8vgSs=
        =jA6t
        -----END PGP SIGNATURE-----
      • Noel Jones
        ... Hash: SHA1 ... Seems as if adding a trailing / to mail_spool_directory would be sufficient. Then you could leave home_mailbox unset.
        Message 3 of 11 , Mar 8 11:28 AM
        • 0 Attachment
          -----BEGIN PGP SIGNED MESSAGE-----
          Hash: SHA1

          On 3/8/2014 10:44 AM, Andrei POPESCU wrote:
          > Hi,
          >
          > I'm using a postfix for local e-mail with Unix user(s) only
          > and 'mailbox_command = maildrop'. As of 2.7 maildrop is not
          > stripping the 'From ' line as it used to
          > https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=737383 and
          > other mail tools are complaining about it.
          >
          > Of course, I could plug in 'reformail -f0' as suggested by
          > maildrop upstream, but local(8) is able to also deliver
          > without adding the additional 'From ' line (external file
          > delivery).
          >
          > For the moment I chose to use 'home_mailbox = Maildir/', but
          > I'm planning to use postfix for all my e-mail and I need the
          > sorting capabilities of maildrop.
          >
          > I could also create a 'maildrop' destination and use pipe(8),
          > but this requires maildrop to be suid root, which I'd rather
          > avoid (besides complicating the setup somewhat).
          >
          > Would it make sense to introduce an option to prevent local(8)
          > from adding the additional 'From ' line?
          >
          > Kind regards, Andrei
          >


          Seems as if adding a trailing '/' to mail_spool_directory would be
          sufficient. Then you could leave home_mailbox unset.

          http://www.postfix.org/postconf.5.html#mail_spool_directory




          -- Noel Jones
          -----BEGIN PGP SIGNATURE-----
          Version: GnuPG v2.0.22 (MingW32)
          Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

          iQEcBAEBAgAGBQJTG29eAAoJEJGRUHb5Oh6g6IYIAIT4XmV9Y0WQX8uC+aIUSvfd
          +98GZWmn4NsD4qmH40XjTZS+87RkmOhQLYOHz9KqHVVen5i+8O2ExOEvmA6fsdd9
          nZx82BmWvE2/461inVH7x/GhrvKp/djxHmbv9l/msyW1IXmKVvVkpmKGhb1dkfWi
          S4UE7AlygB44VjD/achMFYcs3Hmf0x//PELvapNlZoq6qjvDAd/3V8RBj4HjUsx4
          7masssvEfJiGKJsj4jk0Dxvpqr+oDgvTHrVsVY5Yt2P1QI3MXI/5ioSzjK/kbXgT
          o1u1aJXLrhWfpQZwDz8HYA+snfjNO8AM/OxNOaTscB6vP9R9CiEz2MWdxW3cg40=
          =f9Ni
          -----END PGP SIGNATURE-----
        • Andrei POPESCU
          ... Sorry, but I don t see how this would help, could you please elaborate? Besides, it seems like maibox_command takes precedence over mail_spool_directory:
          Message 4 of 11 , Mar 8 11:49 AM
          • 0 Attachment
            On Sb, 08 mar 14, 13:28:30, Noel Jones wrote:
            > On 3/8/2014 10:44 AM, Andrei POPESCU wrote:
            > >
            > > Would it make sense to introduce an option to prevent local(8)
            > > from adding the additional 'From ' line?
            >
            > Seems as if adding a trailing '/' to mail_spool_directory would be
            > sufficient. Then you could leave home_mailbox unset.

            Sorry, but I don't see how this would help, could you please elaborate?

            Besides, it seems like maibox_command takes precedence over
            mail_spool_directory:

            http://www.postfix.org/postconf.5.html#mailbox_command

            Kind regards,
            Andrei
            --
            If you can't explain it simply, you don't understand it well enough.
            (Albert Einstein)
            http://nuvreauspam.ro/gpg-transition.txt
          • Noel Jones
            ... Hash: SHA1 ... http://www.postfix.org/postconf.5.html#mail_spool_directory mail_spool_directory modifies how local(8) behaves. This isn t the same as
            Message 5 of 11 , Mar 8 1:00 PM
            • 0 Attachment
              -----BEGIN PGP SIGNED MESSAGE-----
              Hash: SHA1

              On 3/8/2014 1:49 PM, Andrei POPESCU wrote:
              > On Sb, 08 mar 14, 13:28:30, Noel Jones wrote:
              >> On 3/8/2014 10:44 AM, Andrei POPESCU wrote:
              >>>
              >>> Would it make sense to introduce an option to prevent
              >>> local(8) from adding the additional 'From ' line?
              >>
              >> Seems as if adding a trailing '/' to mail_spool_directory
              >> would be sufficient. Then you could leave home_mailbox
              >> unset.
              >
              > Sorry, but I don't see how this would help, could you please
              > elaborate?
              >
              > Besides, it seems like maibox_command takes precedence over
              > mail_spool_directory:
              >
              > http://www.postfix.org/postconf.5.html#mailbox_command
              >
              > Kind regards, Andrei
              >


              http://www.postfix.org/postconf.5.html#mail_spool_directory

              mail_spool_directory modifies how local(8) behaves. This isn't the
              same as mailbox_command, which specifies a command local(8) should
              pass mail to.

              If that doesn't work as expected, please report so that someone
              else can make a suggestion.



              -- Noel Jones
              -----BEGIN PGP SIGNATURE-----
              Version: GnuPG v2.0.22 (MingW32)
              Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

              iQEcBAEBAgAGBQJTG4TaAAoJEJGRUHb5Oh6g7uEH/02jQBWz3OxXITEh+Ml3lW5b
              xBtHWoOiQj6lrNfT9oXJ3r4ENm2oICcNaxMHYcT7pNwGhPKsvQYy6unsOzHyfZ81
              NVS02fgLDIieBeRnZmESJgleI3vIMzs39x4UF0GpWcbwt9I0lMN3fF48amdRvvjV
              NNOVhST/1HtoHe0yCjFJQM4TkxU2PPx8qfgNODgyGa6PLez17KvNR66P2yKyYp7Q
              KmSLrn6av68bHCitnkNvm8ltQgW1A4sDP1u+6vXcAxfqntUxp0qkL2ipbABGtCb+
              WCNUira2KtW1Dlgxv8JwD+F/3blNSPTQP5co4tGE6bggSQG4tTNdmjjfQ/WBgWY=
              =98fm
              -----END PGP SIGNATURE-----
            • Andrei POPESCU
              ... It did just as I would expect from the documentation, i.e. local(8) passed the message to maildrop and prepended a From line: EXTERNAL COMMAND DELIVERY
              Message 6 of 11 , Mar 9 1:24 AM
              • 0 Attachment
                On Sb, 08 mar 14, 15:00:10, Noel Jones wrote:
                >
                > http://www.postfix.org/postconf.5.html#mail_spool_directory
                >
                > mail_spool_directory modifies how local(8) behaves. This isn't the
                > same as mailbox_command, which specifies a command local(8) should
                > pass mail to.
                >
                > If that doesn't work as expected, please report so that someone
                > else can make a suggestion.

                It did just as I would expect from the documentation, i.e. local(8)
                passed the message to maildrop and prepended a 'From ' line:

                EXTERNAL COMMAND DELIVERY

                [...]
                The local(8) daemon prepends a "From sender time_stamp" envelope
                header to each message, prepends an X-Original-To: header with the
                recipient address as given to Postfix, prepends an optional
                Delivered-To: header with the final recipient envelope address,
                prepends a Return-Path: header with the sender envelope address,
                and appends no empty line.

                http://www.postfix.org/local.8.html

                Kind regards,
                Andrei
                --
                If you can't explain it simply, you don't understand it well enough.
                (Albert Einstein)
                http://nuvreauspam.ro/gpg-transition.txt
              • Viktor Dukhovni
                ... The local(8) delivery agent unconditionally prepends From except when delivering directly to a maildir. There are no configuration parameters that
                Message 7 of 11 , Mar 9 10:46 AM
                • 0 Attachment
                  On Sun, Mar 09, 2014 at 11:24:02AM +0200, Andrei POPESCU wrote:

                  > It did just as I would expect from the documentation, i.e. local(8)
                  > passed the message to maildrop and prepended a 'From ' line:
                  >
                  > EXTERNAL COMMAND DELIVERY
                  >
                  > [...]
                  > The local(8) daemon prepends a "From sender time_stamp" envelope
                  > header to each message, prepends an X-Original-To: header with the
                  > recipient address as given to Postfix, prepends an optional
                  > Delivered-To: header with the final recipient envelope address,
                  > prepends a Return-Path: header with the sender envelope address,
                  > and appends no empty line.
                  >
                  > http://www.postfix.org/local.8.html

                  The local(8) delivery agent unconditionally prepends "From " except
                  when delivering directly to a maildir. There are no configuration
                  parameters that enable or disable this behaviour.

                  Thus when delivering via a mailbox_command, the "From " line is
                  always prepended.

                  --
                  Viktor.
                • Andrei POPESCU
                  ... Thanks, that confirms my understanding. Wouldn t it however make sense to have this configurable? How many delivery agents actually need that in 2014? Kind
                  Message 8 of 11 , Mar 10 1:45 PM
                  • 0 Attachment
                    On Du, 09 mar 14, 17:46:26, Viktor Dukhovni wrote:
                    >
                    > The local(8) delivery agent unconditionally prepends "From " except
                    > when delivering directly to a maildir. There are no configuration
                    > parameters that enable or disable this behaviour.
                    >
                    > Thus when delivering via a mailbox_command, the "From " line is
                    > always prepended.

                    Thanks, that confirms my understanding. Wouldn't it however make sense
                    to have this configurable? How many delivery agents actually need that
                    in 2014?

                    Kind regards,
                    Andrei
                    --
                    If you can't explain it simply, you don't understand it well enough.
                    (Albert Einstein)
                    http://nuvreauspam.ro/gpg-transition.txt
                  • Viktor Dukhovni
                    ... In addition to serving as the mbox delimiter, the From line also records the envelope sender and message arrival time. It has been part of the local
                    Message 9 of 11 , Mar 10 2:49 PM
                    • 0 Attachment
                      On Mon, Mar 10, 2014 at 10:45:36PM +0200, Andrei POPESCU wrote:

                      > > Thus when delivering via a mailbox_command, the "From " line is
                      > > always prepended.
                      >
                      > Thanks, that confirms my understanding. Wouldn't it however make sense
                      > to have this configurable? How many delivery agents actually need that
                      > in 2014?

                      In addition to serving as the mbox delimiter, the "From " line also
                      records the envelope sender and message arrival time. It has been
                      part of the local delivery interface for a long time. So in 2014
                      I would expect things that have worked for 30+ years to continue
                      to work.

                      If you have an LDA that needs to run as the user (most don't these
                      days) and does not support "From ", you'll need to strip it out
                      for now.

                      The local delivery agent does not currently have a configuration
                      option to not prepend "From " when piping mail to commands.

                      There are multiple command contexts:

                      - mailbox_command
                      - mailbox_command_maps
                      - "|cmd" in a .forward file
                      - "|cmd" on the right side of an alias

                      If there were a parameter to suppress "From ", which of these would
                      you expect it to apply to? Recall that not prepending "From " is
                      likely to cause problems with commands that are not prepared for
                      this.

                      On the whole, the feature is, I think, dubious. It is better for
                      all commands to receive the message in a standard form, and act
                      accordingly. Therefore, the problem is I think in the LDA that
                      no longer supports "From ", it needs to be configurable to allow
                      "From ".

                      --
                      Viktor.
                    • Andrei POPESCU
                      ... Except that tools complain if Maildir messages begin with a From line and all that information is (already) present in the headers. ... Not exactly,
                      Message 10 of 11 , Mar 10 4:08 PM
                      • 0 Attachment
                        On Lu, 10 mar 14, 21:49:55, Viktor Dukhovni wrote:
                        > On Mon, Mar 10, 2014 at 10:45:36PM +0200, Andrei POPESCU wrote:
                        > >
                        > > Thanks, that confirms my understanding. Wouldn't it however make sense
                        > > to have this configurable? How many delivery agents actually need that
                        > > in 2014?
                        >
                        > In addition to serving as the mbox delimiter, the "From " line also
                        > records the envelope sender and message arrival time. It has been
                        > part of the local delivery interface for a long time. So in 2014
                        > I would expect things that have worked for 30+ years to continue
                        > to work.

                        Except that tools complain if Maildir messages begin with a 'From ' line
                        and all that information is (already) present in the headers.

                        > If you have an LDA that needs to run as the user (most don't these
                        > days) and does not support "From ", you'll need to strip it out
                        > for now.

                        Not exactly, it's just that I don't see the need to run yet another
                        command as root. Besides, as far as I can tell, by using pipe(8) instead
                        of local(8) I loose aliases processing. Or were you referring to
                        something else?

                        > The local delivery agent does not currently have a configuration
                        > option to not prepend "From " when piping mail to commands.
                        >
                        > There are multiple command contexts:
                        >
                        > - mailbox_command
                        > - mailbox_command_maps
                        > - "|cmd" in a .forward file
                        > - "|cmd" on the right side of an alias
                        >
                        > If there were a parameter to suppress "From ", which of these would
                        > you expect it to apply to? Recall that not prepending "From " is
                        > likely to cause problems with commands that are not prepared for
                        > this.

                        All of them, of course and to prevent breakage the default should keep
                        the current behaviour. Besides, it's not like local(8) is completely
                        unaware of Maildir-style messages, it would "just" needs to be
                        programmed to do it *also* for deliveries to external commands, on
                        request.

                        I'm aware I'd probably have much more success with a patch attached, but
                        unfortunately I'm not a programmer :)

                        > On the whole, the feature is, I think, dubious. It is better for
                        > all commands to receive the message in a standard form, and act
                        > accordingly. Therefore, the problem is I think in the LDA that
                        > no longer supports "From ", it needs to be configurable to allow
                        > "From ".

                        It does support it, as in: it doesn't strip it *anymore*, I have to use
                        additional tools for that. And if external commands don't need but one
                        standard format why does pipe(8) have all those nice *optional*
                        processing flags? :)

                        Kind regards,
                        Andrei
                        --
                        If you can't explain it simply, you don't understand it well enough.
                        (Albert Einstein)
                        http://nuvreauspam.ro/gpg-transition.txt
                      • Gerry Massat
                        ... So, maybe the tool is broken? What is this software? I m looking at one of my .mbx files. It starts with From and has the envelope sender. Later on
                        Message 11 of 11 , Mar 10 9:27 PM
                        • 0 Attachment
                          On 3/10/2014 6:08 PM, Andrei POPESCU wrote:
                          > On Lu, 10 mar 14, 21:49:55, Viktor Dukhovni wrote:
                          >> On Mon, Mar 10, 2014 at 10:45:36PM +0200, Andrei POPESCU wrote:
                          >>>
                          >>> Thanks, that confirms my understanding. Wouldn't it however make sense
                          >>> to have this configurable? How many delivery agents actually need that
                          >>> in 2014?
                          >>
                          >> In addition to serving as the mbox delimiter, the "From " line also
                          >> records the envelope sender and message arrival time. It has been
                          >> part of the local delivery interface for a long time. So in 2014
                          >> I would expect things that have worked for 30+ years to continue
                          >> to work.
                          >
                          > Except that tools complain if Maildir messages begin with a 'From ' line
                          > and all that information is (already) present in the headers.

                          So, maybe the tool is broken? What is this software?
                          I'm looking at one of my .mbx files. It starts with "From " and has
                          the envelope sender. Later on is the header "From: " (which could
                          possibly be forged). Each message seems to have both forms of "From"
                          - without and with colon.

                          >
                          > It does support it, as in: it doesn't strip it *anymore*, I have to use
                          > additional tools for that. And if external commands don't need but one
                          > standard format why does pipe(8) have all those nice *optional*
                          > processing flags? :)
                          >
                          > Kind regards,
                          > Andrei

                          And if it doesn't 'strip it' "anymore"- did they not break this tool??

                          Gerry
                        Your message has been successfully submitted and would be delivered to recipients shortly.