Retrieve mail from user called user01 of smtp.some.server.ie server:
root:~> cat .fetchmailrc
poll "smtp.some.server.ie" proto IMAP user "user01" password "password" is user01 keep sslproto ''
mda '/usr/bin/procmail -d %T'
set logfile /home/user01/fetchmail.log
To save an attachment from an e- mail use
UUDeview is a program that helps you transmit and receive binary files over the Internet, using electronic mail or newsgroups The UUDeview package includes both an encoder and a decoder. The decoder automatically detects the type of encoding used, offering MIME’s Base64 and BinHex as well as the popular uuencoding and the less frequently used xxencoding methods.
root:~> cat .procmailrc
# Now the actual unpacking part
# forward to uudeview and unpack
| uudeview -i +a +o -p /share/Shared/attachment/ -
And then run fetchmail command 😉