Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
New Member

Automate mailconfig

Hi there,
Is there anyway of automating the mailconfig command in order to backup your ironport configuration automatically on a regular schedule?

6 REPLIES
New Member

Re: Automate mailconfig

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

Cisco Employee

Re: Automate mailconfig

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!!

New Member

Re: Automate mailconfig

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"


The 1 at the end says to send passwords. You can actually put the 1 anywhere on the line or with multiple email addresses.

Being paranoid without knowing the math behind it I probably wouldn't do this though. I would backup the user/password information just once (it probably doesn't change all that often?) and then do normal mailconfigs. In the event that I need to restore from a disaster I can just paste in the user/password to the most recent XML file and loadconfig. This way I don't have password hashes running around the internet each day.

New Member

Re: Automate mailconfig

Since other folks are talking about saveconfig, the "1" trick also works there:


saveconfig 1

New Member

SSH and the ironports.

If you are doing ssh to do this, you should do ssh -t .



ssh ironport.mydomain.com "mailconfig me@mydomain.com 1"


New Member

Re: Automate mailconfig

Thanks for your help. I'll give this a try.

261
Views
0
Helpful
6
Replies