View previous topic :: View next topic |
Author |
Message |
Negated Void l33t
Joined: 25 Dec 2002 Posts: 672
|
Posted: Sat Apr 12, 2003 2:13 pm Post subject: Chaning hostname in postfix? |
|
|
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 |
|
|
punx n00b
Joined: 08 Jan 2003 Posts: 33 Location: Cologne_de
|
Posted: Mon Apr 14, 2003 10:42 am Post subject: |
|
|
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
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 |
|
|
rajl Apprentice
Joined: 25 Sep 2002 Posts: 287
|
Posted: Mon Apr 14, 2003 4:36 pm Post subject: |
|
|
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 |
|
|
punx n00b
Joined: 08 Jan 2003 Posts: 33 Location: Cologne_de
|
Posted: Mon Apr 14, 2003 6:26 pm Post subject: |
|
|
Hi,
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 |
|
|
rajl Apprentice
Joined: 25 Sep 2002 Posts: 287
|
Posted: Mon Apr 14, 2003 7:25 pm Post subject: |
|
|
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 |
|
|
punx n00b
Joined: 08 Jan 2003 Posts: 33 Location: Cologne_de
|
Posted: Mon Apr 14, 2003 9:13 pm Post subject: |
|
|
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 |
|
|
s1th n00b
Joined: 30 Mar 2003 Posts: 31 Location: Almere, Netherlands
|
Posted: Wed Apr 16, 2003 6:41 pm Post subject: Re: Chaning hostname in postfix? |
|
|
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 |
|
|
|