On Wed, Mar 02, 2011 at 07:26:55AM -0800, David Newman wrote: > I'm looking to automate mailing of user reports with a perl script > that sends a message via a postfix server. The postfix server is > configured to use virtual domains, and all users in these domains > can send and receive messages. > > The script's recipients are all over the Net and neither their > domain nor their usernames are defined on this postfix server.
So configure your script to send just like your regular users do. http://www.postfix.org/BASIC_CONFIGURATION_README.html#relay_from http://www.postfix.org/SASL_README.html#server_sasl > The postfix server rejects the message because recipients don't > have accounts on this box. > > The error message in maillog is like this: > > Mar 1 13:30:04 mail3 postfix/smtpd[99904]: NOQUEUE: reject: RCPT from > hostB.networktest.com[1.2.3.4]: 550 5.1.1 > <someu...@someexternaldomain.com>: Recipient address rejected: User > unknown in relay recipient table; from=<dnew...@networktest.com> > to=<someu...@someexternaldomain.com> proto=ESMTP > helo=<localhost.localdomain> This is reject_unauth_destination in smtpd_recipient_restrictions, which typically would be preceded by permit_mynetworks and if using SASL AUTH, permit_sasl_authenticated. If you have those permit_* restrictions, neither case is being met. > In main.cf, relay_recipient_maps calls No, this is wrong. The relay domain class is for when your server is MX host for a domain, but not the final destination. This is not the issue as you have described. You want per-client (mynetworks) or per- user (SASL AUTH) relaying. -- Offlist mail to this address is discarded unless "/dev/rob0" or "not-spam" is in Subject: header