This is the first patch to Postfix 19991231. It fixes no bugs but rather adds a safety net for a common configuration problem. A common error is to list Postfix virtual domains in the mydestination parameter. This causes the new optional local_recipient_maps feature to reject mail for virtual users. Postfix now explicitly tests for this condition and logs a warning instead of refusing the mail. The patch is too large for email. It adds only a few lines of code. The bulk of the patch is spent on clarification in the documentation and in the sample configuration files, plus some feedback on the documentation that I received over the last couple days. The patch, postfix-19991231-patch01.gz, and a complete source kit, postfix-19991231-pl01.tar.gz, will be made available from the primary site: ftp://ftp.porcupine.org/mirrors/postfix-release/official/ http://ftp.porcupine.org/mirrors/postfix-release/index.html including a PGP signature (postfix-19991231-pl01.tar.gz.sig). Wietse Prereq: "Postfix-19991231" diff -cr /tmp/postfix-19991231/global/mail_version.h ./global/mail_version.h *** /tmp/postfix-19991231/global/mail_version.h Fri Dec 31 16:18:04 1999 --- ./global/mail_version.h Sun Jan 2 12:38:15 2000 *************** *** 15,21 **** * Version of this program. */ #define VAR_MAIL_VERSION "mail_version" ! #define DEF_MAIL_VERSION "Postfix-19991231" extern char *var_mail_version; /* LICENSE --- 15,21 ---- * Version of this program. */ #define VAR_MAIL_VERSION "mail_version" ! #define DEF_MAIL_VERSION "Postfix-19991231-pl01" extern char *var_mail_version; /* LICENSE diff -cr /tmp/postfix-19991231/HISTORY ./HISTORY *** /tmp/postfix-19991231/HISTORY Fri Dec 31 14:41:07 1999 --- ./HISTORY Sun Jan 2 17:11:48 2000 *************** *** 3515,3517 **** --- 3515,3529 ---- to enable LMTP delivery over UNIX-domain sockets. The goal is to simplify the experimental LMTP delivery agent by ripping out the privileged code that forks the LMTP server. + + 20000102 + + Clarified documentation after early feedback on the 19991231 + release by Drew Derbyshire, Ollivier Robert, Khetan Gajjar. + + Sanity check: a common error is to list Postfix virtual + domains in the mydestination parameter. This causes the + new optional local_recipient_maps feature to reject mail + for virtual users. The SMTP server now explicitly tests + for this common error and logs a warning instead of refusing + the mail. File: smtpd/smtpd_check.c. diff -cr /tmp/postfix-19991231/RELEASE_NOTES ./RELEASE_NOTES *** /tmp/postfix-19991231/RELEASE_NOTES Fri Dec 31 18:06:52 1999 --- ./RELEASE_NOTES Sun Jan 2 12:41:54 2000 *************** *** 76,85 **** - The SMTP server now rejects mail for unknown users in virtual domains that are defined by Postfix virtual maps. ! - The SMTP server optionally rejects mail for unknown local users. ! Use "local_recipient_maps = $alias_maps, unix:passwd.byname" if ! your local mail is delivered by a UNIX-style local delivery agent. ! See example in conf/main.cf. - Use "disable_vrfy_command = yes" to disable the SMTP VRFY command. This prevents some forms of address harvesting. --- 76,85 ---- - The SMTP server now rejects mail for unknown users in virtual domains that are defined by Postfix virtual maps. ! - The SMTP server can reject mail for unknown local users. Specify ! "local_recipient_maps = $relocated_maps, $alias_maps, unix:passwd.byname" ! if your local mail is delivered by a UNIX-style local delivery ! agent. See example in conf/main.cf. - Use "disable_vrfy_command = yes" to disable the SMTP VRFY command. This prevents some forms of address harvesting. diff -cr /tmp/postfix-19991231/conf/main.cf ./conf/main.cf *** /tmp/postfix-19991231/conf/main.cf Mon Dec 27 16:03:38 1999 --- ./conf/main.cf Sun Jan 2 14:19:11 2000 *************** *** 125,131 **** # Beware: if the Postfix SMTP server runs chrooted, you may have to # copy the passwd database into the jail. This is system dependent. # ! #local_recipient_maps = $alias_maps unix:passwd.byname # ADDRESS REWRITING # --- 125,134 ---- # Beware: if the Postfix SMTP server runs chrooted, you may have to # copy the passwd database into the jail. This is system dependent. # ! # FOR THIS TO WORK, DO NOT SPECIFY VIRTUAL DOMAINS IN MYDESTINATION. ! # MYDESTINATION MUST LIST NON-VIRTUAL DOMAINS ONLY. ! # ! #local_recipient_maps = $relocated_maps $alias_maps unix:passwd.byname # ADDRESS REWRITING # diff -cr /tmp/postfix-19991231/html/faq.html ./html/faq.html *** /tmp/postfix-19991231/html/faq.html Fri Dec 31 17:27:19 1999 --- ./html/faq.html Sun Jan 2 17:24:04 2000 *************** *** 97,104 ****
--- 1135,1141 ----
Postfix accepts mail for non-existing local users
The information in this section applies to Postfix versions 19991216
! and later. See elsewhere for unknown
virtual users.
*************** *** 1145,1151 ****
/etc/postfix/main.cf: ! local_recipient_maps = $alias_maps, unix:passwd.byname
--- 1157,1163 ----
/etc/postfix/main.cf: ! local_recipient_maps = $relocated_maps $alias_maps, unix:passwd.byname
*************** *** 1527,1532 **** --- 1539,1603 ----
+ +
+ + Solution: + +
+ +
+ +
+ /etc/postfix/virtual: + virtual.domain whatever ++ +
+ +
+ + For more information on how to set up virtual domains, see the virtual manual page. + +
! Problem: mail for an unknown virtual user results in an ugly "mail ! loops back to myself" error from Postfix.
! Solution: add a magical entry to the Postfix virtual database:
!
! /etc/postfix/virtual: ! virtual.domain whatever !
! This entry will also fix the problem that the Postfix SMTP server ! refuses to receive mail for the virtual ! domain. ! !
! ! For more information on how to set up virtual domains, see the virtual manual page. ! !
!
! /etc/postfix/virtual: ! virtual.domain whatever !
- - For more details, see the virtual - manual page. -
! Answer: I hope we all agree that delivering a domain to a mailbox ! is disgusting practice. Forwarding mail via SMTP or UUCP would be ! a much better choice. Unfortunately, neither SMTP nor UUCP are a ! usable alternative for legions of windows users.
! That said, it is possible to propagate the original virtual recipient ! information to the Delivered-To: header. The trick is to use a ! virtual map that uses regular expressions instead of the more ! traditional indexed files.
! The following delivers username@virtual.domain with a ! Delivered-To: message header that contains joe+username@your.domain. ! Postfix already puts the envelope sender address in the Return-Path: ! header. The information in the Delivered-To: and Return-Path: ! headers is sufficient to reliably implement a domain in a mailbox.
!
! /etc/postfix/main.cf ! recipient_delimiter = + ! virtual_maps = ! ...non-regexp virtual maps... ! regexp:/etc/postfix/virtual_regexp ! /etc/postfix/virtual_regexp ! /^virtual\.domain$/ whatever ! /^(.*\)@virtual\.domain$/ joe+$1 !
+ Notes: +