Mail relay "store and forward" configuration, reccomended solution?

Discussion in 'Tips/Tricks/Mods' started by woleium, Jan 26, 2007.

  1. woleium

    woleium New Member

    Hi again. Firstly, thanks for being so helpful with my last problem. Once again I have read every post that relates to this and can't find a straight answer :(

    We have finally migrated all of our sites to ISPConfig now, yay!

    One of our customers wants to configure his mx records as so:
    Code:
        MX   10   [ISPCONFIG]
        MX   20   [IP OF ONSITE ADSL LINK]
    Then configure ispconfig to (viruscheck &) relay all mail to the [IP OF ONSITE ADSL LINK]

    What would the best way to do this be? I have read about procmail recipies, postfix relay configs, and things related to ISPConfig settings.

    The more I read, the more I get confused, so any pointers would be hugely appreciated.

    W.
     
  2. falko

    falko Super Moderator Howtoforge Staff

    I'd leave out the
    Code:
    MX   20   [IP OF ONSITE ADSL LINK]
    part, then configure amavisd for virus and spam scanning on the ISPConfig server and use Postfix transports to deliver the mails to the second server.
     
  3. woleium

    woleium New Member

    Cool, thanks again Falko.

    For the benefit of others & for clarification, you are suggesting adding the following to

    /etc/postfix/transport

    Code:
    	example1.com              [IP OF ONSITE ADSL LINK]
    
    source
     
    Last edited: Jan 29, 2007
  4. falko

    falko Super Moderator Howtoforge Staff

    Yes, right. :)
     
  5. woleium

    woleium New Member

    Full Instructions

    possibly add these to the faq?

    1. From inside ISPConfig make sure that email is configured to external mailserver for the domain, and also any subdomains (subdomains tab -> other)

    2. from shell:
    Code:
    echo "relay_domains = /etc/postfix/relay" >> /etc/postfix/main.cf
    echo "[DOMAIN NAME HERE]" >> /etc/postfix/relay
    echo "[DOMAIN NAME HERE] smtp:[IP ADDRESS TO FORWARD TO] >> /etc/postfix/transport
    postmap /etc/postfix/transport
    postfix reload
    
    to add additional domains:

    Code:
    echo "[DOMAIN NAME HERE]" >> /etc/postfix/relay
    echo "[DOMAIN NAME HERE] smtp:[IP ADDRESS TO FORWARD TO] >> /etc/postfix/transport
    postmap /etc/postfix/transport
    postfix reload
    
    Hope this helps someone, it took me a couple of days to figure it out.
     
    Last edited: Feb 5, 2007
  6. Madlew2007

    Madlew2007 New Member

    Just what i needed ty :)
     
    Last edited: Feb 20, 2007
  7. Madlew2007

    Madlew2007 New Member

    I have this setup and postfix relays the emails fine to my exchange server but the mails dont seem to be getting scanned through spamassassin.

    Do i need to teach spamassassin? e.g setup a local mailbox and fill with spam/ham?

    The domain is flagged for av and spam scanning in ISPConfig.

    What can I check?
     
  8. martinfst

    martinfst Member Moderator

    mailscanning in ISPConfig is done with procmail, which is called as the last step in Postfix. Your relaying is done before procmail is called, thus ISPConfig can never scan the emails on the primary MTA. You would need a totally different Postfix setup if you want to scan the mails before relaying. Which would break ISPConfig.
     
  9. Madlew2007

    Madlew2007 New Member

    Ok, thank you for your reply.

    I think im gonna try setting up Virtual Users And Domains With Postfix, Courier And MySQL (+ SMTP-AUTH, Quota, SpamAssassin, ClamAV) as I have read the scanning/relaying threads which point to this.

    Hope this does what I need.
     
  10. DiOmega

    DiOmega New Member

    Is there any possibility to relay mail after scanning (e.g. with procmail recipes)?
     
  11. falko

    falko Super Moderator Howtoforge Staff

Share This Page