04-11-2007 12:52 PM
Hi there,
Is there anyway of automating the mailconfig command in order to backup your ironport configuration automatically on a regular schedule?
04-11-2007 10:11 PM
You can script the backup over ssh.
ssh $host saveconfig
unfortunately this wont save all the password information, but at least its better than nothing
si
04-12-2007 09:57 PM
To automate 'saveconfig', create a .dat file containing the three lines:
saveconfig
y
exit
The tricky bit is that the line endings need to be single characters.
Next, create a batch file containing:
plink -t -pw ironportpw admin@yourironport.name <%1%
Finally, run the .bat file with the .dat file as argument.
Hope this helps!!
04-13-2007 10:42 AM
The mailconfig batchcommand actually supports reading in the yes/no answer to the password question. So you could do:
ssh ironport.mydomain.com "mailconfig me@mydomain.com 1"
04-13-2007 10:43 AM
Since other folks are talking about saveconfig, the "1" trick also works there:
saveconfig 1
04-13-2007 06:10 PM
If you are doing ssh to do this, you should do ssh -t .
ssh ironport.mydomain.com "mailconfig me@mydomain.com 1"
04-18-2007 12:29 PM
Thanks for your help. I'll give this a try.
01-27-2020 07:28 AM - edited 01-28-2020 02:16 AM
I created a python script that will email the config of the ESA in encrypted form to a specified email address. Tested it with AsyncOS 13.0 and with Python 2.7
I have attached the python script as a ESAMailconfig.zip file. The checksum of the .zip file is provided below.
Checksum SHA256: ad95025bf83b7c8851c345379f3867cd5ddb4ded12e1f761b93d6e1bd2b2eefd
Steps:
1. Create a private and public SSH key pairs (Ref: https://www.cisco.com/c/en/us/support/docs/security/email-security-appliance/118305-technote-esa-00.html) & configure an admin user on ESA and assign the keys to it.
2. Copy the attached python script (ESAMailConfig.py), putty executable, SSH private key (created in step 1) in one folder or directory, as shown below:
3. Execute the python script and provide the arguments, an example is provided below:
Example below:
You could create a batch file that executes this python script. The arguments could be specified in the batch file & the python script will get them automagically. The content of a sample batch file is shown below:
Hope it helps!
Prab
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