Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Chaning hostname in postfix?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Negated Void
l33t
l33t


Joined: 25 Dec 2002
Posts: 672

PostPosted: Sat Apr 12, 2003 2:13 pm    Post subject: Chaning hostname in postfix? Reply with quote

Hello!

I set up postfix and mutt, but i want my e-mail to come from mail.somedomain.tld, instead of my hostname. mail.somedomain.tld points right at my computer, so it should be fine. I set both myhostname and mydomain to mail.somedomain.tld in my main.cf file, but it still is using my hostname.

any clues?
thanks!
-Matt
Back to top
View user's profile Send private message
punx
n00b
n00b


Joined: 08 Jan 2003
Posts: 33
Location: Cologne_de

PostPosted: Mon Apr 14, 2003 10:42 am    Post subject: Reply with quote

Hi,
maybe postfix' sender canonical option is right for you:
You have to set up a file called "sender_canonical", and put it under /etc/postfix with the following syntax:
Code:

username  you@whatyouwant.com

After that you have to run
Code:

#postmap /path/to/sender_canonical

to build sender_canonical.db
Then restart postfix with
Code:

#postfix reload


Now Postfix will rewrite every mail from username to you@whatyouwynt.com.
_________________
...oh god i am the american dream but now i smell like gasoline and i am the miserable son of a bush..
Back to top
View user's profile Send private message
rajl
Apprentice
Apprentice


Joined: 25 Sep 2002
Posts: 287

PostPosted: Mon Apr 14, 2003 4:36 pm    Post subject: Reply with quote

I followed you instructions on the sender_canonical file, and while it looks like it is exactly what I want, when I followed your instructions, nothing happened. Are there any other files I would have to modify, perhaps a setting in main or master.cf, or perhaps have to have a third cf file based off one of the sample cf files?
_________________
-Rajl

-----------------------------------------------------------
It's easy to be brave once you consider the alternatives.
Back to top
View user's profile Send private message
punx
n00b
n00b


Joined: 08 Jan 2003
Posts: 33
Location: Cologne_de

PostPosted: Mon Apr 14, 2003 6:26 pm    Post subject: Reply with quote

Hi,
:oops:
Of Course that will not work - you also have to edit your main.cf and put the following in there:
Code:

sender_canonical_maps = hash:/etc/postfix/sender_canonical

After that reload Postfix again. I think it should work.
Ciao
_________________
...oh god i am the american dream but now i smell like gasoline and i am the miserable son of a bush..
Back to top
View user's profile Send private message
rajl
Apprentice
Apprentice


Joined: 25 Sep 2002
Posts: 287

PostPosted: Mon Apr 14, 2003 7:25 pm    Post subject: Reply with quote

i typed that in and it didn't work. are you sure that's the right command? any other ideas of how I can get the from field from the emails sent from my server to read user@my.custom.domain.org rather than user@ugly.hostname.from.my.isp?
_________________
-Rajl

-----------------------------------------------------------
It's easy to be brave once you consider the alternatives.
Back to top
View user's profile Send private message
punx
n00b
n00b


Joined: 08 Jan 2003
Posts: 33
Location: Cologne_de

PostPosted: Mon Apr 14, 2003 9:13 pm    Post subject: Reply with quote

Hm, on my mashines it works like that.
Doublecheck everything, and don't forget to reload Postfix.
Have a look at the maillog file.

This link's explains everything in detail:
http://www.postfix.org/rewrite.html#canonical
http://www.postfix.org/canonical.5.html

Hope it will work !
Ciao
_________________
...oh god i am the american dream but now i smell like gasoline and i am the miserable son of a bush..
Back to top
View user's profile Send private message
s1th
n00b
n00b


Joined: 30 Mar 2003
Posts: 31
Location: Almere, Netherlands

PostPosted: Wed Apr 16, 2003 6:41 pm    Post subject: Re: Chaning hostname in postfix? Reply with quote

Negated Void wrote:
Hello!

I set up postfix and mutt, but i want my e-mail to come from mail.somedomain.tld, instead of my hostname. mail.somedomain.tld points right at my computer, so it should be fine. I set both myhostname and mydomain to mail.somedomain.tld in my main.cf file, but it still is using my hostname.


Have you set the option: set use_domain and/or set hostname="somedomain.tld" in your .muttrc file?
Another possibility is to use the masquerade option in Postfix.
See /dir/of/postfix/install/sample/sample-rewrite.cf for the masquerade_domains variable (usually /etc/postfix/sample/sample-rewrite.cf has the info).

HTH
_________________
Why did it happen ? BOFH Excuse:
Zombie processes haunting the computer
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum