Results 1 to 9 of 9

Thread: [SOLVED] Amavisd relaying back to my ISP

  1. #1
    Join Date
    Oct 2006
    Posts
    3
    Rep Power
    9

    Default [SOLVED] Amavisd relaying back to my ISP

    Hi,

    I've configured my Zimbra system in this way:

    - All local addresses are rewriten from user@local.domain to userintheisp@isp.com with a smtp_generic_maps option in main.cf
    - The mail is fetched from the ISP with fetchmail:

    Code:
    poll pop3.isp.com user userintheisp@isp.com with password pass is user@local.domain
    Everything works as expected: users can send mail as user@local.domain and receive mail as userintheisp@isp.com. Local mail between user1@local.domain and user2@local.domain works well.

    The problem starts when the AS/AV option is started:

    - Local users can send mails
    - Local users don't receive mails fetched from fetchmail because amavisd gets the MX record of the rewrited address (userintheisp@isp.com) as the relay.

    How can I tell amavis to not relay some addresses and deliver locally? Is it possible to rewrite the recipient address before scanning/antispamming?

    Thanks!

  2. #2
    Join Date
    Aug 2005
    Location
    San Mateo, CA
    Posts
    4,789
    Rep Power
    19

    Default

    Why don't you have fetchmail deliver direct to Zimbra via LMTP and skip the AV/AS filtering?
    Looking for new beta users -> Co-Founder of Acompli. Previously worked at Zimbra (and Yahoo! & VMware) since 2005.

  3. #3
    Join Date
    Oct 2006
    Posts
    3
    Rep Power
    9

    Default

    Because I don't want to skip the AV/AS filter... I think that this is not a very unusual configuration (small office without a real domain) but I've been unable to find a solution.

  4. #4
    Join Date
    Oct 2006
    Posts
    3
    Rep Power
    9

    Default

    Ok,

    Solved. I've put a pre-cleanup service in main.cf as described in http://www.ijs.si/software/amavisd/README.postfix.txt

    Now we can send and receive mail with AV/AS. Nice.

    Thanks!

  5. #5
    Join Date
    Dec 2006
    Posts
    11
    Rep Power
    8

    Default

    Quote Originally Posted by atei View Post
    Because I don't want to skip the AV/AS filter... I think that this is not a very unusual configuration (small office without a real domain) but I've been unable to find a solution.
    why would you not get a domain or subdomain if you are going through the effort and cost of installing a mail server.

  6. #6
    Join Date
    Oct 2006
    Posts
    19
    Rep Power
    9

    Default

    Hi atei,

    I'm having the same problem but can't get the pre-cleanup service working.

    Do you mind posting the necessary configuration for everybody's benefit?

    Thanks!

    Floyd: Just a note on why people may want to do it this way. We are using an internal domain because we are slowly migrating from an existing POP service (the MX of our external domain points to our ISP), so for the moment we are using fetchmail to get external mail into Zimbra. Our internet connection is via a masqueraded ADSL router with non-static IP (and is also rather unreliable), making our internal mail server inappropriate for use as a primary MX for the outside world. We may look into getting an externally hosted server as a backup MX in the future, but its not feasible at this point.

  7. #7
    Join Date
    Oct 2006
    Posts
    19
    Rep Power
    9

    Default

    It turns out all this pre-cleanup business was a red-herring.

    I managed to fix this issue by adding "smtp_generic_maps=" to the amavis service options in master.cf:

    smtp-amavis unix - - n - 10 smtp
    -o smtp_data_done_timeout=1200
    -o smtp_send_xforward_command=yes
    -o disable_dns_lookups=yes
    -o max_use=20
    -o smtp_generic_maps=

    This stops the outgoing generic map from being applied when the mail gets reinjected into postfix. This is probably only useful for people using smtp_generic_maps to rewrite their domain for outgoing email.

    I've wasted many an hour on this... hopefully this helps someone.

    -R

  8. #8
    Join Date
    Feb 2008
    Location
    Hanoi
    Posts
    42
    Rep Power
    7

    Default

    This is so great for me! riccadus, thank you so much!
    I will also use this to help other people. Viva Zimbra and FOSS communities.

    Tuan

  9. #9
    Join Date
    Oct 2010
    Posts
    1
    Rep Power
    5

    Default

    Thanks for pointing out amavis as the culprit! That saved me hours!
    Actually, the master.cf parameter is overwritten when the MTA is restarted, thus being ineffective.
    But in my personal case, we use our ISP's mailbox, which are already scanned for spams and virus, so I ended up deactivating these services.

    I'm more than eager to read the final solution, but anyway, thanks a lot!

Similar Threads

  1. loops back to myself
    By cubitus91 in forum Installation
    Replies: 16
    Last Post: 05-12-2008, 01:49 PM
  2. sending mail using your ISP as relay host
    By mikelurk in forum Installation
    Replies: 8
    Last Post: 09-06-2007, 06:36 AM
  3. Building SVN for CentOS 4.4 (mysql)
    By GrepACE in forum Developers
    Replies: 3
    Last Post: 12-29-2006, 10:54 PM
  4. Getting smtp working with my ISP
    By Cpoc in forum Installation
    Replies: 16
    Last Post: 12-16-2005, 12:32 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •