SMTP Relay for external domains for spam and av filtering

I’ve found multiple threads on the relaying of smtp with only spam and av filtering for delivering to another mail server… for example: external Exchange server.

I’m not finding anything that looks current. Can anyone maybe point me in the right direction?

I’ve found the following:

There is also multiple other virtual servers hosted on the same Virtualmin server which does have email being delivered local also.

Anyone have any ideas or can I implement the solution at the url above?


maybe you need to clarify exactly what you are trying to do.

are you, for example, trying to get an external relay to do some antivirus and spam filter? and than simply queue or deliver immeately to the back end? and than get picked up?

one issue you might have is that fact that, while you can scan these messages… users will not have individual control over their filters and preferences. these are stored on the back end.

if this doesnt matter, or if you are willing to implement this on your own, than what i have described should be fairly simple.

since you did not define what mail server you are using, I’ll will draw my example with sendmail.

when setting up sendmail, or by reconfiguring sendmail… you can have it run as a sort of smart host, or general relay. as you expect, you will just take in mail, and blast it off to your backend server.

however, in order to scan these files, you will need to implement a procmail script much like virtualmin does.

there are two different variables, for example, when configuring procmail and sendmail. virtualmin uses procmail for local delivery… but you CAN use it to process all messages incoming.

simply write a small procmail script to pass this to spamassassin, and clamAV. evaluate the return codes like how the back end does it. and decide what to do with the mail. either you can drop it (if the spam score exceeds the upper limit), or just ship it off to the back end with the spam score attached within its headers… and let the back end decide what to do with it.

so, as you might expect, you just basically do everything you normally would… but instead you are using a “global” procmail script, and relaying all mail to your back end.

as for an up to date tutorial or ebook… you might find this. you might not. i found that learning a bit about the sendmail configuration got me on my way pretty quickly. moreover, virtualmin abstracts alot of this, making it easier.

reardless, i fear i have misinterpreted your question. if so, try to clarify for me what it is you are trying to do.

furthermore, if you need a hand with this, feel free to ask. we can talk over email, or in these forums.

  • steven