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

virtual_alias_maps and pipe to command

Expand Messages
  • David Zejda
    ... Hash: SHA1 Hello, I have many mappings in virtual_alias_maps to other mail addresses, but I am not succesfull in aliasing to a command using the | in the
    Message 1 of 3 , Aug 3 1:27 PM
    • 0 Attachment
      -----BEGIN PGP SIGNED MESSAGE-----
      Hash: SHA1

      Hello,

      I have many mappings in virtual_alias_maps to other mail addresses, but
      I am not succesfull in aliasing to a command using the "|" in the form:

      virtalias@... |"/usr/bin/procmail /home/veronika/.procmailrc"

      If I simply add entry to the virtual alias map, I get:

      Aug 3 22:18:21 o-it postfix/smtp[14594]: DCF107FC2:
      to=<|/usr/bin/procmail /home/veronika/.procmailrc@...>,
      orig_to=<virtalias@...>, relay=127.0.0.1[127.0.0.1]:27,
      delay=0.84, delays=0.01/0/0.04/0.79, dsn=2.0.0, status=sent (250 2.0.0
      Ok: queued as E6B2780A3)
      Aug 3 22:18:21 o-it postfix/qmgr[14586]: DCF107FC2: removed
      Aug 3 22:18:21 o-it postfix/virtual[14598]: E6B2780A3:
      to=<|/usr/bin/procmail /home/veronika/.procmailrc@...>,
      relay=virtual, delay=0.79, delays=0.79/0/0/0, dsn=5.1.1, status=bounced
      (unknown user: "|/usr/bin/procmail /home/veronika/.procmailrc@...")

      If I try to add the entry to the alias_maps, I get:

      Aug 3 22:18:14 o-it postfix/smtp[14594]: 1D1DC7FC2:
      to=<alias@...>, relay=127.0.0.1[127.0.0.1]:27, delay=0.94,
      delays=0.04/0.01/0.04/0.85, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued
      as 2B29180A3)
      Aug 3 22:18:14 o-it postfix/qmgr[14586]: 1D1DC7FC2: removed
      Aug 3 22:18:14 o-it postfix/virtual[14598]: 2B29180A3:
      to=<alias@...>, relay=virtual, delay=0.86,
      delays=0.85/0.01/0/0.01, dsn=5.1.1, status=bounced (unknown user:
      "alias@...")

      Please, how can I let postfix to deliver to external command?

      postconf -n

      alias_maps = btree:/etc/postfix/aliases
      allow_mail_to_commands = alias,forward,include
      append_dot_mydomain = no
      bounce_size_limit = 64000
      command_directory = /usr/sbin
      config_directory = /etc/postfix
      content_filter = smtp:[127.0.0.1]:27
      daemon_directory = /usr/lib/postfix
      default_privs = neznamy
      local_recipient_maps =
      local_transport = virtual
      mail_owner = postfix
      mydestination = $myhostname, $mydomain, btree:/etc/postfix/virtdomains
      myhostname = smtp.o-it.info
      mynetworks = 127.0.0.0/8, 82.113.54.166/32, 81.92.145.161/32,
      192.168.30.136/32
      myorigin = $mydomain
      relay_domains = $mynetworks
      smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
      smtpd_delay_reject = yes
      smtpd_recipient_restrictions = permit_mynetworks check_policy_service
      inet:127.0.0.1:60000 check_recipient_access
      btree:/etc/postfix/virtaccess reject
      transport_maps = btree:/etc/postfix/transport
      virtual_alias_maps = btree:/etc/postfix/virtalias
      virtual_gid_maps = static:8
      virtual_mailbox_base = /var/mail
      virtual_mailbox_maps = btree:/etc/postfix/virtmbox
      virtual_minimum_uid = 7
      virtual_uid_maps = btree:/etc/postfix/virtuid


      Thank you!

      David
      -----BEGIN PGP SIGNATURE-----
      Version: GnuPG v1.4.9 (GNU/Linux)
      Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

      iEYEARECAAYFAkp3SDwACgkQ3oCkkciamVEiLwCfWGr8G+2qoJDUAHHEG7G9nz1H
      Iu8An1SoXowBhzPj+esWTme7E/EnqCBj
      =gaip
      -----END PGP SIGNATURE-----
    • /dev/rob0
      ... That s because it was never implemented. Absence from the Postfix documentation can be inferred to mean that the feature does not exist. ... You need to
      Message 2 of 3 , Aug 3 1:53 PM
      • 0 Attachment
        On Monday 03 August 2009 15:27:40 David Zejda wrote:
        > I have many mappings in virtual_alias_maps to other mail addresses, but
        > I am not succesfull in aliasing to a command using the "|" in the form:
        >
        > virtalias@... |"/usr/bin/procmail /home/veronika/.procmailrc"

        That's because it was never implemented. Absence from the Postfix
        documentation can be inferred to mean that the feature does not exist.

        > If I try to add the entry to the alias_maps, I get:

        You need to understand that alias_maps is ONLY used by the local(8)
        delivery agent.

        > Aug 3 22:18:14 o-it postfix/smtp[14594]: 1D1DC7FC2:
        > to=<alias@...>, relay=127.0.0.1[127.0.0.1]:27, delay=0.94,
        > delays=0.04/0.01/0.04/0.85, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued
        > as 2B29180A3)
        > Aug 3 22:18:14 o-it postfix/qmgr[14586]: 1D1DC7FC2: removed
        > Aug 3 22:18:14 o-it postfix/virtual[14598]: 2B29180A3:
        > to=<alias@...>, relay=virtual, delay=0.86,
        > delays=0.85/0.01/0/0.01, dsn=5.1.1, status=bounced (unknown user:
        > "alias@...")

        The address you gave it is using the virtual(8) delivery agent.

        > Please, how can I let postfix to deliver to external command?
        ^
        Incomplete question. Insert "virtual mailbox addresses" above. And BTW,
        this is indeed a FAQ here, where did you look?

        mydestination = [ ... what you needed before ... ], localhost,
        localhost.$mydomain
        virtual_alias_maps containing:
        address@virtual_mailbox alias@localhost
        virtual_mailbox_maps containing:
        address@virtual_mailbox anything here
        alias_maps containing:
        alias: |"/path/to/your/command and arguments"

        See aliases(5) for the details of running commands from an alias. Offer
        void where taxed or prohibited by law, or if you failed to build any
        necessary files with postmap(1)/newaliases(1).

        > postconf -n
        >
        > alias_maps = btree:/etc/postfix/aliases
        > allow_mail_to_commands = alias,forward,include
        > append_dot_mydomain = no

        This setting removes the need for "localhost.$mydomain" as I gave you
        above.

        > bounce_size_limit = 64000
        > command_directory = /usr/sbin
        > config_directory = /etc/postfix
        > content_filter = smtp:[127.0.0.1]:27
        > daemon_directory = /usr/lib/postfix
        > default_privs = neznamy

        Know what this one means. See postconf.5.html#default_privs .

        > local_recipient_maps =

        Why?

        > local_transport = virtual

        No, take this out.

        > mail_owner = postfix
        > mydestination = $myhostname, $mydomain, btree:/etc/postfix/virtdomains

        "virtdomains" included in mydestination? You seem to be very confused
        here. Did you try to follow some HOWTO or tutorial which you did not
        understand?

        *If* you really need virtual mailboxes (small sites and beginners
        generally do not!) you should follow the real documentation:
        http://www.postfix.org/VIRTUAL_README.html
        and understand the choices you have:
        http://www.postfix.org/ADDRESS_CLASS_README.html

        My guess is that you would have been better off forgetting about
        virtual mailboxes and just using the BASIC_CONFIGURATION_README.
        Virtual alias domains can easily provide namespace separation for
        multiple domains, still using local(8) delivery.

        > myhostname = smtp.o-it.info
        > mynetworks = 127.0.0.0/8, 82.113.54.166/32, 81.92.145.161/32,
        > 192.168.30.136/32
        > myorigin = $mydomain
        > relay_domains = $mynetworks

        Wrong. Most sites should just unset this. Anyway, $mynetworks is a
        network list, not a domain list.

        > smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
        > smtpd_delay_reject = yes
        > smtpd_recipient_restrictions = permit_mynetworks check_policy_service
        > inet:127.0.0.1:60000 check_recipient_access
        > btree:/etc/postfix/virtaccess reject

        This looks very odd too. Is "virtaccess" what you used in place of
        doing virtual_mailbox_domains/maps the documented way?

        > transport_maps = btree:/etc/postfix/transport

        Why? What's in here?

        > virtual_alias_maps = btree:/etc/postfix/virtalias
        > virtual_gid_maps = static:8

        Such a low GID/UID is an unusual choice. Not necessarily wrong per se,
        but you should know why you chose it.

        > virtual_mailbox_base = /var/mail
        > virtual_mailbox_maps = btree:/etc/postfix/virtmbox
        > virtual_minimum_uid = 7
        > virtual_uid_maps = btree:/etc/postfix/virtuid
        --
        Offlist mail to this address is discarded unless
        "/dev/rob0" or "not-spam" is in Subject: header
      • David Zejda
        ... Hash: SHA1 Thank you for the extensive reply, you pointed me to look on the config in whole more seriously and really, there were odd remains of
        Message 3 of 3 , Aug 3 3:41 PM
        • 0 Attachment
          -----BEGIN PGP SIGNED MESSAGE-----
          Hash: SHA1

          Thank you for the extensive reply, you pointed me to look on the config
          in whole more seriously and really, there were odd remains of
          experiments from the past, which caused the behavior.. it seems, that
          everything works OK now.

          D.

          /dev/rob0 napsal(a):
          > On Monday 03 August 2009 15:27:40 David Zejda wrote:
          >> I have many mappings in virtual_alias_maps to other mail addresses, but
          >> I am not succesfull in aliasing to a command using the "|" in the form:
          >>
          >> virtalias@... |"/usr/bin/procmail /home/veronika/.procmailrc"
          >
          > That's because it was never implemented. Absence from the Postfix
          > documentation can be inferred to mean that the feature does not exist.
          >
          >> If I try to add the entry to the alias_maps, I get:
          >
          > You need to understand that alias_maps is ONLY used by the local(8)
          > delivery agent.
          >
          >> Aug 3 22:18:14 o-it postfix/smtp[14594]: 1D1DC7FC2:
          >> to=<alias@...>, relay=127.0.0.1[127.0.0.1]:27, delay=0.94,
          >> delays=0.04/0.01/0.04/0.85, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued
          >> as 2B29180A3)
          >> Aug 3 22:18:14 o-it postfix/qmgr[14586]: 1D1DC7FC2: removed
          >> Aug 3 22:18:14 o-it postfix/virtual[14598]: 2B29180A3:
          >> to=<alias@...>, relay=virtual, delay=0.86,
          >> delays=0.85/0.01/0/0.01, dsn=5.1.1, status=bounced (unknown user:
          >> "alias@...")
          >
          > The address you gave it is using the virtual(8) delivery agent.
          >
          >> Please, how can I let postfix to deliver to external command?
          > ^
          > Incomplete question. Insert "virtual mailbox addresses" above. And BTW,
          > this is indeed a FAQ here, where did you look?
          >
          > mydestination = [ ... what you needed before ... ], localhost,
          > localhost.$mydomain
          > virtual_alias_maps containing:
          > address@virtual_mailbox alias@localhost
          > virtual_mailbox_maps containing:
          > address@virtual_mailbox anything here
          > alias_maps containing:
          > alias: |"/path/to/your/command and arguments"
          >
          > See aliases(5) for the details of running commands from an alias. Offer
          > void where taxed or prohibited by law, or if you failed to build any
          > necessary files with postmap(1)/newaliases(1).
          >
          >> postconf -n
          >>
          >> alias_maps = btree:/etc/postfix/aliases
          >> allow_mail_to_commands = alias,forward,include
          >> append_dot_mydomain = no
          >
          > This setting removes the need for "localhost.$mydomain" as I gave you
          > above.
          >
          >> bounce_size_limit = 64000
          >> command_directory = /usr/sbin
          >> config_directory = /etc/postfix
          >> content_filter = smtp:[127.0.0.1]:27
          >> daemon_directory = /usr/lib/postfix
          >> default_privs = neznamy
          >
          > Know what this one means. See postconf.5.html#default_privs .
          >
          >> local_recipient_maps =
          >
          > Why?
          >
          >> local_transport = virtual
          >
          > No, take this out.
          >
          >> mail_owner = postfix
          >> mydestination = $myhostname, $mydomain, btree:/etc/postfix/virtdomains
          >
          > "virtdomains" included in mydestination? You seem to be very confused
          > here. Did you try to follow some HOWTO or tutorial which you did not
          > understand?
          >
          > *If* you really need virtual mailboxes (small sites and beginners
          > generally do not!) you should follow the real documentation:
          > http://www.postfix.org/VIRTUAL_README.html
          > and understand the choices you have:
          > http://www.postfix.org/ADDRESS_CLASS_README.html
          >
          > My guess is that you would have been better off forgetting about
          > virtual mailboxes and just using the BASIC_CONFIGURATION_README.
          > Virtual alias domains can easily provide namespace separation for
          > multiple domains, still using local(8) delivery.
          >
          >> myhostname = smtp.o-it.info
          >> mynetworks = 127.0.0.0/8, 82.113.54.166/32, 81.92.145.161/32,
          >> 192.168.30.136/32
          >> myorigin = $mydomain
          >> relay_domains = $mynetworks
          >
          > Wrong. Most sites should just unset this. Anyway, $mynetworks is a
          > network list, not a domain list.
          >
          >> smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
          >> smtpd_delay_reject = yes
          >> smtpd_recipient_restrictions = permit_mynetworks check_policy_service
          >> inet:127.0.0.1:60000 check_recipient_access
          >> btree:/etc/postfix/virtaccess reject
          >
          > This looks very odd too. Is "virtaccess" what you used in place of
          > doing virtual_mailbox_domains/maps the documented way?
          >
          >> transport_maps = btree:/etc/postfix/transport
          >
          > Why? What's in here?
          >
          >> virtual_alias_maps = btree:/etc/postfix/virtalias
          >> virtual_gid_maps = static:8
          >
          > Such a low GID/UID is an unusual choice. Not necessarily wrong per se,
          > but you should know why you chose it.
          >
          >> virtual_mailbox_base = /var/mail
          >> virtual_mailbox_maps = btree:/etc/postfix/virtmbox
          >> virtual_minimum_uid = 7
          >> virtual_uid_maps = btree:/etc/postfix/virtuid
          -----BEGIN PGP SIGNATURE-----
          Version: GnuPG v1.4.9 (GNU/Linux)
          Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

          iEYEARECAAYFAkp3Z5oACgkQ3oCkkciamVF5PgCfU96TqJlTOf/HGTS0YQIXiomq
          NX8Anik8BZIOmp/7MV6JNpv1WKwy2gfa
          =Odrx
          -----END PGP SIGNATURE-----
        Your message has been successfully submitted and would be delivered to recipients shortly.