Postfix is sending email from root to from email address

these are the settings in main.cf:

alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
debug_peer_level = 2
html_directory = no
inet_interfaces = localhost
inet_protocols = all
mail_owner = postfix
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
mydomain = realdomain.com
myorigin = realdomain.com
newaliases_path = /usr/bin/newaliases.postfix
readme_directory = /usr/share/doc/postfix-2.6.6/README_FILES
relayhost = secure.emailsrvr.com:587
sample_directory = /usr/share/doc/postfix-2.6.6/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
smtp_generic_maps = hash:/etc/postfix/generic
smtp_sasl_auth_enable = yes
smtp_sasl_mechanism_filter = AUTH LOGIN
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
unknown_local_recipient_reject_code = 550

settings of generic file:

@realdomain.com [email protected]

1 Like

Now I setup google smtp settings and my emails are flowing properly to my realdomain as well.

but from my realdomain to my realdomain emails are not sending.

now can I change from email address to my realdomain email address instead of showing gmail email address for notifications.

This ends up being delivered to [email protected], right?

(As far as I know smtp_generic_maps rewrites both sender and recipient addressesā€¦)

Are you sure about this or is is more something like [email protected] or [email protected]?

(I am basing myself on your previous posts where you used those domain names or message IDsā€¦

This is what you would want to rewrite to [email protected], no?

If this is, you would replace what is in generic with

[email protected] [email protected]

or

[email protected] [email protected]

and then do a

postmap hash:/etc/postfix/generic

to update the tableā€¦

As I said as far I know smtp_generic_maps rewrites both sender and recipient addresses, I think only canonical_maps can specify sender or recipient so on the left side you want only want to specify the phony domainā€¦

Good luck and have a nice day!

Nick