LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 09-28-2006, 11:48 PM   #1
taigon
LQ Newbie
 
Registered: Mar 2006
Posts: 28

Rep: Reputation: 15
Question 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?
 
Old 09-28-2006, 11:53 PM   #2
WindowBreaker
Member
 
Registered: Oct 2005
Distribution: Slackware
Posts: 228

Rep: Reputation: 31
Could you post the output of the following command
Code:
postconf -n
I suspect the $myorigin setting may be the culprit
 
Old 10-02-2006, 03:18 PM   #3
taigon
LQ Newbie
 
Registered: Mar 2006
Posts: 28

Original Poster
Rep: Reputation: 15
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
 
Old 10-02-2006, 10:37 PM   #4
WindowBreaker
Member
 
Registered: Oct 2005
Distribution: Slackware
Posts: 228

Rep: Reputation: 31
Run these two commands
Code:
postconf -e "myorigin = mydomain.com"
Where mydomain.com is what you want outgoing emails to show in the "From:" header.

Code:
postfix reload
Then try sending an outgoing email again, and see if it's fixed.
 
Old 10-03-2006, 10:45 AM   #5
taigon
LQ Newbie
 
Registered: Mar 2006
Posts: 28

Original Poster
Rep: Reputation: 15
Nope, still shows up as myname@gmail.com

Is there anything else i can try?
 
Old 10-03-2006, 11:27 AM   #6
Berhanie
Senior Member
 
Registered: Dec 2003
Location: phnom penh
Distribution: Fedora
Posts: 1,625

Rep: Reputation: 165Reputation: 165
How are you submitting your mail?
 
Old 10-03-2006, 12:04 PM   #7
WindowBreaker
Member
 
Registered: Oct 2005
Distribution: Slackware
Posts: 228

Rep: Reputation: 31
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.
 
Old 10-04-2006, 10:02 AM   #8
taigon
LQ Newbie
 
Registered: Mar 2006
Posts: 28

Original Poster
Rep: Reputation: 15
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%
 
Old 01-09-2007, 04:43 PM   #9
codewrighter
LQ Newbie
 
Registered: Jan 2007
Posts: 5

Rep: Reputation: 0
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
 
Old 01-10-2007, 12:27 AM   #10
gani
Member
 
Registered: Jun 2004
Location: Metro Manila, Philippines
Distribution: OpenBSD, Slackware, XP
Posts: 347

Rep: Reputation: 31
Quote:
got my email it was from sender@localhost.localdomain I can't seem to fix this I would appreciate any and all help. Thanks
Although I'm not so sure if this could be your issue, I'm still suggesting for to check the following below to make sure that they are setup harmoniously. Here it is assumed that your domain is "example.com" and your host is "mail.example.com".

/etc/hosts:

Besides the default localhost, you should also have your host.

Code:
192.168.0.x       mail.example.com     mail
/etc/hostname or /etc/HOSTNAME:

Code:
mail.example.com
Make sure in you /etc/resolv.conf it has an entry -> "lookup file bind".

/etc/postfix/main.cf:

Code:
myhostname = mail.example.com
mydomain = example.com

myorigin = $mydomain

or 

myorigin = $myhostname
--------
GANI
 
Old 01-10-2007, 02:33 AM   #11
billymayday
Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Maybe this will help

http://www.linuxquestions.org/questi...d.php?t=512651
 
Old 01-10-2007, 02:43 AM   #12
billymayday
Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
using -f flag only changes the envelope, not the header btw

What distro are you using?

Last edited by billymayday; 01-10-2007 at 02:46 AM.
 
Old 01-11-2007, 09:27 AM   #13
codewrighter
LQ Newbie
 
Registered: Jan 2007
Posts: 5

Rep: Reputation: 0
Thanks for the suggestions I'll give them a try and let you know how it works out
 
Old 01-30-2007, 10:57 PM   #14
taigon
LQ Newbie
 
Registered: Mar 2006
Posts: 28

Original Poster
Rep: Reputation: 15
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
 
Old 02-01-2007, 06:38 PM   #15
billymayday
Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
what is the output of the hostname command?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
smtp 0x800ccc0f error sending mail to postfix Corsari Linux - Networking 4 09-22-2008 10:51 AM
Sending Email to an SMTP address from sendmail guilmetrp Linux - Newbie 6 03-01-2004 08:51 PM
Sending email to a smtp address through sendmail guilmetrp Linux - General 0 02-27-2004 08:02 PM
Postfix Help - Sending via third party smtp scarstens Linux - Networking 3 01-27-2004 05:55 PM
sending an email to a email address after a perl operation meluser Programming 9 04-07-2003 01:26 PM


All times are GMT -5. The time now is 12:41 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration