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

225650regexp sender_bcc map not working

Expand Messages
  • Marco De Vitis
    Aug 31, 2007
      I need to forward a copy of all messages sent from users of a domain,
      except for one user (let's call him "goofy"), to a different address.

      So I created this file:

      if /^From:.*@mydomain.(com|it)/
      !/^From:.* goofy@mydomain/ anotheraddress@...

      And then added the following line to /etc/postfix/main.cf:

      sender_bcc_maps = regexp:/etc/postfix/sender_bcc

      Nevertheless, if I send a mail with sender info@... no copy
      is forwarded.
      Testing with

      postmap -q "From: info@..." regexp:/etc/postfix/sender_bcc

      ...correctly returns "anotheraddress@...", showing that
      the regexp matches.
      I didn't do a "postmap /etc/postfix/sender_bcc" because I've read that
      regexp files do not have to be postmap'ped, and indeed when trying I
      get a warning message (and the forward does not work anyway

      I'll also add that, before going the regexp route, I was trying a
      simpler hash file just for testing and it worked great. But I suppose
      I cannot do what I need with a hash file, without listing ALL domain
      users (except goofy).

      What am I doing wrong?
      I'm using postfix 2.2.4 on Debian Sarge, and here is the postconf -n output:

      alias_database = hash:/etc/aliases
      alias_maps = hash:/etc/aliases
      append_dot_mydomain = no
      biff = no
      bounce_queue_lifetime = 2d
      broken_sasl_auth_clients = yes
      config_directory = /etc/postfix
      delay_warning_time = 10m
      header_checks = regexp:/etc/postfix/header_checks
      inet_interfaces = all
      mailbox_command = procmail -a "$EXTENSION"
      mailbox_size_limit = 0
      maximal_queue_lifetime = 2d
      message_size_limit = 50000000
      mydestination = <local domains>
      myhostname = <my hostname>
      mynetworks =, <my LAN>
      myorigin = /etc/mailname
      recipient_delimiter = +
      relay_domains =
      relayhost = [<my ISP's SMTP server>]
      sender_bcc_maps = regexp:/etc/postfix/sender_bcc
      smtp_sasl_auth_enable = yes
      smtp_sasl_password_maps = hash:/etc/postfix/smtp_auth_passwd
      smtp_sasl_security_options = noanonymous
      smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
      smtpd_client_restrictions = permit_sasl_authenticated reject
      smtpd_delay_reject = yes
      smtpd_end_of_data_restrictions = check_policy_service inet:
      smtpd_recipient_restrictions = permit_sasl_authenticated
      permit_mynetworks reject_unauth_destination
      smtpd_sasl_auth_enable = yes
      smtpd_sasl_local_domain = $myhostname
      smtpd_sasl_security_options = noanonymous
      smtpd_tls_CAfile = /etc/ssl/certs/<my CA cert>.pem
      smtpd_tls_auth_only = yes
      smtpd_tls_cert_file = /etc/ssl/certs/<my SMTP cert>.pem
      smtpd_tls_key_file = /etc/ssl/private/<my SMTP key>.pem
      smtpd_tls_received_header = yes
      smtpd_tls_session_cache_timeout = 3600s
      smtpd_use_tls = yes
      tls_random_source = dev:/dev/urandom
      transport_maps = hash:/etc/postfix/transport

    • Show all 4 messages in this topic