Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Server Operation

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Thread Tools Display Modes
Old 2nd March 2012, 15:15 is offline
Junior Member
Join Date: May 2008
Posts: 4
Thanks: 0
Thanked 1 Time in 1 Post
Default Add header with original recipient

Hi guys,

since last weeks I have a problem with my postfix configuration.

Some of my postboxes are defined as catchall, but thats make it really hard to separate the mails. What I need is something like X-Sender in the header to determine the sender. I have activated the X-Original-To in postfix, but in my case it seems very useless, postfix just placed the mailbox name there like catchall@mydomain.tld.

After googeling a bit I added a regular expression file with

/(.+)/ PREPEND X-Sender: $1
and added the line in Postfix right after

smtpd_recipient_restrictions = check_recipient_access pcre:/etc/postfix/append_header.regexp, (...)
in the main.cf file. That works very well for one address, but if I send it to multiple recipents I have tons of multiple entries in the mail head.

X-Sender: user@...
X-Sender: user2@
So that is not really what I'm searching for, it breaks the Bcc and I think it's not good to have a lot of entries with the same description.

In the last step I moved the entry to the smtpd_data_restrictions in main.cf. It work very well. But when I address more than one recipient, the X-Sender will not be added to the header...

Have anyone some experience with that? I get a lot of mails from other users/provieder which have also that kind of header added. Is that probably not possible to add when I use postfix? And now i'm totally confused with the X-Delivered, X-Envelope.., X-Original stuff...

Hope for help
Reply With Quote
Sponsored Links
Old 9th March 2012, 16:05 is offline
Junior Member
Join Date: May 2008
Posts: 4
Thanks: 0
Thanked 1 Time in 1 Post
Default X-Original-To rewritten by Amavis

I've found a solution by myself,

the problem was amavis, which rewrites the X-Original-To. When you are using dovecot and amavis, as in my case.

so just add:
receive_override_options = no_address_mappings
in main.cf.

in master.cf add
... inet n    -       n       -       -     smtpd
-o receive_override_options=no_header_body_checks,no_unknown_recipient_checks

dovecot	  unix	-	n	n	-	-	pipe
	flags=DROhu user=vmail:vmail argv=/usr/lib/dovecot/deliver -f ${sender} -d ${recipient}
I have found a lot of questions in Mailing lists, but no has a answer on the special problem.

PS: I've to admit, that this is not a rewrite, but adds the standard complaint header X-Original-To which is the same as X-Envelope in Exim.
Reply With Quote
The Following User Says Thank You to For This Useful Post:
falko (10th March 2012)


Thread Tools
Display Modes

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Issues with Baruwa - The Perfect Spamsnake Ubuntu 10.10 neofire HOWTO-Related Questions 44 31st May 2011 16:09
WebDAV doesn't start - DAVLockDB not created - error 405 Method not allowed maljam Server Operation 2 23rd March 2011 17:06
freebsd 7, samba 3, domain controller alexdimarco Suggest HOWTO 6 5th November 2010 17:54
I am having problems with Email, and authenication savy2k General 10 14th January 2010 12:00
ERROR: The PHP binary coming with ISPConfig does not work properly on your system! qvindesland Installation/Configuration 22 21st May 2007 17:05

All times are GMT +2. The time now is 02:21.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.