Re: Virtual reject reason

2010-01-09 Thread /dev/rob0
On Fri, Jan 08, 2010 at 02:33:37PM -0500, Christopher Hackman wrote:
 Is it possible to customize the following error message?
 
 MAIL FROM: u...@remotedomain.com
 250 2.1.0 Ok
 RCPT TO: invalidacco...@virtualdomain.com
 550 5.1.1 invalidacco...@virtualdomain.com: Recipient address 
 rejected: virtualdomain.com
 
 In this sanitized example, virtualdomain.com is just that, as is 
 invalidaccount. I see unknown_virtual_mailbox_reject_code will 
 let me change the response code, but not the text.

Right. A fairly straightforward (not simple, but doable) workaround
is to implement a check_recipient_access lookup against your list of
valid addresses. Your virtual_mailbox_maps query will not work as is,
but a little bit of SQL/LDAP magic or a simple policy service could
do it. Pseudocode:

if domain matches virtual_mailbox_domains:
   if u...@domain is found in virtual_mailbox_maps: return DUNNO
   else: return 550 5.1.1 u...@domain Your-custom-reject-text
   endif
endif
(repeat for other address classes in use)

Perhaps one of the existing publically available policy servers can
already do this, I don't know. Is this really worth the trouble? I
would think not, but if you still want to do it, check out these
references:

Access controls:
http://www.postfix.org/SMTPD_ACCESS_README.html
http://www.postfix.org/access.5.html

SQL or LDAP interaction:
http://www.postfix.org/MYSQL_README.html
http://www.postfix.org/mysql_table.5.html
http://www.postfix.org/PGSQL_README.html
http://www.postfix.org/pgsql_table.5.html
http://www.postfix.org/LDAP_README.html
http://www.postfix.org/ldap_table.5.html

Policy service protocol:
http://www.postfix.org/SMTPD_POLICY_README.html

and see this for links to existing policy server projects:
http://www.postfix.org/addon.html#policy
-- 
Offlist mail to this address is discarded unless
/dev/rob0 or not-spam is in Subject: header


Re: Virtual reject reason

2010-01-08 Thread Wietse Venema
Christopher Hackman:
 Hello,
 
  I'm pretty new to Postfix, and I'm experimenting with using it for our new
 inbound MTA. Is it possible to customize the following error message?
 
 MAIL FROM: u...@remotedomain.com
 250 2.1.0 Ok
 RCPT TO: invalidacco...@virtualdomain.com
 550 5.1.1 invalidacco...@virtualdomain.com: Recipient address rejected:
 virtualdomain.com

Depending on the show_user_unknown_table_name parameter setting, Postfix
replies with one of the following:

550 5.1.1 u...@example.com: Recipient address rejected: user unknown
550 5.1.1 u...@example.com: Recipient address rejected: user unknown in local 
recipient table
550 5.1.1 u...@example.com: Recipient address rejected: user unknown in 
virtual alias table
550 5.1.1 u...@example.com: Recipient address rejected: user unknown in 
virtual mailbox table
550 5.1.1 u...@example.com: Recipient address rejected: user unknown in relay 
recipient table

 In this sanitized example, virtualdomain.com is just that, as is
 invalidaccount. I see unknown_virtual_mailbox_reject_code will let me
 change the response code, but not the text. I'd expected to find something
 like a unknown_virtual_mailbox_reject_reason parameter, but I don't see
 one. Is this possible?

This is not documented, therefore it is not implemented.

Wietse