Why is PostFix sending mail using the email address of the smtp account?
Hello,
I finally got PostFix up and running using gmails smtp server on port 587 using ssl. Some of my tools that send me reports seem to be able to change the FROM: address to indicate where the message is coming from but for some reason if I try to send an email from one of the linux accounts directly to an external recipient it litteraly sends the message using accountname@gmail.com instead of linuxaccountname@mydomain.com. Can someone help me out with this please? |
Could you post the output of the following command
Code:
postconf -n |
Heres the results of postconf -n
command_directory = /usr/sbin config_directory = /etc/postfix daemon_directory = /usr/libexec/postfix debug_peer_level = 1 default_privs = nobody disable_dns_lookups = yes html_directory = no local_destination_concurrency_limit = 2 mail_owner = postfix mail_spool_directory = /var/spool/mail mailbox_command = /usr/bin/procmail mailq_path = /usr/bin/mailq.postfix manpage_directory = /usr/share/man mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain newaliases_path = /usr/bin/newaliases.postfix queue_directory = /var/spool/postfix readme_directory = /usr/share/doc/postfix-2.2.8/README_FILES relayhost = [smtp.gmail.com]:587 sample_directory = /usr/share/doc/postfix-2.2.8/samples sendmail_path = /usr/sbin/sendmail.postfix setgid_group = postdrop smtp_enforce_tls = no smtp_sasl_auth_enable = yes smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd smtp_sasl_security_options = noanonymous smtp_tls_CAfile = /etc/postfix/sslcert/cacert.pem smtp_tls_loglevel = 1 smtp_use_tls = yes unknown_local_recipient_reject_code = 550 |
Run these two commands
Code:
postconf -e "myorigin = mydomain.com" Code:
postfix reload |
|
How are you submitting your mail?
|
There's your answer then - the problem isn't postfix, it's your MUA.
Postfix will add $myorigin to an unqualified address it processes. If the address is already fully-qualified, it will leave it alone - which is what is happening here. Now the question is, if the address is already fully-qualified by the time it gets to postfix, where is the address being generated? MUA (mutt, pine, etc) --> Postfix --> Internet SMTP Server My guess is your MUA. Try the following command: sendmail -f sender receiver@somewhere.com < /etc/fstab This will use Postfix's sendmail command, and should append $myorigin to the unqualified sender address before delivering it. |
Ok, well, I don't have sendmail installed but there was something call sendmail.postfix in the /usr/sbin directory. So I ran the following command.
/usr/sbin/sendmail.postfix -f sender me@myhouse.com < /etc/fstab and i received the message from root(me@gmail.com). It changed the name of the sender but not the email address it came from. So that sorta worked but not 100% |
So I am having the same problem, I did the sendmail -f sender reciever@somewhere.com and when i got my email it was from sender@localhost.localdomain I can't seem to fix this I would appreciate any and all help. Thanks
|
Quote:
/etc/hosts: Besides the default localhost, you should also have your host. Code:
192.168.0.x mail.example.com mail Code:
mail.example.com /etc/postfix/main.cf: Code:
myhostname = mail.example.com GANI |
|
using -f flag only changes the envelope, not the header btw
What distro are you using? |
Thanks for the suggestions I'll give them a try and let you know how it works out
|
Alright, well, I've tried everything suggested here as well and it doesn't seem to want to work. I know it has got to be something wrong with the configuration. I'm using Fedora Core 5 at this point.
Below is a small snipit from the configuration file of a tool called DenyHosts. This configuration is to pre-define the SMTP parameters for this tool so that when someone gets blocked from my box it will send me an email indicating who was blocked. When I receive this message in my email it is indeed coming from "DenyHosts <denyhosts@subdomain.domain.net>". I'm using a subdomain because it is a free domain, hehe, but it works none the less. I do not know how the binary file is actually executing the sending of this email but I know for a fact that it is using the gmail smtp server because when I log into GMAIL I see a copy of every last one of the emails that this tool sent me in the Inbox as a new message for some reason. ADMIN_EMAIL = myemailaddy@hotmail.com # ####################################################################### ####################################################################### # SMTP_HOST = localhost SMTP_PORT = 25 SMTP_FROM = DenyHosts <denyhosts@durhamnetwork.sytes.net> SMTP_SUBJECT = DenyHosts Report -Dave |
what is the output of the hostname command?
|
All times are GMT -5. The time now is 06:30 AM. |