This is a discussion on Alias/virtual confusion within the mailing.postfix.users forums, part of the Mail Servers and Related category; I'm a bit confused on aliases and virtual and delivery methods and would appreciate some clarification. I'll try ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
I'm a bit confused on aliases and virtual and delivery methods and
would appreciate some clarification. I'll try to keep it brief. BTW, I'm using postfix 1.1.11. Yes, I realize I need to upgrade. I'll get around to that at some point, but I want to better understand the current system before I build a new one. Other possibly relevant info: I've tied this postfix into an amavis/spamassassin/clamav combo. I believe 'postconf -n' output is generally requested here... --- alias_database = hash:/etc/postfix/aliases alias_maps = hash:/etc/postfix/aliases command_directory = /usr/sbin config_directory = /etc/postfix content_filter = smtp:localhost:10024 daemon_directory = /usr/libexec/postfix debug_peer_level = 2 local_recipient_maps = hash:/etc/postfix/local_recipients, $alias_maps mail_owner = postfix mailq_path = /usr/bin/mailq.postfix manpage_directory = /usr/share/man mydestination = $myhostname, localhost.localdomain, localhost.$mydomain, mail.$mydomain, /etc/postfix/local-domains mydomain = SOMEDOMAIN.com myhostname = SOMEDOMAIN.com newaliases_path = /usr/bin/newaliases.postfix queue_directory = /var/spool/postfix readme_directory = /usr/share/doc/postfix-1.1.11/README_FILES relay_domains = /etc/postfix/relay_domains sample_directory = /usr/share/doc/postfix-1.1.11/samples sendmail_path = /usr/sbin/sendmail.postfix setgid_group = postdrop smtpd_recipient_restrictions = permit_mynetworks, check_client_access hash:/etc/postfix/client_access, check_relay_domains virtual_maps = hash:/etc/postfix/virtual --- I've only changed the domain and hostname, and removed the tabs since the google reader leaves them in. For starters, it doesn't seem that the aliases file is parsed. If I add an entry there, I can't receive mail. And I can't receive mail for any of the entries there. This may be normal, since some of my reading suggests that aliases is just used for local delivery, but I'm not sure I get that right. Anything I add to virtual will receive mail. As above, some reading suggests to me that this is normal for virtual delivery, which implies that's what I'm using. But the default method, if I'm not mistaken, is local, and I don't see where it's been explicitly changed. Now, if aliases isn't being parsed, then I would think removing (commenting) the alias_maps and alias_database in main.cf shouldn't cause any harm, but mail won't go through if I do that, and it doesn't return a delivery failure. The /etc/postfix/local_recipients is a map I set up when adding in the amavis combo a few months ago to counter the problem of valid mails being bounced as having invalid addresses. It may be part of my problem, but I've not made it around to testing that out yet. Also, I've taken the contents of aliases and added them (sans colons) to virtual and can deliver messages to those names in that arrangement. Essentially, I'm confused, as you can likely tell. Can you clarify why my setup isn't behaving as I expect, or where I'm thinking incorrectly? Thanks for your effort! |
|
|||
|
AdminTom wrote:
> I'm a bit confused on aliases and virtual and delivery methods and > would appreciate some clarification. I'll try to keep it brief. > > BTW, I'm using postfix 1.1.11. Yes, I realize I need to upgrade. I'll > get around to that at some point, but I want to better understand the > current system before I build a new one. Other possibly relevant info: > I've tied this postfix into an amavis/spamassassin/clamav combo. > > I believe 'postconf -n' output is generally requested here... > --- > alias_database = hash:/etc/postfix/aliases > alias_maps = hash:/etc/postfix/aliases > command_directory = /usr/sbin > config_directory = /etc/postfix > content_filter = smtp:localhost:10024 > daemon_directory = /usr/libexec/postfix > debug_peer_level = 2 > local_recipient_maps = hash:/etc/postfix/local_recipients, $alias_maps > mail_owner = postfix > mailq_path = /usr/bin/mailq.postfix > manpage_directory = /usr/share/man > mydestination = $myhostname, localhost.localdomain, > localhost.$mydomain, mail.$mydomain, /etc/postfix/local-domains > mydomain = SOMEDOMAIN.com > myhostname = SOMEDOMAIN.com > newaliases_path = /usr/bin/newaliases.postfix > queue_directory = /var/spool/postfix > readme_directory = /usr/share/doc/postfix-1.1.11/README_FILES > relay_domains = /etc/postfix/relay_domains > sample_directory = /usr/share/doc/postfix-1.1.11/samples > sendmail_path = /usr/sbin/sendmail.postfix > setgid_group = postdrop > smtpd_recipient_restrictions = permit_mynetworks, check_client_access > hash:/etc/postfix/client_access, check_relay_domains > virtual_maps = hash:/etc/postfix/virtual > --- > I've only changed the domain and hostname, and removed the tabs since > the google reader leaves them in. > > For starters, it doesn't seem that the aliases file is parsed. If I > add an entry there, I can't receive mail. And I can't receive mail for > any of the entries there. This may be normal, since some of my reading > suggests that aliases is just used for local delivery, but I'm not sure > I get that right. > > Anything I add to virtual will receive mail. As above, some reading > suggests to me that this is normal for virtual delivery, which implies > that's what I'm using. But the default method, if I'm not mistaken, is > local, and I don't see where it's been explicitly changed. > > Now, if aliases isn't being parsed, then I would think removing > (commenting) the alias_maps and alias_database in main.cf shouldn't > cause any harm, but mail won't go through if I do that, and it doesn't > return a delivery failure. > > The /etc/postfix/local_recipients is a map I set up when adding in the > amavis combo a few months ago to counter the problem of valid mails > being bounced as having invalid addresses. It may be part of my > problem, but I've not made it around to testing that out yet. > > Also, I've taken the contents of aliases and added them (sans colons) > to virtual and can deliver messages to those names in that arrangement. > > Essentially, I'm confused, as you can likely tell. Can you clarify why > my setup isn't behaving as I expect, or where I'm thinking incorrectly? > Thanks for your effort! > The alias_maps is only for local recipients, and shouldn't contain any domain names. For example: testuser: tom Reference: man 5 aliases virtual_maps can do the same job as an alias file, plus more. It can be used for local and remote recipients, and can use domain names, or not. And can map whole domain names too. Reference: man 5 virtual local_recipient_maps as used to define valid recipient names, so that Postfix accepts email for them instead of rejecting them. Typically it points to any aliases and virtual files, and the system password file (unix:passwd.byname). If you typically build the aliases database with the "newaliases" command, then leave the colons in (for Sendmail compability). If you build it with "postmap", then omit the colons. -- Greg |
|
|||
|
Greg Hackney wrote: > AdminTom wrote: > > I'm a bit confused on aliases and virtual and delivery methods and > > would appreciate some clarification. I'll try to keep it brief. > > > > BTW, I'm using postfix 1.1.11. Yes, I realize I need to upgrade. I'll > > get around to that at some point, but I want to better understand the > > current system before I build a new one. Other possibly relevant info: > > I've tied this postfix into an amavis/spamassassin/clamav combo. > > > > I believe 'postconf -n' output is generally requested here... > > --- > > alias_database = hash:/etc/postfix/aliases > > alias_maps = hash:/etc/postfix/aliases > > command_directory = /usr/sbin > > config_directory = /etc/postfix > > content_filter = smtp:localhost:10024 > > daemon_directory = /usr/libexec/postfix > > debug_peer_level = 2 > > local_recipient_maps = hash:/etc/postfix/local_recipients, $alias_maps > > mail_owner = postfix > > mailq_path = /usr/bin/mailq.postfix > > manpage_directory = /usr/share/man > > mydestination = $myhostname, localhost.localdomain, > > localhost.$mydomain, mail.$mydomain, /etc/postfix/local-domains > > mydomain = SOMEDOMAIN.com > > myhostname = SOMEDOMAIN.com > > newaliases_path = /usr/bin/newaliases.postfix > > queue_directory = /var/spool/postfix > > readme_directory = /usr/share/doc/postfix-1.1.11/README_FILES > > relay_domains = /etc/postfix/relay_domains > > sample_directory = /usr/share/doc/postfix-1.1.11/samples > > sendmail_path = /usr/sbin/sendmail.postfix > > setgid_group = postdrop > > smtpd_recipient_restrictions = permit_mynetworks, check_client_access > > hash:/etc/postfix/client_access, check_relay_domains > > virtual_maps = hash:/etc/postfix/virtual > > --- > > I've only changed the domain and hostname, and removed the tabs since > > the google reader leaves them in. > > > > For starters, it doesn't seem that the aliases file is parsed. If I > > add an entry there, I can't receive mail. And I can't receive mail for > > any of the entries there. This may be normal, since some of my reading > > suggests that aliases is just used for local delivery, but I'm not sure > > I get that right. > > > > Anything I add to virtual will receive mail. As above, some reading > > suggests to me that this is normal for virtual delivery, which implies > > that's what I'm using. But the default method, if I'm not mistaken, is > > local, and I don't see where it's been explicitly changed. > > > > Now, if aliases isn't being parsed, then I would think removing > > (commenting) the alias_maps and alias_database in main.cf shouldn't > > cause any harm, but mail won't go through if I do that, and it doesn't > > return a delivery failure. > > > > The /etc/postfix/local_recipients is a map I set up when adding in the > > amavis combo a few months ago to counter the problem of valid mails > > being bounced as having invalid addresses. It may be part of my > > problem, but I've not made it around to testing that out yet. > > > > Also, I've taken the contents of aliases and added them (sans colons) > > to virtual and can deliver messages to those names in that arrangement. > > > > Essentially, I'm confused, as you can likely tell. Can you clarify why > > my setup isn't behaving as I expect, or where I'm thinking incorrectly? > > Thanks for your effort! > > > > > The alias_maps is only for local recipients, and shouldn't contain any > domain names. For example: > > testuser: tom > > Reference: man 5 aliases > > virtual_maps can do the same job as an alias file, plus more. It can be > used for local and remote recipients, and can use domain names, or not. > And can map whole domain names too. > > Reference: man 5 virtual > > > local_recipient_maps as used to define valid recipient names, so > that Postfix accepts email for them instead of rejecting them. > Typically it points to any aliases and virtual files, and the > system password file (unix:passwd.byname). > > If you typically build the aliases database with the "newaliases" > command, then leave the colons in (for Sendmail compability). If > you build it with "postmap", then omit the colons. > > -- > Greg Thanks for the clarifications, and sorry for the delay in replying. This helps point me in the right direction. Plain English works a little better than the man pages sometimes. |
![]() |
| Thread Tools | |
| Display Modes | |
|
|