06-09-2008 10:30 PM
Hi,
I'm new on this forum and hope you could help me for this.
My problem is to import regularly a list of email address or domains to the RAT. It would be easy with an import but I need to specify the "Bypass LDAP accept" option to "yes".
It would be something like that:
-------------------
listenerconfig
edit
1
rcptaccess
new
"email or domain from a file" <= must be taken from a file with more than 5000 lines!
1
n
n
y <= "bypass ldap accept option"
commit
automated import
---------------------
So my issue is to find a way to make a loop for all the lines in my file containing all the entries. I am really not familiar with unix tools sorry.
"Read the first line, do the script, read the second line, do the scirpt..." until the end of the file.
Hope I explained it well.
Thanks for your help.
Regards,
Alexandre
06-10-2008 11:14 PM
The Unix "expect" program is very good for setting up automated tasks that you normally do manually.
Here are some useful links the give more detail on Expect and examples.
http://expect.nist.gov/
http://en.wikipedia.org/wiki/Expect
Hi,
I'm new on this forum and hope you could help me for this.
My problem is to import regularly a list of email address or domains to the RAT. It would be easy with an import but I need to specify the "Bypass LDAP accept" option to "yes".
It would be something like that:
-------------------
listenerconfig
edit
1
rcptaccess
new
"email or domain from a file" <= must be taken from a file with more than 5000 lines!
1
n
n
y <= "bypass ldap accept option"
commit
automated import
---------------------
So my issue is to find a way to make a loop for all the lines in my file containing all the entries. I am really not familiar with unix tools sorry.
"Read the first line, do the script, read the second line, do the scirpt..." until the end of the file.
Hope I explained it well.
Thanks for your help.
Regards,
Alexandre
06-11-2008 08:46 AM
Hi kluu,
I will check this. Thanks!
Nobody has already do this? :(
Regards,
Alexandre
06-11-2008 11:21 AM
We are using expect to daily import an alias tables and it's working fine
06-11-2008 03:08 PM
I know it's working but my problem is the fact that I need to import line by line the file and not in a whole.
06-11-2008 04:01 PM
Can you use the Expect script upload the file to the "configuration" directory and issue the "import" command that is found underneath the listenerconfig menu options from the CLI.
[]> rcptaccess
Recipient Access Table
There are currently 3 recipients.
Default Access: REJECT
Choose the operation you want to perform:
- NEW - Create a new entry.
- EDIT - Modify an entry.
- DELETE - Remove an entry.
- PRINT - Display all entries.
- IMPORT - Import a table from a file.
- EXPORT - Export the table to a file.
- CLEAR - Remove all entries.
[]> import
Enter the name of the file on machine "company.com" to import:
[]>
What you can do is export your current "rcptaccess" entries and save it to a local computer from the GUI. Then open the file up with Wordpad and examine how it is structured.
Here is an example taken from a test box:
# File exported by the GUI at 20080611T074855
company.com ACCEPT bypass_ldap_accept=0
other-companies.com ACCEPT bypass_ldap_accept=1
ALL REJECT bypass_ldap_accept=0
So, I would create the file first, using either Unix shell scripts or Perl scripts, then set up Expect to perform the upload of the file into the "configuration" directory and then use Expect again to perform the "import" and "commit" changes actions.
Hi,
I'm new on this forum and hope you could help me for this.
My problem is to import regularly a list of email address or domains to the RAT. It would be easy with an import but I need to specify the "Bypass LDAP accept" option to "yes".
It would be something like that:
-------------------
listenerconfig
edit
1
rcptaccess
new
"email or domain from a file" <= must be taken from a file with more than 5000 lines!
1
n
n
y <= "bypass ldap accept option"
commit
automated import
---------------------
So my issue is to find a way to make a loop for all the lines in my file containing all the entries. I am really not familiar with unix tools sorry.
"Read the first line, do the script, read the second line, do the scirpt..." until the end of the file.
Hope I explained it well.
Thanks for your help.
Regards,
Alexandre
06-11-2008 04:07 PM
Ho!
This format is allowed in the file ?
other-companies.com ACCEPT bypass_ldap_accept=1
If it is, it's fine for me :)
I need to test it.
Thanks!
06-14-2008 06:27 PM
Expect would probably be a cleaner way of doing it but if you keen to try it this way you can do the following with a for each loop;
for i in `cat domainlistfile`; do echo listenerconfig edit IncomingMail( This would be your inbound listener) rcptaccess new $i --action accept --bypass_la Yes;done
From the output you can literally just copy and paste the output to your IronPort appliance via the CLI.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide