![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| 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 |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
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 |
| Display Modes | Rate This Thread |
|
|