The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
.
google unix.com



UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Sender email address has to changes balajiora Shell Programming and Scripting 1 06-12-2009 10:55 AM
Postfix force sender ("From:" field) +Yan UNIX for Advanced & Expert Users 0 01-15-2009 10:57 AM
Different Sender Address paulds UNIX for Dummies Questions & Answers 1 07-01-2008 03:29 PM
Change sender e-mail address cchiang12 AIX 3 11-18-2006 03:18 PM
mailx sender address customisation vasan_srini UNIX for Dummies Questions & Answers 1 09-10-2001 09:40 AM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 09-07-2009
funksen funksen is offline Forum Advisor  
Registered User
  
 

Join Date: Nov 2006
Location: Austria/Vienna
Posts: 431
postfix sender address rewriting

Hi,

I have a postfix server that relays to an exchange server. All of my unix/linux systems send to this server, the problem is the form the mail is sent with,

the sender address is


Code:
username@hostname.domain.local

I need to rewrite every sender address to

unix@maildomain.com

for this I added the following entry to main.cf:


Code:
sender_canonical_maps = hash:/etc/postfix/canonical

/etc/postfix/canonical:


Code:
/domain.local/ unix@maildomain.com

I ran the postmap command and restarted the mailserver

but it's not working, any idea?


--------------------------------------------------------------------
Edit: ok found the solution

in main.cf


Code:
sender_canonical_maps = regexp:/etc/postfix/canonical

instead of hash, works now

--------------------------------------------------------------------
Edit2: but just works for localhost, and not for relay hosts
-------------------------------------------------------------------
Edit3:

needed to append the line

Code:
local_header_rewrite_clients = static:all

to main.cf


hurray!!
------------------------------------------------------------------

Edit4:

hm now I need a solution, that writes the original hostname to the subject, because now I can't determine the sender host
of course it can be added to the specific mail script, but we have about 300 mailscripts
------------------------------------------------------------------

Edit5:

have the solution, regular expressions and header_checks, details tomorrow

..
to main.cf:

Code:
header_checks = regexp:/etc/postfix/header_checks

to /etc/postfix/header_checks:

Code:
/From:.* <.*@(.*)\.domain.local>/ REPLACE From: $1 <unix@maildomain.com>

this will not write the hostname to the subject, it writes it to the from field, looks like
Code:
From: hostname <unix@maildomain.com>

outlook displays this name in the from column, which is absolutely perfect for my needs

Last edited by funksen; 09-08-2009 at 05:17 AM..
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 08:20 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0