Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

sender address/domain rewrite problem

97 views
Skip to first unread message

czor...@gmail.com

unread,
Apr 3, 2013, 11:57:21 AM4/3/13
to
Hi there,

I'm trying to rewrite sender address/domain from @sub.example-domain.com to @example-domain.com.

I tried:
1) masquerade_domains = example-domain.com
2) sender_canonical_maps=hash:/etc/postfix/sender_canonical
(sender_canonical: @sub.example-domain.com to @example-domain.com)


In both cases, with masquerade_domains and sender_canonical_maps, when I send a mail from us...@sub.example-domain.com, I recieve mail with:
- Return-Path: us...@example-domain.com
- From: Username <us...@sub.example-domain.com>

Is there some way to rewrite "From: " part of msg header?
- From "From: Username <us...@sub.example-domain.com>" to "From: Username <us...@example-domain.com>" ??

--
Zoran

Gabriele

unread,
Apr 16, 2013, 1:54:10 AM4/16/13
to
Il giorno mercoledì 3 aprile 2013 17:57:21 UTC+2, czor...@gmail.com ha scritto:

> Is there some way to rewrite "From: " part of msg header?
>
> - From "From: Username <us...@sub.example-domain.com>" to "From: Username <us...@example-domain.com>" ??


In main.cf:

header_checks = pcre:/etc/postfix/header_checks

(use regex if your postfix does not support pcre)

Then, add the following line to the header_checks file:

/^From: Username <user@sub\.(example-domain\.com)>/ REPLACE From: Username <user@{1}>

Restart postfix

--
Gabriele
0 new messages