LINUX.IE, website of the Irish Linux Users' Group
Tux rules!

   
Home
New Users
Articles
Download
Projects
Community
Vendors

  Print Version
Email to...
 
Archives:


planetILUG

Recent News

News Archive


Join the
ILUG
on FaceBook


Join the
ILUG
on LinkedIn


Join the
ILUG SETI
Group



















 
 :: Mailing Lists

[ILUG] Postfix macros for pipe

[ILUG] Postfix macros for pipe

Glen Gray glen at lincor.com
Mon Jun 19 19:40:57 IST 2006


John/Declan,

I know about maildrop, but I'm migrating an existing server where  
nearly all accounts have a .procmailrc file. So I'd rather not have  
to learn yet another format and then rewrite everyones .procmailrc or  
have them do it.

I already have this working anyway, I was just wondering if there was  
a better way. Basically I've set content_filter=procmail in main.cf  
and in the master.cf I've created a procmail service.

What I'd like to do here is have the procmail service as defined in  
master.cf exec "procmail -m /home/vmail/<domain>/<user>/.procmailrc".  
I've got the user bit with the ${user} macro but not the domain bit  
(there doesn't seem to be a ${domain} macro available for the pipe  
service, as listed in the man page). What I was hoping was that  
either there was a hidden one or there was a way to make my own macro  
in postfix to return this. Using $mydomain won't work as I'm using  
Virtual accounts and the HowTo I followed explicitly said not to have  
any Virtual domains listed in there.

There's two work arounds that I see.

1)
Simply wrap the call to procmail in a shell script that takes in $ 
{recipient} from Postfix and parse out user and domain to construct  
the proper path.

Doing the script means there's an extra level of system call and the  
script calls cut on the $1 variable it gets from Postfix, which is  
again another system call. Both those could be avoided if Postfix  
could provide the domain part of the email address.

Having said that, the email server will be dealing with approx 20  
addresses and pretty low volumes of traffic, so it's not that big a  
deal.

2)
I could just hard code the domain into the path, however, we may need  
to host other domains and this would break that where as it works  
with item 1).

Cheers,
-- 
Glen Gray <glen at lincor.com>              Digital Depot, Thomas Street
Senior Software Engineer                            Dublin 8, Ireland
Lincor Solutions Ltd.                          Ph: +353 (0) 1 4893682





More information about the ILUG mailing list
Read this without the formatting.
                                                                                                    

 

Hosted by HEAnet


Maintained by the ILUG website team. The aim of Linux.ie is to support and help commercial and private users of Linux in Ireland. You can display ILUG news in your own webpages, read backend information to find out how. Networking services kindly provided by HEAnet, server kindly donated by Dell. Linux is a trademark of Linus Torvalds, used with permission. No penguins were harmed in the production or maintenance of this highly praised website. Looking for the Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!
RSS Version
Powered by Dell