This part, at least, I can explain:  mutt (and mail) knows nothing about the aliases in /etc/aliases.  It only knows its own aliases (defined in .muttrc).

Any mail sent to an address without a hostname is for the local system by default, so mail to just "root" gets @localhost appended.

The aliases in /etc/aliases are handled by the MTA (postfix, in your case), so it attempts to deliver the mail to root@localhost, but checks its own list of aliases and sees that mail for root@localhost should be delivered to to@recipient.domain and forwards it there.  It doesn't touch the To: header in the process, because, if it did, then you wouldn't have any way of knowing what address your mail was sent to, only where it was finally delivered to after all forwarding, etc.

If you want the address in the To: header to match the final delivery address, you'll need to create a mutt alias for "root" which maps to that address, either manually or (as already suggested) with a script that translates aliases from /etc/aliases to .muttrc.

On 9/29/21 7:43 PM, orsomannaro wrote:
Both mutt and mail (from mailutils) correctly translate the alias from /et/aliases but the incoming email "To:" header turns out to be <alias>@<local postfix domain> instead of <to>@<recipient domain>

Il giorno mer 29 set 2021 alle ore 17:49 orsomann...@gmail.com <mailto:orsomann...@gmail.com> <orsomann...@gmail.com <mailto:orsomann...@gmail.com>> ha scritto:

    > It seems to me that this is a mail client question, not a BackupPC
    > question.

    I know and ... honestly: I posted here in the hope that someone could
    suggest an alternative way to send notifications from BackupPC,
    because
    I went insane trying to send attachments with sendamil provided by
    Postfix ...


    > Perhaps you will need to create a script which takes your
    /etc/aliases
    > and outputs text suitable for mutt

    Thank you so much for your answer!



_______________________________________________
BackupPC-users mailing list
BackupPC-users@lists.sourceforge.net
List:    https://lists.sourceforge.net/lists/listinfo/backuppc-users
Wiki:    https://github.com/backuppc/backuppc/wiki
Project: https://backuppc.github.io/backuppc/
_______________________________________________
BackupPC-users mailing list
BackupPC-users@lists.sourceforge.net
List:    https://lists.sourceforge.net/lists/listinfo/backuppc-users
Wiki:    https://github.com/backuppc/backuppc/wiki
Project: https://backuppc.github.io/backuppc/

Reply via email to