LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
LinkBack Search this Thread
Old 04-16-2012, 05:29 AM   #1
mat4487
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.

Code:
if /PHP/
/PHP-MAIL/ OK
endif
if /Auth/
/Authenticated sender/ OK
endif
/./ 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, 08:52 AM   #2
mat4487
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 : http://blog.thecodingmachine.com/fr/...-receives-mail.

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
 
  


Reply


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
Trackbacks are Off
Pingbacks are On
Refbacks are 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 08:11 AM
OS Ticket configuration to accept tickets from mails. linuxlover.chaitanya Linux - Software 1 11-16-2011 12:04 AM
Sendmail wont accept mails from localhost Zangai Linux - Server 2 08-29-2009 05: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 07:38 PM


All times are GMT -5. The time now is 02:45 PM.

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