Postfix: add custom header

Discussion in 'Plesk Automation Suggestions and Feedback' started by delmed, Nov 28, 2016.

  1. delmed

    delmed Bit Poster

    hope i'm in the right forum.
    i try to find a way to add some custom header to the incoming mail.
    so i create /etc/postfix/my_custom_header with this line:
    /^X-Original-To: (.*)$/ PREPEND X-Original-dest: $1
    but when i reload postfix i have a mail error:
    Postfix SMTP server: errors from mail.***.com
    all i want, is to add a line 'X-Original-dest' in header with the mail adress of X-Original-To cause in all header, i have twice X-Original-To, the first are the right, but the second is with the "To:" address .
    i have a account users@domaine.tld without mailbox who forward to user1 and user2 .
    user1 and user2 don't have a mailbox, but there's a collector for mails without user account.
    so when i send mail to users@domaine.tld, i receive two mail in collector@domaine.tld.
    header example:

    Return-Path: <>
    X-Spam-Checker-Version: xxxxx xxxxx
    X-Spam-Level: xxxxxxxxxxxx
    X-Spam-Status: xxxxxxxxxxxxxxxxxxxxxx
    HTML_MESSAGE xxxxxxxxxxx
    X-Original-To: user1@domaine.tld
    Delivered-To: collector@domaine.tld
    Received: by xxxxxxxxxxxxxxx (Postfix, from userid xxx)

    DomainKey-Status: good
    X-Original-To: users@domaine.tld
    Delivered-To: users@domaine.tld

    From: "[NC] me" <>
    To: <users@domaine.tld>
    Subject: test

    can someone help me please.

Share This Page