I have set up a email alias that calls an hpux script whenever an email is sent to the alias. When we send an email message to the alias, do a cat on the script would get the message just fine. And the script runs well.
My issue is how do the script (shell script) get the attachment and save the attachment on the server? Of course cat doesn't work, it will get something like:
PGh0bWw+DQo8aGVhZD48c3R5bGUgdHlwZT0idGV4dC9jc3MiPg0KPCEtLQ0KLnBhZ2VIZWFk
PGh0bWw+ZXIg
ew0KCXRleHQtYWxpZ246IGxlZnQ7DQoJd2lkdGg6IDEwMCU7DQoJcGFkZGluZy1ib3R0b206IDEw
cHg7DQp9DQoucGFnZUhlYWRlciAudGl0bGUgew0KCWZvbnQtZmFtaWx5OiBWZXJkYW5hLCBBcmlh
bCwgSGVsdmV0aWNhLCBzYW5zLXNlcmlmOw0KCWZvbnQtc2l6ZTogMTRweDsNCglmb250LXdlaWdo
dDogYm9sZDsNCgljb2xvcjogIzY2NjY2NjsNCgl9DQoudGV4dEdlbmVyYWwgew0KCWZvbnQtZmFt
aWx5OiBWZXJkYW5hLCBBcmlhbCwgSGVsdmV0aWNhLCBzYW5zLXNlcmlmOw0KCWZvbnQtc2l6ZTog
My issue is how do the script (shell script) get the attachment and save the attachment on the server? Of course cat doesn't work, it will get something like:
PGh0bWw+DQo8aGVhZD48c3R5bGUgdHlwZT0idGV4dC9jc3MiPg0KPCEtLQ0KLnBhZ2VIZWFk
PGh0bWw+ZXIg
ew0KCXRleHQtYWxpZ246IGxlZnQ7DQoJd2lkdGg6IDEwMCU7DQoJcGFkZGluZy1ib3R0b206IDEw
cHg7DQp9DQoucGFnZUhlYWRlciAudGl0bGUgew0KCWZvbnQtZmFtaWx5OiBWZXJkYW5hLCBBcmlh
bCwgSGVsdmV0aWNhLCBzYW5zLXNlcmlmOw0KCWZvbnQtc2l6ZTogMTRweDsNCglmb250LXdlaWdo
dDogYm9sZDsNCgljb2xvcjogIzY2NjY2NjsNCgl9DQoudGV4dEdlbmVyYWwgew0KCWZvbnQtZmFt
aWx5OiBWZXJkYW5hLCBBcmlhbCwgSGVsdmV0aWNhLCBzYW5zLXNlcmlmOw0KCWZvbnQtc2l6ZTog