Page 5 of 5 FirstFirst ... 345
Results 81 to 88 of 88

Thread: Exim sending messages with ip assigned to other users

  1. #81
    Join Date
    Nov 2012
    Posts
    90
    Thank you Alex for getting us so close to a request/suggestion/solution that's nearly 4 years in the making! Awesome.

    So I guess the last piece of the puzzle is to automate the updating of the exim.conf file and the reloading/restarting of exim.conf

    I don't know how to do this but I'm guessing it'd be done with perl or python. We might find the line # in the file that begins with local_interfaces = 127.0.0.1 and then rewrite it including the list of all available IP's on the machine.

    ###START ADDED###
    disable_ipv6
    local_interfaces = 127.0.0.1 : 211.82.195.29 : 211.82.195.118 : 211.82.195.119 : 211.82.195.120
    smtp_active_hostname = ${lookup{$interface_address}lsearch{/etc/virtual/smtp_active_hostnames}{$value}}
    smtp_banner = "$smtp_active_hostname ESMTP $tod_full"
    ###END ADDED###

    Thoughts?

    And Alex, please PM me with your paypal so that I can send you a small donation if you are interested. I really appreciate your efforts.

    John

  2. #82
    Join Date
    Oct 2004
    Location
    London, UK
    Posts
    6,764
    Code:
    sed -i 'smtp_banner = /d' /etc/exim.conf
    sed -i 'smtp_active_hostname = /d' /etc/exim.conf
    sed -i 'local_interfaces = /d' /etc/exim.conf
    sed -i 'disable_ipv6/d' /etc/exim.conf
    echo -e 'smtp_banner = "$smtp_active_hostname ESMTP $tod_full"\n'"$(cat /etc/exim.conf)"'' > /etc/exim.conf
    echo -e 'smtp_active_hostname = ${lookup{$interface_address}lsearch{/etc/virtual/smtp_active_hostnames}{$value}}"\n'"$(cat /etc/exim.conf)"'' > /etc/exim.conf
    echo -e 'local_interfaces = 127.0.0.1 : 211.82.195.29 : 211.82.195.118 : 211.82.195.119 : 211.82.195.120"\n'"$(cat /etc/exim.conf)"'' > /etc/exim.conf
    echo -e 'disable_ipv6"\n'"$(cat /etc/exim.conf)"'' > /etc/exim.conf
    This will add the lines at the top of the file (deleting them if already exist, so, will create them everytime those new lines)

    For the IP list you can add those lines to last Alex's script and use the $IP variable.

    I have no time now for integrate them, but i suppose that on eache discovered IP ti must be added in a new variable,

    ex:
    IPSPACED="$IP : "
    IPS="$IPS$IPSPACED"

    so the first time will be empty and get filled every new IP, and use $IPS in local_interface.

    examples

    local_interfaces = $IPS
    or
    local_interfaces = 127.0.0.1 : $IPS (if 127.0.0.1 is not discovered by Alex's script)

    Regards
    SeLLeRoNe - Andrea Iannucci
    Head of Managed Service - Senior DevOps Engineer
    If you need my support write me an E-Mail to Support@CrazyNetwork.it

  3. #83
    Join Date
    Nov 2012
    Posts
    90
    Ha... I tried the above and failed MISERABLY! Anyone available to put this together? This would put a bow on the whole thing. Then who knows, maybe it could be added into a CustomBuild at some future time.

    Big THANK YOU's to everyone who has contributed.

  4. #84
    Join Date
    Jun 2003
    Location
    California
    Posts
    26,122
    @jkirker:

    Feel free to call me to discuss specifics.

    Jeff
    +1 951 643-5345
    Third-Party DirectAdmin administration and support
    Dedicated Servers, Dedicated Reseller Accounts
    NoBaloney Internet Services div. Qnito Incorporated
    848 North Rainbow Blvd., Suite #3789
    Las Vegas, NV 89107-1103

  5. #85
    Join Date
    Apr 2005
    Location
    GMT +7.00
    Posts
    12,569
    Quote Originally Posted by jkirker View Post
    Thank you Alex for getting us so close to a request/suggestion/solution that's nearly 4 years in the making! Awesome.

    So I guess the last piece of the puzzle is to automate the updating of the exim.conf file and the reloading/restarting of exim.conf

    John
    Hello John,

    Please let me a couple of days, and I'll suggest my sollution for it.

  6. #86
    Join Date
    Oct 2003
    Location
    Switzerland
    Posts
    2,099
    A couple of suggestions
    • Naming: It might be worth using something generic for files. We use domainips and reverse_domainips, but anything which describes the content rather than the use might be more useful in the long run
    • IPV6: Make the scripts IPv6 compatible or you'll end up with broken IP databases
    • Deprecated variables: $interface_address has been replaced by $received_ip_address when receiving emails in order to avoid confusion. DOC
    • iplsearch: Exim comes with various lookup tools. One of them is iplsearch which is designed specifically for IPs, including masks. DOC
    • Defaults: By reading the Exim condition which determines the active hostname, it seems to me like there is no default value to use as a fallback, which means that Exim will fail to receive emails if it can't determine the hostname to use. I could be wrong though



    Examples:
    Receiving
    Code:
    smtp_active_hostname = ${lookup{$received_ip_address}iplsearch{/etc/virtual/domainips}{$value}{$primary_hostname}}
    Sending
    Code:
    interface = <; ${lookup{$sender_address_domain}lsearch{/etc/virtual/domainips_reverse} {$value}{$interface_address}}
    helo_data can use the same code used for smtp_active_hostname, without having to create additional symlinks

    Also, it's possible to avoid having to create any files if using DNS lookups, but that slows down processing.
    Olivier
    interfaCentre - We design custom hosting solutions

    Custom apps, scripts and configurations for easy and secure access to all hosting services
    Full Personal Information Management suite with mobile synchronisation
    PHP, Ruby, Node.js and Python hosting with 1-click app install

  7. #87
    Join Date
    Jan 2007
    Posts
    41
    Quote Originally Posted by interfasys View Post
    A couple of suggestions
    • Deprecated variables: $interface_address has been replaced by $received_ip_address when receiving emails in order to avoid confusion. DOC


    Sending
    Code:
    interface = <; ${lookup{$sender_address_domain}lsearch{/etc/virtual/domainips_reverse} {$value}{$interface_address}}
    helo_data can use the same code used for smtp_active_hostname, without having to create additional symlinks

    Also, it's possible to avoid having to create any files if using DNS lookups, but that slows down processing.
    If $interface_address is deprecated, then shouldn't the above example be this:

    Code:
    interface = <; ${lookup{$sender_address_domain}lsearch{/etc/virtual/domainips_reverse} {$value}{$received_ip_address}}

  8. #88
    Join Date
    Jan 2007
    Posts
    41
    Quote Originally Posted by SeLLeRoNe View Post
    Code:
    echo -e 'local_interfaces = 127.0.0.1 : 211.82.195.29 : 211.82.195.118 : 211.82.195.119 : 211.82.195.120"\n'"$(cat /etc/exim.conf)"'' > /etc/exim.conf
    That puts quotation marks at the end of the IP list", which invalidates the format. Should be:


    Code:
    echo -e 'local_interfaces = 127.0.0.1 : 211.82.195.29 : 211.82.195.118 : 211.82.195.119 : 211.82.195.120\n'"$(cat /etc/exim.conf)"'' > /etc/exim.conf

Page 5 of 5 FirstFirst ... 345

Similar Threads

  1. Allow Share Server Assigned Ip's for Reseller's and Users
    By wanener in forum Feedback & Feature Requests
    Replies: 7
    Last Post: 04-18-2012, 01:19 AM
  2. HELP! Server sending out many outbound email messages
    By blitzer in forum General Technical Discussion & Troubleshooting
    Replies: 8
    Last Post: 04-23-2010, 01:06 PM
  3. 550 Blocked for sending broken messages
    By owindrich in forum E-Mail
    Replies: 2
    Last Post: 12-21-2007, 02:20 AM
  4. How do you modify the messages sent to new users
    By flawlesshosting in forum General Technical Discussion & Troubleshooting
    Replies: 2
    Last Post: 08-24-2004, 09:54 PM
  5. Email Users and Vacation messages
    By netmotiv8 in forum Scripting / API
    Replies: 12
    Last Post: 07-26-2004, 07:38 AM

Tags for this Thread

Posting Permissions

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