Support Forum
The Forums are a place to find answers on a range of Fortinet products from peers and product experts.
sschaffer
New Contributor

Import Email Adddress BWL list

Is it possible to import an email address bwl list into fortiguard unit using some sort of text file? Thanks for any help. Scott Schaffer
5 REPLIES 5
abelio
SuperUser
SuperUser

Sure, You need put your BWL list in FTG format. You can do that using a script (shell, perl, python, whatever) to generate a text file with your entries in the following format:
 config spamfilter emailbwl
     edit 1
         set comment ' <your comments>' 
             config entries
                 edit 1
                     set action {clear|spam}  
                     set email-pattern " <mail/domain/pattern>"    <-your entry list here
                     set pattern-type {wildcard|regexp}
                     set status {enable|disable}
                 next
                 edit 2
                ...
                next
          next
             end
         set name " <defined-emailbwl>" 
     next
 end
 
Once you' ve the text file you can Paste directly into the destination FTG Console or use the feature " Import Bulk CLI Commands" from System->Maintenance->Backup&Restore->Advanced menu

regards




/ Abel

regards / Abel
laf
New Contributor II

ORIGINAL: abelio Sure, You need put your BWL list in FTG format. You can do that using a script (shell, perl, python, whatever) to generate a text file with your entries in the following format:
 config spamfilter emailbwl
     edit 1
         set comment ' <your comments>' 
             config entries
                 edit 1
                     set action {clear|spam}  
                     set email-pattern " <mail/domain/pattern>"    <-your entry list here
                     set pattern-type {wildcard|regexp}
                     set status {enable|disable}
                 next
                 edit 2
                ...
                next
          next
             end
         set name " <defined-emailbwl>" 
     next
 end
 
Once you' ve the text file you can Paste directly into the destination FTG Console or use the feature " Import Bulk CLI Commands" from System->Maintenance->Backup&Restore->Advanced menu
I have only one question: does I have to keep up the exact alignment you posted it, or can I upload an unalligned text file ? 10x in advance.

The most expensive and scarce resource for man is time, paradoxically, it' s infinite.

The most expensive and scarce resource for man is time, paradoxically, it' s infinite.
sschaffer
New Contributor

Thanks, that worked great! Appreciate the info and quick response. Scott
rwpatterson
Valued Contributor III

Someone once wanted me to import about 300 names into a unit, so I wrote a PERL script to create the proper code to paste in. It' s online at http://camerabob.dyndns.org:5190/fortigate/index.cgi if you' re lazy like me.... I work hard to be lazy! Enjoy.

Bob - self proclaimed posting junkie!
See my Fortigate related scripts at: http://fortigate.camerabob.com

Bob - self proclaimed posting junkie!See my Fortigate related scripts at: http://fortigate.camerabob.com
UkWizard
New Contributor

alignment is purely visual to make it easier to understand the structure. so no, it doesnt matter, in fact it should all be on the left when in a file.
UK Based Technical Consultant FCSE v2.5 FCSE v2.8 FCNSP v3 Specialising in Systems, Apps, SAN Storage and Networks, with over 25 Yrs IT experience.
UK Based Technical Consultant FCSE v2.5 FCSE v2.8 FCNSP v3 Specialising in Systems, Apps, SAN Storage and Networks, with over 25 Yrs IT experience.
Labels
Top Kudoed Authors