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

  • How high can a Xeon CPU get?
  • bash fix PATH environment variable "command not found" solution
  • Ubuntu Linux Mint Debian Redhat Youtube Cannot Play HD or 4K videos, dropped frames or high CPU usage with Nvidia or AMD Driver
  • hostapd example configuration for high speed AC on 5GHz using WPA2
  • hostapd how to enable and use WPS to connect wireless devices like printers
  • Dell Server Workstation iDRAC Dead after Firmware Update Solution R720, R320, R730
  • Cloned VM/Server/Computer in Linux won't boot and goes to initramfs busybox Solution
  • How To Add Windows 7 8 10 11 to GRUB Boot List Dual Booting
  • How to configure OpenDKIM on Linux with Postfix and setup bind zonefile
  • Debian Ubuntu 10/11/12 Linux how to get tftpd-hpa server setup tutorial
  • efibootmgr: option requires an argument -- 'd' efibootmgr version 15 grub-install.real: error: efibootmgr failed to register the boot entry: Operation not permitted.
  • Apache Error Won't start SSL Cert Issue Solution Unable to configure verify locations for client authentication SSL Library Error: 151441510 error:0906D066:PEM routines:PEM_read_bio:bad end line SSL Library Error: 185090057 error:0B084009:x509 certif
  • Linux Debian Mint Ubuntu Bridge br0 gets random IP
  • redis requirements
  • How to kill a docker swarm
  • docker swarm silly issues
  • isc-dhcp-server dhcpd how to get longer lease
  • nvidia cannot resume from sleep Comm: nvidia-sleep.sh Tainted: Linux Ubuntu Mint Debian
  • zfs and LUKS how to recover in Linux
  • [error] (28)No space left on device: Cannot create SSLMutex Apache Solution Linux CentOS Ubuntu Debian Mint