Sunday, January 01, 2006

Fetchmail - external mail fetcher

Introduction :

Fetchmail is a service that you can use to retrieve mail from external mailservers.

Fetchmail is a full-featured, robust, well-documented remote-mail retrieval and forwarding utility intended to be used over on-demand TCP/IP links (such as SLIP or PPP connections). It supports every remote-mail protocol now in use on the Internet: POP2, POP3, RPOP, APOP, KPOP, all flavors of IMAP, ETRN, and ODMR. It can even support IPv6 and IPSEC.

Fetchmail retrieves mail from remote mail servers and forwards it via SMTP, so it can then be be read by normal mail user agents such as mutt, elm(1) or BSD Mail. It allows all your system MTA's filtering, forwarding, and aliasing facilities to work just as they would on normal mail.

Configuration :

For a simple use, fetchmail is quite easy to configure. I'll only be covering the situation where I want to retrieve the mail that's waiting in the POP3 mailbox of my ISP.

By default, fetchmail uses a config-file that can be found at ~username/.fetchmailrc. It is also possible to start fetchmail from the command-line. When started from the command-line, all options provided will override those in the config-file.

Here's an example of what is in my config-file.

poll pop.myisp.com proto pop3 user "johndoe" password "secret" is "johndoe@localdomain.com" here

With poll you provide the server that needs to be contacted.

Then, with proto you specify the protocol that needs to be used (in this case it's POP3).

The user and password are quite obvious and provide your account and password at the server.

With the last directives, I make sure that the collected mail is deliverd to a local-mailbox (otherwise it would be quite hard to read it :) ).

CronJob / Daemonmode :

For an automatic pick-up of your mail, you could write your own script that calls fetchmail every hour and delivers the mail. But in stead of using the cron-daemon you can start fetchmail also in daemon mode. This is very easily done by this command :

fetchmail --daemon 3600 (3600 = interval)

Interval is a numeric argument that specifies the polling interval in seconds. There can only be one daemon process per user, fetchmail makes a per-user lockfile to guarantee this.

You can stop the daemon with:

fetchmail --quit

Off course, whenever you reboot your machine, you need to restart the daemon. You can automate this process by adding a line to /etc/rc.local that starts the daemon.

Configure your Internal Modem on Linux

How to configure your Internal Modem Driver on Linux

In my Laptop Compaq Presario - M2002AL Model

I am Running Mandrake 9.2

#lspci |grep Modem

00:1f.6 Modem: Intel Corp. 82801DB AC'97 Modem Controller (rev 03)


You need to install smartlink driver for this to work.

Kernel Used in my system
2.4.22-21mdk-i686-up-4GB


I downloaded the smartlink driver from

http://linmodems.technion.ac.il/packages/smartlink/

slmodem-2.9.6.tar.gz

I unpacked it in /home/sriram

#tar -zxvf slmodem-2.9.6.tar.gz

#cd slmodem-2.9.6

For installing, do

#make clean
#make
#make install

Once it is installed without any error, you will have to load the module.

1. Load modem driver.

Load your modem hardware specific kernel module:

# modprobe slamr

if you are using AMR/CNR/PCI modem, or

# modprobe slusb

if you are using SmartUSB56 Modem.

Note: this will be done automatically when modules were
configured for 'loading on demand'

Note: this is safe to load both 'alamr' and 'slusb' modules.


2. Run soft modem application.

# /usr/sbin/slmodemd [options]

Where device name is appropriate device node for your modem
(look at output of 'dmesg' command).
Run '/usr/sbin/slmodemd --help' for details.

Examples:

# /usr/sbin/slmodemd --country=USA /dev/slamr0

, or for SmartUSB56 Modems:

# /usr/sbin/slmodemd --country=ITALY /dev/slusb0


3. Using the modem.

When 'slmodemd' is running this creates PTY (pseudo-terminal) to
emulate modem port device, also this creates symbolic link
like '/dev/ttySL0' (shown at startup).

Config your application to use this link '/dev/ttySL0' (or PTY node
itself) as modem port.

Note: Some application want 'to know' that they are working with
pseudo-terminal and may require additional configurations.

Known application notes:

- 'wvdial' requires option 'Carrier Check = no' in config file