Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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.
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!
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.