Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Server
User Name
Linux - Server This forum is for the discussion of Linux Software used in a server related context.


  Search this Thread
Old 04-16-2012, 06:29 AM   #1
LQ Newbie
Registered: Apr 2012
Posts: 6

Rep: Reputation: Disabled
How to tell Postfix to accept mails with special headers?

Hi all!

So... I've got a problem!

In a web hosting context, users are allowed to send mails from their websites. All mails are relayed through a unique postfix server.

I need to authenticated the senders to be able to apply quotas via cbpolicyd.

Users can use SASL to directly connect to the postfix server or they can use PHP scripts. In the last case, a header PHP-MAIL:ip-of-the-sender is added to the mail.

So I tried to make rules in header_checks but it seems that this file helps only rejecting mails not allowing.

if /PHP/
if /Auth/
/Authenticated sender/ OK
/./ REJECT Pas d'authentification
I know that OK just act as DUNNO so it results that REJECT applies in any case. I'm looking for a way to implement an else condition in that file...or any other ideas welcome
Old 04-18-2012, 09:52 AM   #2
LQ Newbie
Registered: Apr 2012
Posts: 6

Original Poster
Rep: Reputation: Disabled
Finally I left header_checks and use an external php script to check the headers, following this tutorial :

Now I'm able to check my headers but another problem occurs... Emails are now out of postfix so I need to send them again.

My script catch the entire email with all its headers. As I can't guess the custom headers that might be added by the users I must not rewriting the mail.

I'm now looking for a way to send a complete email in one shot, something like mail($email) where $email include both headers and body.

Or if you know a regular expression which can isolate the headers I could do the normal way as mail($to,$subject,$body,$headers).

Thanks for your help

ps: if I should open another post in another section just tell me. I answered here to not flood the forum


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
postfix can't receive mails but can send mails satimis Linux - Server 9 02-09-2012 09:11 AM
OS Ticket configuration to accept tickets from mails. linuxlover.chaitanya Linux - Software 1 11-16-2011 01:04 AM
Sendmail wont accept mails from localhost Zangai Linux - Server 2 08-29-2009 06:49 AM
To restrict a user to send mails only to 3 e-mails IDs using postfix mail server sharath41 Linux - Newbie 2 07-21-2008 08:38 PM > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 04:02 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration