Koozali.org: home of the SME Server

Forward to EXTERNAL server after clamav and spamassassin processes

Offline rshiras

  • *
  • 53
  • +0/-0
I have searched the FAQ on Email, and tried putting in an external server a.b.c.d just to see if it works anyway, but no joy.
# db domains setprop test.com MailServer a.b.c.d
# signal-event email-update

I want my SME 7.4 server to process e-mail through spamassassin and clamav and then forward it to an EXTERNAL exchange server.  I want to do this only with some of the domains.

I have done searches on the wiki and the forums, and I am chagrined to have to post this because I know the answer is there somewhere.  Lots of posts almost hit the mark.  I hope it gets spelled out here for this humble newbie....

Offline janet

  • *****
  • 4,812
  • +0/-0
Re: Forward to EXTERNAL server after clamav and spamassassin processes
« Reply #1 on: July 24, 2009, 12:44:50 PM »
rshiras

The email FAQ refers to delegation to INTERNAL mail servers
Just setup your external exchange server to receive mail directly

Alternatively just forward email on a per user basis
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline rshiras

  • *
  • 53
  • +0/-0
Re: Forward to EXTERNAL server after clamav and spamassassin processes
« Reply #2 on: July 24, 2009, 04:32:22 PM »
Mary,
As always your replies are inspirational.  You have really saved me on other occasions!  The reason I put EXTERNAL in caps is to emphasize the fact that I have read the FAQ and I do realize that the forwarding in the FAQ is about INTERNAL servers. 
Forwarding on a per user basis would not work in my case because of the multi-domain issue.  I am looking for the solution, not a work-around.  I am quite sure someone has figured out a way to forward a single domain to an external server, and I am quite sure they will see this post and be kind enough to provide the solution.

Offline janet

  • *****
  • 4,812
  • +0/-0
Re: Forward to EXTERNAL server after clamav and spamassassin processes
« Reply #3 on: July 25, 2009, 01:27:19 AM »
rshiras

sme by default does not allow relaying, which  appears to be what you want to do

I do not see why you cannot forward by user, that is quite valid. You can enter user@domain pseudonyms and these can then forward to unique usernames, who are then configured to deliver to an external address. The messages will have been filtered at that stage.

The other alternative is to have a sme gateway server at the other location where the exchange server is
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline rshiras

  • *
  • 53
  • +0/-0
Re: Forward to EXTERNAL server after clamav and spamassassin processes
« Reply #4 on: July 25, 2009, 01:45:24 AM »
OK well that is good information.  I was thinking of putting another SME server there anyway.

Online mmccarn

  • *
  • 2,653
  • +10/-0
Re: Forward to EXTERNAL server after clamav and spamassassin processes
« Reply #5 on: July 25, 2009, 03:46:58 PM »
I have configured a SME server as desired by rshiras in the past, as a spam and virus filter that then passes email to an "Internal" mail server that is off-site (although this was done either using SME 6.x or a very early SME 7.x).

rshiras:
  • are you certain that the problem is with the SME server?
  • What are you seeing in your log files?
    • /var/log/qpsmtpd/current should confirm that email for the specified domain is being received by your SME server
    • /var/log/qmail/current will tell you what happens when your SME tries to deliver the email to the "Internal" mail server
  • Did you configure the "MailServer" setting by IP address, or by DNS name?
    • If you used a DNS name, does it resolve correctly on the SME server?
  • Have you added the SME server as a "perimeter server" on your Exchange box (to make sure the Exchange box doesn't reject the traffic as spam)?

In the worst-case scenario, if everything is already configured correctly and your SME logs are indicating that email cannot be delivered to a non-local IP address, you should be able to solve this by adding the public IP of the Exchange Server as a "Local Network" with netmask 255.255.255.255 and with the same gateway your SME is already using (bearing in mind that this allows access to all of SME's "local" services from that IP address), but this should not be necessary.

Offline Knuddi

  • *
  • 540
  • +0/-0
    • http://www.scanmailx.com
Re: Forward to EXTERNAL server after clamav and spamassassin processes
« Reply #6 on: July 26, 2009, 11:23:29 PM »
I think your "problem" is solved by changing smptroutes (/var/qmail/control/smtproutes) to forward mail for a certain domain to a new and external server.

You would obviously need to create/modify a template but I have done it this way.

Rgds,
Jesper