Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 696
  • Last Modified:

postfix - how to deliver all mail to unknown addresses to specific IMAP user

I have postfix running with delivery to CyrusIMAP via LMTP.

I wish to have all incoming email which is not destined to a specific user which resides on the system to be sent to one individual user instead of being rejected.

I have found the following URL which describes how to do it.
http://www.seaglass.com/postfix/faq.html#fwdnex
However when I have implemented it, it does not work and I get the following error:-

Sep 22 15:06:51 laelaps postfix/lmtp[2300]: BBFB62654B: to=<dwreerereere@philtanner.homelinux.net>, relay=/var/lib/imap/socket/lmtp[/var/lib/imap/socket/lmtp], delay=1, status=bounced (host /var/lib/imap/socket/lmtp[/var/lib/imap/socket/lmtp] said: 550-Mailbox unknown.  Either there is no mailbox associated with this 550-name or you do not have authorization to see it. 550 5.1.1 User unknown (in reply to RCPT TO command))

In the main.cf configuration file it has the following comment about luser_relay :-
"# luser_relay works only for the default Postfix local delivery agent."
I guess this is the problem.

How can I get this working?
0
grblades
Asked:
grblades
  • 3
1 Solution
 
jlevieCommented:
It seems to me that you'd do this in Postfix exactly the same way one would do it in Sendmail. And that is to treat all of the email addresses as if they were a virtual domain, which allows the use of a "catch all". See the Virtual domains docs at http://www.postfix.org/VIRTUAL_README.html
0
 
owensleftfootCommented:
set luser_relay = address-to-catch-invalid-users in main.cf
0
 
grbladesAuthor Commented:
owensleftfoot - I have already tried that as I said in my first post but as you can see from the error I posted postfix passes the email onto lmtp so it does not use its own local delivery system so cannot tell if the email can be delivered or not.
Maybe I could add something to the local recipient map which lists all the valid users. If the user does not match this list then it will be sent to the luser_relay user?

jlevie - Thanks. I will have a look at that link.
0
 
grbladesAuthor Commented:
Still working on this. Should have time to get back to it soon.
0
 
grbladesAuthor Commented:
Thanks. I don't know when I will have time to look into it (its for a friend) but that approack looks as if it will work.
0

Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now