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] I thought you didn't have to fight postfix...

[ILUG] I thought you didn't have to fight postfix...

Conor Daly conor.daly at oceanfree.net
Thu Jun 6 17:40:22 IST 2002


On Mon, Jun 03, 2002 at 03:28:41PM +0100 or so it is rumoured hereabouts, 
Gary Coady thought:
> On Sun, Jun 02, 2002 at 08:22:58PM +0100, Conor Daly wrote:
> > Well, I'm fighting with it.
> > 
> > setup I have is a dialup internet account with a single email address.  I
> > want to use that email address with "+" extensions to provide mail for
> > multiple users (eg. "mailaccount+user at isp.net"  to be delivered to
> > "user at server.localdomain").
> 
> Okay, firstly I haven't had to do any of this before, but it might actually
> be correct, and it should give you an idea of how to solve your problem :)
 
That pretty much did it...  Only thing is it's rewriting the addresses for
mail from local users to local users where it shouldn't.  I'll have to
figure that out next.

Two caveats...

1. my version of postfix (postfix-1.1.7-6 in RH RPM) doesn't support pcre
expressions (Found that out with "postconf -m").  Instead I've used regexp
thus:

recipient_canonical_maps = regexp:/etc/postfix/recipient_map.regexp

# /etc/postfix/recipient_map.regexp
# This is for testing only
/^mailaccount\+(.*)@isp.net/   ${1}@server.localdomain

and:

sender_canonical_maps = regexp:/etc/postfix/sender_map.regexp

# /etc/postfix/sender_map.regexp
# This line for testing only...
/^(.*)@(.*)$/!/^mailaccount+/        mailaccount+${1}@isp.net
             ^^^^^^^^^^^^^^^
2. Note the negation above.  If I leave that bit out, the final address ends
up with 10 iterations of "mailaccount+" prepended!  I guess the canonical
rewrite is being done multiple times.


> First of all, use in main.cf:
> recipient_canonical_maps = pcre:/etc/postfix/recipient_map.pcre
> 
> # /etc/postfix/recipient_map.pcre
> # Rewrite domain+user to user - I don't think the address is re-run
> # through trivial-rewrite, so add the domain here.
> /^mailaccount\+(.*)@/	${1}@server.localdomain
> 
> > I also want to rewrite outgoing mail from
> > "user at server.localdomain" to "mailaccount+user at isp.net".  
> 
> And here in main.cf:
> sender_canonical_maps = pcre:/etc/postfix/sender_map.pcre
> 
> # /etc/postfix/sender_map.pcre
> # Rewrite user@ to mailaccount+user at isp.net
> /^(.*)@/	mailaccount+${1}@isp.net

Thanks,

Conor
-- 
Conor Daly <conor.daly at oceanfree.net>

Domestic Sysadmin :-)
---------------------
Faenor.cod.ie
  4:27pm  up 14 days,  1:45,  0 users,  load average: 0.15, 0.03, 0.01
Hobbiton.cod.ie
  4:30pm  up 14 days,  1:51,  2 users,  load average: 0.02, 0.05, 0.00




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