How to send emails within the OSX mail server, between local accounts?

Tim_Beck
Tim_Beck used Ask the Experts™
on
It does not work to send email within our company between local users. Our OSX Server 10.6 always uses the SMTP relay to send messages, even though they are send to an account that is also on the server.

In Mail settings on the OSX server:
Domain Name is set to: style-xp.com
Hostname is set to: server.stylexp.int

SMTP is activated and the options for the external smtp relay are set.

What can we do, to keep mails within the company if they are send to local accounts? It is much easier, due to large files we have to send from one to each other.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
nappy_dThere are a 1000 ways to skin the technology cat.

Commented:
I think you will need to create a virtual domain for internal use only.

By doing this you can then specify you os x server for smtp.

Author

Commented:
We have an internal domain which is called server.stylexp.int
This domain is used - as described above - for "Hostname"

Our external domain is named style-xp.com which is used for "Domain Name" under OSX server mail settings.


The OSX server itself should recognize when a mail comes from name1@style-xp.com and then not send it to the smtp relay. Instead the message should be passed to the receivers user account with the email address name2@style-xp.com.

I can provide screenshots to show, if the settings are correct.
nappy_dThere are a 1000 ways to skin the technology cat.

Commented:
I thin you might need alias names setup and an internal MX record for the stylexp.int domain.

Do you have those already created?
Why Diversity in Tech Matters

Kesha Williams, certified professional and software developer, explores the imbalance of diversity in the world of technology -- especially when it comes to hiring women. She showcases ways she's making a difference through the Colors of STEM program.

Author

Commented:
Thanks so far for the hint. I will try my best to do everything correctly.
Where do I have to add the MX record? Within the DNS settings in OSX Server? And what do I have to add?

As well what kind of alias do I have to add? style-xp.com to stylexp.int?
We use a dyndns to pick up our mail. So it is not possible to directly setup an MX from our mail.style-xp.com to the OSX Server...

Author

Commented:
Recent DNS setup...
img1.png

Author

Commented:
recent mail settings
img2.png

Author

Commented:
additional DNS settings
img3.png
nappy_dThere are a 1000 ways to skin the technology cat.
Commented:
The only image and settings that matter here is img1.png

You need to add an MX(Mail eXchange) record to the DNS for stylexp.int

This is what tells the server how to reach the SMTP server of stylexp.int

Do this in the section labelled Mail Exchangers.

Also do you have the users in OD(I assume you have OD) configured to the internal domain stylexp.int?

Author

Commented:
I feel I am in good hands here :)
already thought about that the fetchmail problem might have to do with the same thing.

Will add the domain stylexp.int to the mail exchangers box tomorrow. I am not in the office any more.
Thanks for the fast reactions though ... The things you are saying are totally making sence now.

Will let you know tomorrow...
nappy_dThere are a 1000 ways to skin the technology cat.

Commented:
Totally off topic(kind of). I would not recommend you use email an a file storage system.

It's great to communicate and send small files this way, but I would recommend that you setup file server shares for all data and then configure iChat for internam messaging.

By doing this, you have a better revision history of files that everyone can see collectively.

When you use email you don't get this functionality.

Author

Commented:
i guess your last post was meant for another topic...
nappy_dThere are a 1000 ways to skin the technology cat.

Commented:
no this one..I only mentioned this because of your original post..

Author

Commented:
I get what you are saying. We already set up iChat and folders with different group permissions. This works great. The email setup is an extra option to send files including description to the folks that are not in the office at the moment. Once they get back to the office, they can read the mail and look at screenshots or files.

I added the internal servername to the Mail-Exchangers. (just had to add "server" - the rest of the internal domain was added by the OSX server)

I still get errors from fetchmail:
Oct 19 10:30:47 server dovecot[63]: auth(default): od(tim): user Tim exists more than once
Oct 19 10:30:47 server deliver(tim)[1710]: Fatal: postmaster_address setting not given

And the email to a colleague is still beeing sent via the SMTP. It is not send within the OSX server.
nappy_dThere are a 1000 ways to skin the technology cat.

Commented:
Ok so now that you have your MX record, you need to set each user with two email addresses and your email server will also need to have a virtual email domain.

With out this, it will still try to go thru the internet and not internal.

Author

Commented:
OK before I start with this, I would like to let you know, that we had it running before with no extra virtual domain. Fetchmail send it to the correct accounts and internal mail was not sent through the internet. I just can't remember how the settings where.

But I will of course try your solution.
Where do I setup an extra virtual domain? via DNS?
Where do I add the extra email-adress? within the OD accounts?

Thanks for your help so far.
nappy_dThere are a 1000 ways to skin the technology cat.

Commented:
Nothing to do in dns once u have the mx record set.
The virtual domain is set the svr mgr app service mail.
The extra email address is set on the user acct in worgroup mgr.

I must say, I don't use fetchmail. Everything I say here is baded on the native supported features of the OS X server OS.

Author

Commented:
I added the virtual hosting ... as well I added the new email-addresses.
Nothing happend. The Errors keep staying the same:

Oct 19 10:30:47 server dovecot[63]: auth(default): od(tim): user Tim exists more than once
Oct 19 10:30:47 server deliver(tim)[1710]: Fatal: postmaster_address setting not given

I think I will reinstall the damn thing. I assume, that there are some hidden settings I cannot change anymore. Or some entries got deleted. I really don't know where the problem lies, I think I tried now everything.


Fetchmail is usually working without trouble. It doesn't do much more then picking up mail from an external mail server and delivering it to the local accounts. This is a pretty easy job, coz you tell fetchmail in the config file where to pick it up and which user account to deliver. And if there is trouble here, there must be something globally wrong.

The good thing on fetchmail (it's a normal pop3 connector) is, that you don't have a permanent connection between web-server and local mail server.
Positiv: It is harder for hackers to find your local mail-server.
Negativ: Real Push Mail is not possible

I will let you know. Once I setup the server again.
nappy_dThere are a 1000 ways to skin the technology cat.

Commented:
Then in fetchmail you need to config how to get to your OS X server message store.

Author

Commented:
Fetchmail is - as far as - i know pretty much easy to setup. There are only 2 important entries to do.

1. Server
poll "web mail server" proto pop3

---> "web mail server" is just an url. proto is the mail protocol how to pickup messages


2. Users
user "Tim.Beck" pass "secret" is "Tim" here

---> Tim.Beck and the password is used to login at the web mail server. The last "Tim" is used to deliver the message to the correct account at OSX server. Just have to add the necessary account in OD (open directory).


That's is basically it. The other things you can add to fetchmailrc is just for some extra configuration purposes, e.g. how many times to pick up mail, set logfiles, error messages, etc.


OSX Server is installing right now. Will let you know once it's done.
Commented:
OSX server is beeing reinstalled and everything works fine.
Mail, Adresses, Calendars, Online-Services ... they even work with iphone over dyndns... Fetchmail is also configured and running seamlessly.

I don't know what it was, but now everything is configured just normally. No extra Mail-Exchanger entry nor an extra virtual hosting. Mails that go from one employee to another stay within the company network and won't be send over the SMTP relay.

I got one more question left, which I don't know how to solve.
How can fetchmail be run on server restart?

As far as I found out: I would have to create a plist-file:
<key>Program</key>
<string>/usr/bin/fetchmail</string>
<key>ProgramArguments</key>
<key>RunAtLoad</key>
<true/>

BUT I got two questions:
1st: Where do I have to place the plist-file so that it gets loaded on server restart?
2nd: How do I tell the plist file to run fetchmail with User "fetchmail" I created just to run the fetchmail service? The fetchmailrc is also located in fetchmail home folder.

With this last setting we are all set for a great OSX experience.
Thanks for your help so far...
Commented:
Again I finally found the solution myself. I created a plist file that is now beeing launched as an LauchAgent.
Thanks for your time napppy_d

Author

Commented:
the solutions weren't hitting my problem, but they were very competent...

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial