cod3fr3ak
August 4th, 2004, 08:48
Okay. I've finally moved to consolidating all mail in my unix domain to one server. I have an OpenBSD 3.5 box, with the lastest vanilla postfix install (eventually, I'd like to move to LDAP and then use the LDAp aware version).
I have 20 Solaris boxes, and 5 OpenBSD (admin servers - DNS, NTP, log server, etc.) I don't have a problem getting mail out from my Solaris boxes to go to the postfix box, problem is an NT box (Notes) hosts our public email server. Eventually we want to move to a email based text pager alert system, so mail will have to go out from our public email server to the text pager address. The Notes box is allowing mail to be relayed from my postfix box. To complicate things even more the Notes server has a different domain suffix than my Sun boxes.
Basically I'd like my sun boxes to be able to send mail to a user with the address of name@aaa.bbb.ccc. The mail must go thru my postfix server with the name of mail.xxx.yyy.zzz.
I am confused.... :(
The Postfix box handles mail with the xxx.yyy.zzz address properly, but whats the best way to implement what I want to do here?
elmore
August 4th, 2004, 10:09
subdomains shouldn't matter to postfix. Make sure
mydomain = domain.com
Leave off any subdomain there then:
myorigin = $mydomain
which will force all mail to just have domain.com vs. hostname.domain.com
then just make sure that your mydestination = line has the appropriate subdomains or specify a virtual map, that's really just personal preference though.
I hope I;ve understood you right, if I haven't just let me know and I'll try again.
bmw
August 4th, 2004, 10:44
Hmm, I'm a bit confused too, but I assume you mean that all mail received by the Postfix box for "internal-to-your-net" recipients should be forwarded to the internal mailbox server "mail.yourdomain.com". OK: create transport entries like this:
yourdomain.com :[mail.yourdomain.com]
.yourdomain.com :[mail.yourdomain.com]
and do "postmap transport".
You probably want that internal address (eg: foo@mail.mydomain.com) to become foo@mydomain.com when mail is sent outbound. Just set masquerade_domains = mydomain.com in main.cf
cod3fr3ak
August 9th, 2004, 09:15
Okay I tried doing some of the things you guys mentioned and I think I did not state my intentions clear enough. Ok I have several unix servers on a separate subnet. They all can be resolved to the following address in DNS roc.box.com. We also have a bunch of NT clients and the infrastructure to support them. As far as mail goes we use win2k with Lotus notes. All user accounts including my own admin accounts are handled by the NT server - meaning I and the other admins get email from the notes server. so fo instance cod3fr3ak@jam.com. I'd like my post fix server, to be able to pass emails from my unix boxes to one of two locations:
1. to a user on the company email system a'la rudy@jam.com
note- the unix server domain is roc.box.com, so i doubt if the postfix would be able to traverse the domain properly.
2. to a textpager outside our domain as in duty.admin@airmessage.net
however the postfix box can not send mail out to the internet directly. so again it will need to use the notes server as a mail relay.
Currently whenever i try to send mail to my my internal email account, the postfix server attempts to resolv the dns name jam.com - to the external ip. I have defined jam.com as an internal address 192.168.blah.blah, but it keeps trying to relay thru the external address of 207.84.blah.blah.
I placed and entry in the /etc/host file and resolv.conf is set to: files bind, so i really do not know why it resolves to the external address vice the internal address.
Also - when i install postfix, is it necessary to leave sendmail active? Or is that binary mapped to postfix.
elmore
August 9th, 2004, 11:10
If you've run postfix_enable then sendmail has been removed in your mailer.conf and appropriate symlinks and sendmail wrapper programs for postfix have been installed.
For the rest of this problem you'll need to setup a transport map and just have all mail received on your postfix box forward to your Notes server. The notes server will have to handle either the next hop which is either local delivery or forwarding to your text pager service.
So in your main.cf you'd do the following:
transport_maps = hash:/etc/postfix/transport
Then in /etc/postfix/transport:
jam.com relay:[0.0.0.0]
where 0.0.0.0 is the ip address of your notes server, don't forget to run a postmap hash:transport to create you hashed database of the transport table, then a quick postfix reload and you should be off to the races.
Please note that postfix will have to be configured to accept mail for @jam.com and mail from remote servers should be sent to @jam.com for postfix to relay that mail to the notes server, if that's a problem then you could always create a caconical table which rerwrites the header example:
mail comes into your postfix server destined for user1@roc.box.com is rewritten to cod3fr3ak@jam.com once that's done it would hit the transport map and forward to the exchange server. Just make sure that your canonical table is called before you call the transport map in your main.cf as I believe postfix processes rules in order.
BMW could probably confirm that though.
for a canonical table do the following in your main.cf above the transport map:
canonical_maps = hash:/etc/postfix/canonical
Then in /etc/postfix/canonical
user1@roc.box.com user1@jam.com
That will rewrite your header and then send mail to the transport table you already defined, also remember to postmap the canonical table and reload postfix. There are probably better ways to handle this but off the top of my head that's how I'd do it. Also remember that since you have DNS issues you'll need to specify the relay in your transport map by ip and *NOT* by hostname. Hope that helps.
Additionally if all mail coming to this server will be forwarded to the notes server only, you could specify the following in your transport table and forget about the whole canonical thing:
* relay:[0.0.0.0]
Which I believe will just forward all mail received by this box to the ip address specified.
cod3fr3ak
August 9th, 2004, 11:24
Now that makes a lot more sense. thanks Elmore. I am working on it right now.
cod3fr3ak
August 9th, 2004, 11:41
Done! Just by running the postfix_enable script and rebooting fixed the issue. Now mailing to users on the notes server works just fine. Thanks a lot for your help.
elmore
August 9th, 2004, 11:47
No worries glad we could help!