Subscribe Us

How to setup Fetchmail Sample file to download the mail [ Part-3/6 ]


Sample file /root/.fetchmailrc
#set syslog
poll mail.howto.info
user test@howto.info
pass "XXXXXX"
is test here
keep

The permission for .fetchmailrc should be 610
#chmod 610 /root/.fetchmail

Procmail for mail forwarders

Sample / example for procmail files :
Sort out all mail coming from the scuba-dive mailing list into the mailfolder scubafile (uses the locallockfile
scubafile.lock).

:0:
* ^TOscuba
scubafile


Forward all mail from peter about compilers to william (and keep a copy of it here in petcompil).

:0
* ^From.*peter
* ^Subject:.*compilers
{
:0 c
! william@somewhere.edu

:0
petcompil
}


A simple autoreply recipe. It makes sure that neither mail from any daemon (like bouncing mail or mail from mailing-lists), nor autoreplies coming from yourself will be autoreplied to. If this precaution would not be taken, disaster could result (‘ringing’ mail). In order for this recipe to autoreply to all the incoming mail, you should of course insert it before all other recipes in your rcfile. However, it is advisable to put it after any recipes that process the mails from subscribed mailinglists; it generally is not a good idea to generate autoreplies to mailinglists (yes, the !^FROM_DAEMON regexp should already catch those, but if the mailinglist doesn’t follow accepted conventions, this might not be enough).
:0 h c
* !^FROM_DAEMON
* !^X-Loop: your@own.mail.address
| (formail -r -I"Precedence: junk" \
-A"X-Loop: your@own.mail.address" ; \
echo "Mail received.") | $SENDMAIL -t

A more complicated autoreply recipe that implements the functional equivalent of the well known vacation(1) program. This recipe is based on the same principles as the last one (prevent ‘ringing’ mail). In addition to that however, it maintains a vacation database by extracting the name of the sender and inserting it in the vacation.cache file if the name was new (the vacation.cache file is maintained by formail which will make sure that it always contains the most recent names, the size of the file is limited to a maximum of approximately 8192 bytes).
If the name was new, an autoreply will be sent.


As you can see, the following recipe has comments between the conditions. This is allowed. Do not put comments on the same line as a condition though.

SHELL=/bin/sh # for other shells, this might need adjustment

:0 Whc: vacation.lock
# Perform a quick check to see if the mail was addressed to us
* $^To:.*\<$\LOGNAME\>
# Don’t reply to daemons and mailinglists
* !^FROM_DAEMON
# Mail loops are evil
* !^X-Loop: your@own.mail.address
| formail -rD 8192 vacation.cache
:0 ehc # if the name was not in the cache
| (formail -rI"Precedence: junk" \
-A"X-Loop: your@own.mail.address" ; \
echo "I received your mail,"; \
echo "but I won’t be back until Monday."; \
echo "-- "; cat $HOME/.signature \
) | $SENDMAIL -oi -t


:)

PART-1 Configure complete sendmail server in rhel.

PART-2 Creating the Certificate for secured communication(dovecot).

PART-3 Fetchmail Sample file to download the mail.

PART-4 Installation of CLAMAV antivirus.

PART-5 Mailscanner quick install notes.

PART-6 Installation instruction MailWatch & SpamAssassin.



Post a Comment

6 Comments

  1. I'm extremely impressed along with your writing skills as well as with the format on your blog.
    Is that this a paid subject or did you modify it yourself?
    Either way keep up the nice quality writing, it is rare to
    look a nice weblog like this one today..

    My homepage ... canlı iddaa oyna

    ReplyDelete
  2. Hi, I log on to your new stuff like every week. Your story-telling style is witty, keep doing what you're doing!


    My webpage: Christian Louboutin Sale

    ReplyDelete
  3. Please let me know if you're looking for a author for your blog.
    You have some really great articles and I believe I would be a good asset.
    If you ever want to take some of the load off,
    I'd love to write some content for your blog in exchange for a link back to mine.
    Please send me an email if interested. Thanks!


    Feel free to visit my blog post: dragon city gems

    ReplyDelete
  4. Heya i'm for the first time here. I came across this board and I find It truly useful & it helped
    me out much. I'm hoping to offer something back and aid others such as you aided me.


    Here is my site :: Christian Louboutin Sale

    ReplyDelete
  5. Wonderful beat ! I wish to apprentice while you amend your website, how could
    i subscribe for a blog site? The account aided me a acceptable deal.
    I had been a little bit acquainted of this
    your broadcast offered bright clear idea

    Have a look at my site - Christian Louboutin Outlet

    ReplyDelete
  6. It's amazing in support of me to have a web site, which is useful for my know-how.
    thanks admin

    my homepage; Christian Louboutin Sale

    ReplyDelete