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

  • 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
  • Cisco IP Phone CP-8845 8800/8900 Series How To Reset To Factory Settings Instructions
  • ls how to list ONLY directories
  • How to encrypt your SSH private key file id_rsa
  • Linux Mint 18 Disable User Name List from showing on Login Screen
  • Firefox Cannot Hit Enter Key In Address Bar and Location History Not Working
  • Cisco Unified Communications Manager / CUCM IP 8.6,10,12 Install Error Solution
  • Ubuntu Debian Mint Linux SSHD OpenSSH Server Not Starting After Reboot Solution
  • nmap how to scan for all ports and not just the 1000 most common ports
  • Windows 7,8,10 and Server 2008, 2012, 2016, 2019 Read Only Attribute Won't Go Away
  • bind / named how to make a wildcard record and retain defined A records
  • Cisco Unified Communications Manager 12 Install Errors on Proxmox/KVM
  • Local Vs Universally Administered MAC Address NIC Refuses to come up
  • Cisco Unified Communications Manager 12 CUCM 12 - How To Enable Video Calling
  • Windows 7, 8, 10, Windows Server 2008, 2012, 2016, 2019 How To AC97 Audio Drivers and Other Unsigned Drivers
  • Cisco Unified Communications Manager / CUCM IP Telephony Definitions