I've just installed postifx 2.2.7 on Fedora fc13, to replace a previous perfectly working postfix 2.2.5 on fc5, copying the changes made in /etc/postfix/main.cf as used previously. The host is on a private network from which I need to send to Internet mail hosts using a domain I own, even though it is not linked to my modem IP (stress, I have this working fine under 2.2.5/fc5)
The problem is my mail is rejected because [almost] no matter what I do, the "from" field in the sent mail picks up whatever 127.0.0.1 is aliased to in /etc/hosts and *nothing* I set in the main.cf makes any difference! As this is the "local" name (eg localhost.localdomain) the destination rejects it as an unknown domain.
I can make it work by setting 127.0.0.1 in /etc/hosts to the domain I own and want the mail to appear to come from, but I should not have to do this, I think. the output of postconf -n is listed below (I've changed the actual domain to xyzzy.com to protect the innocent--namely me!) :
Code:
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_protocols = all
mail_owner = postfix
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
masquerade_domains = kali.xyzzy.com xyzzy.com localhost.localdomain xyzzy.com
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain,
mydomain = xyzzy.com
myhostname = kali.xyzzy.com
mynetworks = 192.168.1.0/28, 127.0.0.0/8
myorigin = $mydomain
newaliases_path = /usr/bin/newaliases.postfix
proxy_interfaces = 220.233.47.38
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.7.0/README_FILES
sample_directory = /usr/share/doc/postfix-2.7.0/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
smtp_generic_maps = hash:/etc/postfix/generic
unknown_local_recipient_reject_code = 550
As I understant it, the myorigin and mydomain should do the job!
The smtp_generic_maps and masquerade_domains were experiments that had no effect.
Last: I notice 2.2.7 uses sendmail.postfix rather than sendmail itself (as was used in 2.2.5). On the previous setup that worked, I had a DM entry in /etc/mail/sendmail.cf whay may have been doing the masquerading for me.
I'm using mailx for testing and can force the "from" to the acceptable value using the -r <from> parameter, but I did not have to do this under 2.2.5/fc5 and besides, it screws up my scripts.