a799 [Solved] Postfix and hostname - The FreeBSD Forums
The FreeBSD Forums  

Go Back   The FreeBSD Forums > Server & Networking > Web & Network Services

Web & Network Services Discussion related to network/web services such as apache, bind, sendmail, etc.

Reply
 
Thread Tools Display Modes
  #1  
Old July 29th, 2009, 14:09
xy16644 xy16644 is offline
Member
 
Join Date: Jul 2009
Posts: 502
Thanks: 14
Thanked 7 Times in 3 Posts
Default Postfix and hostname

Currently I have a server called:

alpha.mydomain.com

but my MX record is:

mail.mydomain.com (reverse DNS is setup for this domain too)

When I send email it appears to come from alpha.mydomain.com in the message headers. I dont want to change the hostname of the server so how can I force Postfix to send all out going mail as coming from mail.mydomain.com?

I run the latest version of Postfix, Procmail and Spamassasin all on the same box running FreeBSD 7.2.

Does the hostname of the server have to match your MX record or can it be different? If you can change it then where? I cant seem to find it...
Reply With Quote
  #2  
Old July 29th, 2009, 15:22
dennylin93 dennylin93 is offline
Member
 
Join Date: Dec 2008
Posts: 784
Thanks: 34
Thanked 103 Times in 71 Posts
Default

Usually $myhostname is set as the output of $ hostname. What you want to change should be $myorigin in /usr/local/etc/postfix/main.cf. Another option is masquerading, but I believe it's usually used for mail gateways.

I have a mail server called mail.example.com, but I want the mail to appear from example.com:
Code:
$myhostname = mail.example.com
$mydomain = example.com
$myorigin = $mydomain
I'm using this configuration, but there's something weird with Mutt. It still sends mail that appears from mail.example.com. All other clients are OK though.

Take a look at Postfix Configuration Parameters and Postfix Address Rewriting.
Reply With Quote
The Following User Says Thank You to dennylin93 For This Useful Post:
xy16644 (July 29th, 2009)
  #3  
Old July 29th, 2009, 15:42
xy16644 xy16644 is offline
Member
 
Join Date: Jul 2009
Posts: 502
Thanks: 14
Thanked 7 Times in 3 Posts
Thumbs up

Changing:

Code:
myorigin = $mydomain
to

Code:
myorigin = mail.mydomain.com
didn't change anything for me. But changing:

Code:
myhostname = mail.mydomain.com
seemed to do the trick!

If I look in the message headers, the before snaphot looks like this:

Code:
Received: from alpha.mydomain.com ([xxx.xxx.xxx.xx]) by col0-mc4-f10.Col0.hotmail.com with Microsoft SMTPSVC(6.0.3790.3959);
after making the change:
Code:
Received: from mail.mydomain.com ([xxx.xxx.xxx.xx]) by col0-mc2-f27.Col0.hotmail.com with Microsoft SMTPSVC(6.0.3790.3959);
Thanks very much for your help!
Reply With Quote
Reply

Thread Tools
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Installation from FTP: cannot resolve hostname ftp... Erratus Installing & Upgrading 20 June 29th, 2010 18:25
Upgrading postfix 2.5.6 to 2.6 k1piee Installation and Maintenance of FreeBSD Ports or Packages 2 May 19th, 2009 21:43
Postfix Quota robertdrake Web & Network Services 3 May 2nd, 2009 06:14
[Solved] No entry for hostname (Apache) JasonB Web & Network Services 4 April 11th, 2009 14:01
postfix and mysql alex2323 Web & Network Services 1 March 24th, 2009 23:44


All times are GMT +1. The time now is 15:36.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
The mark FreeBSD is a registered trademark of The FreeBSD Foundation and is used by The FreeBSD Project with the permission of The FreeBSD Foundation.
Web protection and acceleration provided by CloudFlare
0