LinuxQuestions.org
Review your favorite Linux distribution.
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 07-30-2010, 04:16 PM   #1
exscape
Member
 
Registered: Aug 2007
Location: Sweden
Distribution: OS X, Gentoo, FreeBSD
Posts: 82

Rep: Reputation: 15
Question Postfix: customized reject message per virtual domain (or user)?


Here's the deal. I have a mail server taking care of mail for my 4 domains; the first is used for virtually all mail, the second rarely used anymore, the third is virtually 100% spam the past year(?), and the fourth isn't in use (and never has been, so no spam).

What I'd like to do is to reject all mail to the third domain, but give humans a hint on how to contact me. Right now this is what I get (I tried to send to a nonexistent address from gmail):
Code:
Delivery to the following recipient failed permanently:

    bouncetest@domain.net

Technical details of permanent failure: 
Google tried to deliver your message, but it was rejected by the recipient domain. We recommend contacting the other email provider 
for further information about the cause of this error. 
The error that the other server returned was: 550 550 5.1.1 <bouncetest@domain.net>: Recipient address rejected: User unknown in virtual mailbox table (state 14).

----- Original message -----

[...]
Since my username (xyz@) is the same for all domains, I could (or so I hope) change the reject message to give a hint to replace @olddomain.net with @realdomain.net and try again. I doubt any bots are going to catch on to that, but someone trying to reach me on an old address might.

Uh, long story short: see topic line.
Is this possible (in an easy enough way, too )?

Thanks in advance.
 
Old 07-30-2010, 07:21 PM   #2
Berhanie
Senior Member
 
Registered: Dec 2003
Location: phnom penh
Distribution: Fedora
Posts: 1,625

Rep: Reputation: 165Reputation: 165
The relocated database might be useful here. Also see here.

Last edited by Berhanie; 07-30-2010 at 07:23 PM.
 
1 members found this post helpful.
Old 07-31-2010, 03:53 AM   #3
exscape
Member
 
Registered: Aug 2007
Location: Sweden
Distribution: OS X, Gentoo, FreeBSD
Posts: 82

Original Poster
Rep: Reputation: 15
Ah, yes, that worked. Thanks

Mini-tutorial:
1) Read the man page and create the file (in my case, /etc/postfix/relocated, contents "@domain.net SAME_USERNAME_HERE@realdomain.net"
2) postmap /etc/postfix/relocated
3) Edit main.cf to include:
Code:
relocated_maps = hash:/etc/postfix/relocated
4) Delete the user(s) from the virtual table, since any user in there will get mail regardless (I left abuse@, noc@, postmaster@ et. al. and they still work).

Not quite as pretty as a custom message, but it should work well enough, in case someone actually reads it:

Code:
Delivery to the following recipient failed permanently:

    myalias@domain.net

Technical details of permanent failure: 
Google tried to deliver your message, but it was rejected by the recipient domain. 
We recommend contacting the other email provider for further information about the cause of this error. 
The error that the other server returned was: 550 550 5.1.6 <myalias@domain.net>: Recipient address rejected: User has moved to SAME_USERNAME_HERE@realdomain.net (state 14).

----- Original message -----
...
 
  


Reply

Tags
mail, postfix, reject, spam, virtual


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
[SOLVED] POSTFIX - virtual domain and alias maps results in 'unknown user' brenton.williams Linux - Server 2 08-19-2009 01:32 AM
Virtual Email Account for virtual domain in Postfix javed_dogar Linux - Server 7 10-17-2008 01:31 PM
POSTFIX with VIRTUAL DOMAIN jgph71 Linux - Software 3 10-14-2008 02:24 AM
Postfix Virtual Domain Kalevra Linux - Server 1 03-14-2008 02:02 AM
Postfix virtual domain eyt Linux - Newbie 0 02-23-2004 06:07 PM


All times are GMT -5. The time now is 11:27 PM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration