Page 1 of 1
External Mail Server
Posted: Tue Aug 15, 2006 5:46 pm
by SeanMatula
For security reasons, I do not want to point an MX record at our corporate network. I would, however, like to run Scalix server on an internal network machine (our web host is Windows, or I’d install Scalix there).
So my question is this: can Scalix server be setup so that it fetches all incoming mail from an external mail server and forwards all outgoing mail to that same server?
Basically, I want our mail-host to do all the security-risky stuff … an just have scalix come in and grab everything after it has passed the mail-server’s antivirus and junk filters.
Posted: Thu Aug 17, 2006 11:12 pm
by SeanMatula
I take it from the lack of replies that this isn't possible
Posted: Fri Aug 18, 2006 3:17 am
by Valerion
What you need to do is set up a relay server, and have the MX records point to that machine. Tell that machine to send all mail destined for your domain onwards to the Scalix server, or have the server spool for you and use fetchmail to issue an ETRN to pull the mail off.
On the Scalix server put the hostname of the machine (DNS name) in sendmail.cf in the DS parameter (eg. DSrelay.domain.com) and you should be set.
Posted: Fri Sep 08, 2006 8:35 am
by KKJensen
Has anyone figured this out so it works? I'm pretty new to scalix and haven't used linux much since redhat 6 but I've managed to get everything going except this fetchmail thing.
Basically we have an external mail server that is TERRIBLE at junkmail and we're going to dump the service soon, but in the meantime we want to get scalix deployed to everyone.
Could someone help me with a few, finer detailed steps on setting up the fetchmail to an external server?
I've read that each user will have to reveal their password to get this to work...there's no functionality within scalix to use their current password (assuming it's the same one as the external server?)
Posted: Fri Sep 08, 2006 9:47 am
by Valerion
Assuming your upstream server uses POP3, you can put the following in the crontab
Code: Select all
*/15 * * * * /usr/bin/fetchmail -f /etc/fetchmailrc >/dev/null 2>&1
Then in your /etc/fetchmailrc you put somehing like the following for each user you want to pull off (I put everything on one line):
Code: Select all
poll pop.isp.com with protocol pop3 username user@isp.com
with password mypassword is user@scalix.server.com here fetchall
Since fetchmail has no way to retrieve the Scalix password in a clear-text format, it can't use that for authentication, unfortunatedly.
Posted: Fri Sep 08, 2006 10:02 am
by KKJensen
Thanks for the info.
I recall the second of the two commands after reading up on fetchmail on
http://linux.cudeso.be/linuxdoc/fetchmail.php but what does the first command do?
I'm still remembering and learning linux so I'm afraid I don't know what the crontab is...
thanks again for the help.
Posted: Fri Sep 08, 2006 10:09 am
by Valerion
You edit it with
as root. It schedules certain commands to be run at certain intervals.
I would suggest you take a look at
http://www.tldp.org/ - specifically
http://www.tldp.org/LDP/lame/LAME/linux ... index.html
cron is discussed in chapter 9.4.
Posted: Fri Sep 08, 2006 1:45 pm
by KKJensen
Found it and modified it.
">/dev/nul" nuls the output so it can run without a terminal window
What does the "2>&1" do?
Posted: Fri Sep 08, 2006 2:00 pm
by ScalixSupport
"2>&1" means "redirect standard error (2) to the same place as standard outputt (1.)
Regards,
Don
Posted: Fri Sep 08, 2006 2:19 pm
by KKJensen
I'm having an issue with the crontab entry.
I open the /etc/crontab file and add the following line exactly at the end
*/5 * * * * /usr/bin/fetchmail -f /etc/.fetchmailrc >/dev/null 2>&1
I then save and close the file and logoff. Waiting 10-15 doesn't produce anything. Check the external pop3 servers webmail I see I have mail. Going back to a terminal window (loggin in as root) I run:
"/usr/bin/fetchmail -f /etc/.fetchmailrc" which proceeds to download the mail successfullly.
What am I missing so this happens on it's own. I've read everything I can and it doesn't seem like it's doing anything at all, yet along every 5 min.
Posted: Fri Sep 08, 2006 2:23 pm
by ScalixSupport
Try restarting you crond daemon.
/etc/init.d/crond restart
Regards,
Don
Posted: Fri Sep 08, 2006 2:39 pm
by KKJensen
So I restarted it and waited...and waited.
I changed the line to read:
*/5 * * * * /usr/bin/fetchmail -f /etc/.fetchmailrc >/usr/scalix.lot
Again, running the whole part after the crontab asterixes does what it is supposed to and generates a log file. Leaving it in the /etc/crontab file does nothing.
Is there another way to check and see if crontab is running properly??? Does it matter if I'm logged in or not? I'm currently logged in as root and I've done all the setup logged in as such.
Posted: Fri Sep 08, 2006 4:02 pm
by KKJensen
okay...figured it out...not really, but it works.
Typing the crontab -e and Vi'ing (yeck!) my way though adding the line and saving seems to work.
So I guess the crontab file in the /etc/ directory isn't the right one...I guess.
Posted: Fri Sep 08, 2006 8:11 pm
by ScalixSupport
Good job. Yes, crontab -e is the way to go. If your running linux get used to vi.
The /etc/crontab file is used to run scripts that are in
/etc/cron.daily
/etc/cron.hourly
/etc/cron.monthly
/etc/cron.weekly
By default cron jobs sends a email to the user account executing the cronjob. If this is not needed put the following command At the end of the cron job line.
>/dev/null 2>&1
Regards,
Don