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=<someother@domain.com>, orig_to=<sometestuser@domain.com>, 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=<someother@domain.com>, orig_to=<sometestuser@domain.com>, 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=<sometestuser@domain.com>, size=681, nrcpt=1 (queue active)
Jan 24 11:52:01 server.box postfix/pipe[28169]: 7B19E337000C: to=<sometestuser@domain.com>, orig_to=<someother@domain.com>, 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=<sometestuser@domain.com>, 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

  • FreePBX 17 How To Add a Trunk
  • Docker Container Onboot Policy - How to make sure a container is always running
  • FreePBX 17 How To Add Phones / Extensions and Register
  • Warning: The driver descriptor says the physical block size is 2048 bytes, but Linux says it is 512 bytes. solution
  • Cisco How To Use a Third Party SIP Phone (eg. Avaya, 3CX)
  • Cisco Unified Communication Manager (CUCM) - How To Add Phones
  • pptp / pptpd not working in DD-WRT iptables / router
  • systemd-journald high memory usage solution
  • How to Install FreePBX 17 in Linux Debian Ubuntu Mint Guide
  • How To Install Cisco's CUCM (Cisco Unified Communication Manager) 12 Guide
  • Linux Ubuntu Redhat How To Extract Images from PDF
  • Linux and Windows Dual Boot Issue NIC Won't work After Booting Windows
  • Cisco CME How To Enable ACD hunt groups
  • How to install gns3 on Linux Ubuntu Mint
  • How to convert audio for Asterisk .wav format
  • Using Cisco CME Router with Asterisk as a dial-peer
  • Cisco CME How To Configure SIP Trunk VOIP
  • Virtualbox host Only Network Error Failed to save host network interface parameter - Cannot change gateway IP of host only network
  • Cisco CME and C7200 Router Testing and Learning Environment on Ubuntu 20+ Setup Tutorial Guide
  • Abusive IP ranges blacklist