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

  • Linux qemu-kvm How To Enable Soundcard in Guestl
  • QEMU-KVM Windows and Server Guest Installs Mouse Tracking Pointer Location Solution
  • SSH Keep Alive To stop Disconnections
  • Linux How To Disable SATA NCQ For Better Performance
  • the sign-in method you're trying to use isn't allowed. For more info, contact your network administrator - solution for active directory
  • gsmartcontrol for Windows to Check the SMART S.M.A.R.T status
  • WebRTC Vulnerability Shows Local IP Address Even When Using a Proxy or VPN Firefox Fix And Disable Solution
  • chroot in Linux Howto Simple and Easy Guide
  • qemu-kvm qemu-system Image format was not specified for '/mnt/space/cucm12.img' and probing guessed raw. Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted. Specify the 'ra
  • Linux Over VNC VMWare How To Switch Virtual Terminals Console Without Using Ctrl+Alt+F1
  • Skype For Business 2015 and 2019 Guide, Reference, Howto and Troubleshooting Solutions
  • Centos 6 or 7 no DHCP IP during startup on first boot or reboot solution
  • Debian / Mint / Ubuntu net-tools packages provides netstat, ifconfig, route, arp and other classic network admin tools
  • Linux Mint XWindows Ubuntu MATE or Cinnamon How To Restart The GUI / Graphics / Session if it freezes without losing current windows or programs
  • Linux bash prompt why does it not show username@host and the current directory?
  • Microsoft SQL Server Check What Version is Running
  • How to install and setup LXC Containers (OpenVZ alternative) on Centos 6 / 7
  • Cisco CUCM Unified Communication Manager Howto Guide and Tutorials
  • SSH persistent and automatic login script for proxy
  • SSH proxy/command in the background or from cron script