LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-26-2016, 11:53 AM   #1
zhjim
Senior Member
 
Registered: Oct 2004
Distribution: Debian Squeeze x86_64
Posts: 1,748
Blog Entries: 11

Rep: Reputation: 233Reputation: 233Reputation: 233
exim4 router lsearch file and if not found stop continuing


Hi folks,

fiddeling a bit with exim again I want to create a router that reads users of a domain from a file. And if the user is not found it should stop routing and post cannot_route_message. Problem is either the user is not found and thus the router not even called or I can get the router called but can't check if user exists.

Running on debian 7 with the extra domain not inside the +local_domains. For the domain option I have a file within the exim config dir with all the user names. Each on one line. Heres the router i have thus far:
Code:
.ifdef EXTRA_DOMAINS
local_user_extra:
  debug_print = "R: local_user_extra for $local_part@$domain"
  driver = accept
  domains = ! +local_domains
  require_files = CONFDIR/domains/$domain
  local_parts = lsearch;CONFDIR/domains/$domain
  transport = maildir_domain
  cannot_route_message = Unknown user
  more = false
.endif
This way if the user is not found by looking up the text file the router is not called.
If I comment local_parts I dunno how to tell exim to check if the user exists or not. Its like a catch-all router for existing domains.

How can I tell exim to call the router. Do a lookup on the text file. Then basing on the result either move on to the transport or print out the cannot_route_message?


On the err of running in the wrong directortion, heres what I want to achieve.
Have exim running with internet mailing enabled. All the local user from passwd should mail to each other on the localhost but not to outward domains. They also should not receive mails from outside the localhost. Second have virtual domains, with virtual users that are allowed to receive mail as well as send mail. Also the local users should not be allowed to send to the virtual ones and vice versa.

Regards
Zhjim
 
Old 03-29-2016, 01:44 PM   #2
zhjim
Senior Member
 
Registered: Oct 2004
Distribution: Debian Squeeze x86_64
Posts: 1,748

Original Poster
Blog Entries: 11

Rep: Reputation: 233Reputation: 233Reputation: 233
Sonata done.

Turns out accept is okay and not calling this router is okay too. We just need another router that denies if the user is not found. This is accomplished by the redirect router.
If you use data or file should not really matter. Exim just wants either.

Code:
.ifdef EXTRA_DOMAINS
local_user_extra:
  debug_print = "R: local_user_extra for $local_part@$domain"
  driver = accept
  domains = ! +local_domains
  local_parts = lsearch;CONFDIR/domains/$domain
  transport = maildir_domain

# else deny
local_user_extra_deny:
  debug_print = "R: local_user_extra_deny for $local_part@$domain"
  driver = redirect
  domains =! +local_domains
  data = 
  more = false
  cannot_route_message = Unkown user
.endif
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
TCL lsearch -regexp grob115 Programming 3 11-22-2009 07:31 PM
Exim4 can't start - getopt: command not found TheCat Linux - Newbie 1 04-23-2009 12:21 AM
Exim4 variables in router configuration Murdock1979 Linux - Server 0 07-20-2008 10:43 AM
Getting GNU Tar to stop when file is found Gault LaRue Linux - General 3 03-30-2007 02:56 PM
Help!! Make file:62: *** Linux source not found. Stop. harlemno1 Linux - Newbie 6 03-04-2005 04:22 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:17 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration