LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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
  Search this Thread
Old 05-24-2010, 02:19 PM   #1
mpapet
Member
 
Registered: Nov 2003
Location: Los Angeles
Distribution: debian
Posts: 548

Rep: Reputation: 72
Postfix Mail Delivery Path Modification?


Hi again,

I'm running postfix with virtual domains and want to modify the delivery path. Right now, I have one path for each user that's found with a database lookup.

Before mail hits Postfix, it will have an x-spam-header: yes/no/uncertain field. When mail with x-spam-header: yes the lookup for the path would return /var/mail/domain/username/.Inbox/.spam.

What I think I'd like to do is parse the x-spam-header value in postfix, populate a variable, then use the variable to modify the path lookup in the database. header_checks has a FILTER option, but that's just beyond my skillset at the moment.

Or, maybe I'm better off modifying the path with a procmail recipe? Currently, my mailbox_command = procmail -a "$EXTENSTION"

I don't know what's the norm in this situation, so any advice is welcome.

Last edited by mpapet; 05-24-2010 at 02:28 PM.
 
Old 05-24-2010, 05:09 PM   #2
Berhanie
Senior Member
 
Registered: Dec 2003
Location: phnom penh
Distribution: Fedora
Posts: 1,625

Rep: Reputation: 165Reputation: 165
I think the procmail path is the way to go. The MDA should be responsible for those things.

Quote:
Right now, I have one path for each user that's found with a database lookup.
Does postfix even allow a per-user lookup for mailboxes?
 
Old 05-24-2010, 06:16 PM   #3
mpapet
Member
 
Registered: Nov 2003
Location: Los Angeles
Distribution: debian
Posts: 548

Original Poster
Rep: Reputation: 72
Quote:
Originally Posted by Berhanie View Post
Does postfix even allow a per-user lookup for mailboxes?
Yup.

Thanks for the advice!
 
Old 05-24-2010, 08:34 PM   #4
Berhanie
Senior Member
 
Registered: Dec 2003
Location: phnom penh
Distribution: Fedora
Posts: 1,625

Rep: Reputation: 165Reputation: 165
You're welcome. Right, so you mean virtual_mailbox_maps. But, then, I'm not sure how procmail would work with virtual users/mailboxes. I have virtual users, but I use the dovecot delivery agent, which can parse headers and deliver into the correct imap folder following sieve filters. You might have a problem with virtual users and procmail.
 
Old 05-25-2010, 11:32 AM   #5
mpapet
Member
 
Registered: Nov 2003
Location: Los Angeles
Distribution: debian
Posts: 548

Original Poster
Rep: Reputation: 72
Quote:
Originally Posted by Berhanie View Post
You're welcome. Right, so you mean virtual_mailbox_maps. But, then, I'm not sure how procmail would work with virtual users/mailboxes. I have virtual users, but I use the dovecot delivery agent, which can parse headers and deliver into the correct imap folder following sieve filters. You might have a problem with virtual users and procmail.
Right, virtual_mailbox_maps works great for me, procmail has no problem delivering virtual mail to the path in the lookup. But now I want to sort via the headers and procmail looks like it might work, but it would be a new learning curve for me.

I'm more familiar with dovecot, so thank you again for another excellent tip!
 
Old 05-25-2010, 12:06 PM   #6
spampig
Member
 
Registered: Feb 2010
Location: /Earth/UK/England/Hampshire
Distribution: Debian, Ubuntu, CentOS, Slackware
Posts: 262
Blog Entries: 2

Rep: Reputation: 56
Procmail, as far as I understand it, only works for local mailboxes/users and aliases thereof. If you are hosting Virtual Domains (as opposed to plain old virutal users) then I don't think it will help. For these scenarios you can use 'maildrop' instead, but I've never found the right parts to make it work without significant hassle.

Probably the easiest way is to use the SIEVE feature of (later) Dovecot. I don't have any knowledge of it myself, but it looks like it could do what you want.

When I had the need to do this (and I declare my personal hatred for 'amavis-new' at this point) and other clever things with Spam I found it easier to drop Postfix and go with Exim. It has a significant edge on Postfix in control, but at the cost of notable learning curve. To be fair to Postfix it retains 'it's only an MTA' and keeps true(ish) to that, and some of the current developments are exciting. It has better processing on large queues I am told.

Crux, look at 'Sieve' in Dovecot.

HTH and fleshes out what others have said.

Last edited by spampig; 05-25-2010 at 12:08 PM.
 
1 members found this post helpful.
Old 05-25-2010, 03:40 PM   #7
mpapet
Member
 
Registered: Nov 2003
Location: Los Angeles
Distribution: debian
Posts: 548

Original Poster
Rep: Reputation: 72
spampig,

I found that out this morning and have switched from using postfix's virtual transport to the dovecot transport plus a sieve script to get the bad mail into the spam folder.

Thanks to all!
 
  


Reply



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 +Mysql mail delivery shankar.vishwakarma Linux - Newbie 1 06-28-2009 02:59 AM
Postfix mail delivery failure Ammad Linux - Server 7 06-14-2009 05:50 AM
Mail delivery tracking - PostFix shritesh Linux - Software 3 09-01-2006 02:25 AM
postfix mail delivery berrance Linux - Networking 4 02-28-2005 06:46 AM
Postfix mail delivery issue kokke Linux - Software 6 05-13-2003 05:50 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 11:10 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration