Understanding /etc/aliases from sendmail when using with postfix or other MTA's

understanding /etc/aliases
*remember to apply changes you need to run "newaliases" after editing /etc/aliases

one thing I don't get is that it doesn't allow you to specify the whole e-mail address on the left-hand side
eg:

yourfullemail@domain.com: someotheremail@domain.com

postalias: warning: /etc/aliases, line 109: name must be local (if you try the above)


It works more like this:

yourfullemail: anotheremail, email@anotherhost.com

How does that work? How does it know what domain to send it to or is it implicit assuming your SMTP passes the full user and domain at the time and the alias resolves it?
*It works very poorly!
an alias like this:

someuser: anotheruser@domain.com
you could use someuser@anydomainhostedonyourserver.com and it will still forward it!!!!!
I don't get how /etc/aliases was designed, it's very silly, isn't there a better flat file alternative or one that just makes sense and works?

I mean what if we have on the same server the following:
yourfullemail@onedomain.com
yourfullemail@secondomain.com

how does that work, does it suddenly alias/forward e-mail to both which would be incorrect?

As test examples I have the following user in my dovecot passwd file:
sometestuser@domain.com

--
If I set the following it won't deliver to me anymore:
--
sometestuser: someother@domain.com

It will forward the mail to someother@domain.com and basically it means sometestuser@domain.com can never receive e-mail!

Jan 24 11:39:43 server.box postfix/pipe[17880]: 332F5337000E: to=, orig_to=, relay=dovecot, delay=0.01, delays=0.01/0/0/0, dsn=5.1.1, status=bounced (user unknown)
Jan 24 11:39:43 server.box postfix/qmgr[17496]: 332F5337000E: removed

--
Getting looped!
--
Say I edit aliases to be like this:

sometestuser: someother
someother: sometestuser

That creates a loop as you'll see below

Jan 24 11:41:45 server.box postfix/local[21603]: warning: alias database loop for product-support
Jan 24 11:41:45 server.box postfix/local[21603]: 29E2B337000E: to=, orig_to=, relay=local, delay=0.03, delays=0.01/0/0/0.02, dsn=5.4.6, status=bounced (alias database loop for product-support)
Jan 24 11:41:45 server.box postfix/qmgr[17496]: 29E2B337000E: removed



---
Can't get alias to work, it bounces
---
someother: sometestuser
it translated the destination to the wrong domain, it made it to a default domain instead of the correct domain.
eg. it should have been sometestuser@domain.com but it defaulted to being sometestuser@maindomain.com

Jan 24 11:52:01 server.box postfix/qmgr[17496]: 7B19E337000C: from=, size=681, nrcpt=1 (queue active)
Jan 24 11:52:01 server.box postfix/pipe[28169]: 7B19E337000C: to=, orig_to=, relay=dovecot, delay=0.27, delays=0.25/0.01/0/0.01, dsn=5.1.1, status=bounced (user unknown)
Jan 24 11:52:01 server.box postfix/cleanup[28163]: AA02B337000E: message-id=<20110124195201.AA02B337000E@mail.server.com.com>
Jan 24 11:52:01 server.box postfix/qmgr[17496]: AA02B337000E: from=<>, size=2529, nrcpt=1 (queue active)
Jan 24 11:52:01 server.box postfix/bounce[28171]: 7B19E337000C: sender non-delivery notification: AA02B337000E
Jan 24 11:52:01 server.box postfix/qmgr[17496]: 7B19E337000C: removed
Jan 24 11:52:01 server.box deliver(sometestuser@domain.com): msgid=<20110124195201.AA02B337000E@mail.compevo.com>: saved mail to INBOX
Jan 24 11:52:01 server.box postfix/pipe[28169]: AA02B337000E: to=, relay=dovecot, delay=0.05, delays=0.01/0/0/0.04, dsn=2.0.0, status=sent (delivered via dovecot service)
Jan 24 11:52:01 server.box postfix/qmgr[17496]: AA02B337000E: removed

Actually it's weird the domain it was supposed to arrive to never worked the alias assumed some other weird domain, to fix it you have to explicitly specify it:

someother: sometestuser@specificdomain.com


*It works very poorly!
an alias like this:
someuser: anotheruser@domain.com
you could use someuser@anydomainhostedonyourserver.com and it will still forward it!!!!!
I don't get how /etc/aliases was designed, it's very silly, isn't there a better flat file alternative or one that just makes sense and works?


Tags:

etc, aliases, sendmail, postfix, mta, sunderstanding, quot, newaliases, editing, doesn, specify, eg, yourfullemail, domain, someotheremail, postalias, anotheremail, email, anotherhost, implicit, smtp, user, alias, resolves, poorly, someuser, anotheruser, anydomainhostedonyourserver, isn, server, onedomain, secondomain, incorrect, examples, dovecot, passwd, sometestuser, someother, orig_to, relay, delays, dsn, bounced, qmgr, looped, edit, creates, ll, database, bounces, translated, destination, default, defaulted, maindomain, nrcpt, queue, active, cleanup, aa, bounce, sender, notification, msgid, compevo, inbox, via, explicitly, specificdomain,

Latest Articles

  • Centos 7 how to save iptables rules like Centos 6
  • nfs tuning maximum amount of connections
  • qemu-kvm error "Could not initialize SDL(No available video device) - exiting"
  • Centos 7 tftpd will not work with selinux enabled
  • Debian Ubuntu Mint Howto Create Bridge (br0)
  • How To Control Interface that dhcpd server listens to on Debian based Linux like Mint and Ubuntu
  • LUKS unable to type password to unlock during boot on Debian, Ubuntu and Mint
  • Debian Ubuntu and Linux Mint Broken Kernel After Date - New Extra Module Naming Convention
  • Wordpress overwrites and wipes out custom htaccess rules and changes soluton
  • Apache htaccess and mod_rewrite how to redirect and force all URLs and visitors to the SSL / HTTPS version
  • python 3 pip cannot install mysql module
  • QEMU-KVM won't boot Windows 2016 or 2019 server on an Intel Core i3
  • Virtualbox vbox not starting
  • Bind / named not responding to queries solution
  • Linux Mint How To Set Desktop Background Image From Bash Prompt CLI
  • ImageMagick Convert PDF Not Authorized
  • ImageMagick Converted PDF to JPEG some files have a black background solution
  • Linux Mint Mate Customize the Lock screen messages and hide username and real name
  • Ubuntu/Gnome/Mint/Centos How To Take a partial screenshot
  • ssh how to verify your host key / avoid MIM attacks