+ Reply to Thread
Results 1 to 2 of 2

Thread: Postfix Address rewrite, remove prefix

  1. #1
    Kevin1981 is offline Registered User Achievements:
    31 days registeredTagger Second Class100 Experience Points500 Experience Points
    Kevin1981 ?????????
    Join Date
    2009-10-24
    Posts
    13

    Default Postfix Address rewrite, remove prefix

    Just wondering if anyone has any ideas on rewriting sender addresses for Postfix to remove a prefix in the email.

    Basically due to a Winbind configuration, there is a winbind seperator of "+" that seperates Winbind users from the local users. So the Winbind users look like: DOMAIN+firstname.lastname.

    As we're running quotas it would be good to be able to use warnquota to send an email to the user when they have exceeded their soft limit. Warnquota will send the email, but it is sent to DOMAIN+firstname.lastname@example.com, where the valid address is firstname.username@domain.com. I am under the assumption that the best way around this is to use Postfix address rewrite rules to remove the "DOMAIN+" component?

    Going to play around with the LDAP configuration in /etc/warnquota.conf to see if the mail info can be pulled from ADS... but expecting the same issue with looking up usernames, as the domain prefix will make the user invalid.

  2. #2
    joseph's Avatar
    joseph is offline Website Master Achievements:
    100 Experience Points500 Experience Points1000 Experience Points5000 Experience PointsRecommendation Second Class
    joseph has disabled reputation
    Join Date
    2008-09-08
    Posts
    400

    Default

    I suggest you test the virtual alias map with pcre (or regexp if you do not have pcre support in your Postfix) with something like the following:

    1. In /etc/postfix/virtual_pcre, map /^DOMAIN\+(.*)@example\.com$/ --to-- $1@domain.com
    2. in main.cf, add pcre:/etc/postfix/virtual_pcre to virtual_alias_maps definition.

    Check this link for details: Postfix Address Rewriting

+ Reply to Thread

Similar Threads

  1. Fwd: Choosing index prefix length
    By FeedReader in forum Databases
    Replies: 0
    Last Post: 2009-11-12, 12:03 AM
  2. LWN: Ubuntu to store copies of all users' address books
    By edenCC in forum Technology News
    Replies: 0
    Last Post: 2009-10-14, 05:00 PM
  3. LXer: Want a Linux.com email address? It'll cost $99
    By edenCC in forum Technology News
    Replies: 0
    Last Post: 2009-06-03, 11:17 AM
  4. LXer: Radeon Driver Rewrite Only Has A Few Things Left
    By edenCC in forum Technology News
    Replies: 0
    Last Post: 2009-03-24, 12:26 AM
  5. rewrite netstat by Perl
    By joseph in forum System Monitoring
    Replies: 0
    Last Post: 2009-03-12, 02:23 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts