"Fossies" - the Fresh Open Source Software Archive

Member "msmtp-1.8.4/scripts/set_sendmail/set_sendmail.conf" (11 Jun 2018, 2556 Bytes) of package /linux/privat/msmtp-1.8.4.tar.xz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Generic config files source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 # Default setting used if the domain name can not be found, or if something goes
    2 # wrong.
    3 #default='/usr/sbin/sendmail -oem -oi'
    4 
    5 # Make matching case insensitive
    6 shopt -s nocasematch
    7 
    8 # Regexp matching the host name of the machine this script should run on. (Other
    9 # machines get the default above).
   10 run_hosts='^baradur|mordor$'
   11 
   12 # The file /etc/resolv.conf is egrepped against patterns in the array
   13 # "resolv_regexp" (A leading "!" denotes negation of match). If a match is found
   14 # the corresponding msmtp account (from the accounts array) is used.
   15 #
   16 # If no match is found, then this script gets the domain name. This could be
   17 # time consuming if it is not found in /etc/resolv.conf, as it involves a name
   18 # server lookup. The domain name is then matched against the (bash) regexp's in
   19 # the array "dom_regexp". If a match is found, the corresponding msmtp account
   20 # (from the accounts array) is used. 
   21 #
   22 # Patterns are matched in the order they are defined. If no pattern matches,
   23 # then the script produces no output.
   24 #
   25 # An account named "ssh" is special. It calls the function ssh_tunnel when such
   26 # an account is selected.
   27 #
   28 # The following are the settings I use on my laptop.
   29 
   30 
   31 # Use default account if we could not get the domain name.
   32 accounts+=(default)
   33 dom_regexp+=('^$')
   34 resolv_regexp+=('!nameserver')
   35 
   36 # Use account 'stanford' from within the Stanford.EDU domain.
   37 accounts+=(stanford)
   38 #dom_regexp+=('^(Stanford\.EDU|gi1242.net)$')
   39 dom_regexp+=('^Stanford\.EDU$')
   40 resolv_regexp+=('^(nameserver[[:space:]]+171\.64\.7\.|search.*[[:space:]]stanford.edu)')
   41 
   42 # ri.cox.net seems to have firewalled port 25, so use ssh tunnelling in this
   43 # domain. (The function ssh_tunnel (called automatically) sets up the tunnel)
   44 accounts+=(ssh)
   45 dom_regexp+=('(^|\.)(ri\.cox\.net|near.uiuc.edu)$')
   46 resolv_regexp+=('')
   47 
   48 # From outside the Stanford.EDU domain, use account 'roam' with Kerberos
   49 # authentication. It involves typing my password once a day (when my kerberos
   50 # tickets expire), but is faster than ssh tunneling. (This requires traffic
   51 # through port 25 to not be firewalled)
   52 accounts+=(roam)
   53 dom_regexp+=('.')
   54 resolv_regexp+=('')
   55 
   56 # Ignore case while matching.
   57 shopt -s nocasematch
   58 
   59 # Function called when account named "ssh" is used
   60 function ssh_tunnel()
   61 {
   62     debug "Starting SSH tunnel"
   63     # Kill an already running tunnel (connection might be inactive)
   64     pkill -f '^ssh.*8025:math:25'
   65 
   66     # Create a tunnel to mail server. Forward local port 8025 to remote 25
   67     ssh -N -f -L 8025:math:25 math &
   68 }
   69 
   70 #
   71 # End user settings
   72 #
   73 
   74 # vim: set ft=sh: