LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-12-2007, 10:48 AM   #1
schmack1331
LQ Newbie
 
Registered: Jul 2007
Posts: 1

Rep: Reputation: 0
forwarding file.. where is it??


where can i alter my forwarding in slackware 11??
thanks
 
Old 07-12-2007, 11:45 AM   #2
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 344Reputation: 344Reputation: 344Reputation: 344
What kind of forwarding are you interested in? Email forwarding? Network port forwarding? Web forwarding (redirection)?
 
Old 07-13-2007, 06:38 PM   #3
TefoZi
Member
 
Registered: Apr 2006
Distribution: Debian Etch
Posts: 39

Rep: Reputation: 15
Quote:
Originally Posted by macemoneta
What kind of forwarding are you interested in? Email forwarding? Network port forwarding? Web forwarding (redirection)?
1. Where is .forward file in debian?
2. I want to implement script which will parse and get data from email message. When i'm getting email message i want to send this message to my script as parameter. Can i do this through .forward file?

| /home/username/my_script.pl

or something like this?
 
Old 07-13-2007, 06:51 PM   #4
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 344Reputation: 344Reputation: 344Reputation: 344
The .forward file is created in your home directory. Make sure the permissions are 600. Yes, you can include a pipe and script to process the email.
 
Old 07-14-2007, 07:04 PM   #5
TefoZi
Member
 
Registered: Apr 2006
Distribution: Debian Etch
Posts: 39

Rep: Reputation: 15
Pipe mail messages

I'm trying pipe my mail messages to another program and than parse.
I've created .forward file in my home directory, set permissions 600 and my file looks like:
Code:
|/home/username/process_messages.pl
/home/username/process_messages.pl - this file exist and has executable permissions

Code:
#!/usr/bin/perl
use strict;
use warnings;

open(EMAIL, ">> emails.dat");
while(<STDIN>) {
    print(EMAIL $_);
}
close(EMAIL);
What's wrong? Why my messages are not forwarding?

Thanks!
 
Old 07-14-2007, 08:24 PM   #6
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 344Reputation: 344Reputation: 344Reputation: 344
Take a look at /var/log/maillog for errors.
 
Old 07-16-2007, 02:51 PM   #7
TefoZi
Member
 
Registered: Apr 2006
Distribution: Debian Etch
Posts: 39

Rep: Reputation: 15
It was my bad, I've made a mistake in line:
Code:
open(EMAIL, ">> emails.dat");
should be
Code:
open(EMAIL, "> emails.dat");
How it works for me now:
1. Create .forward file in home directory with permissions 600:
Code:
|/home/<username>/process_messages.pl, /home/<username>/mail/all.messages, "|/usr/bin/procmail -t #bplecs"
2. Create .procmailrc file in home directory with permissions 600:
Code:
PATH=/usr/local/bin:/usr/bin:/bin
MAILDIR=$HOME/mail      #you'd better make sure it exists
LOGFILE=$MAILDIR/from   #recommended

:0c:
$HOME/mail/backup.messages
3. Create process_messages.pl file to process messages:
Code:
#!/usr/bin/perl
use strict;
use warnings;

open(EMAIL, "> /home/<username>/mail/latest.messages");
while(<>) {
    print(EMAIL $_);
}
close(EMAIL);
4. Create mail directory and files:
$HOME/mail/
- all.messages
- backup.messages
- latest.messages
 
  


Reply

Tags
forward, forwarding, mail, pipe



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Mail Forwarding in postfix/maildrop/redhat (like yahoo mail forwarding) topcat Linux - Software 1 08-31-2007 12:10 PM
IPCHAINS port forwarding and IPTABLES port forwarding ediestajr Linux - Networking 26 01-14-2007 07:35 PM
Simple Port Forwarding Firewall - not forwarding MadTurki Linux - Security 14 04-09-2006 12:08 PM
port forwarding and packet forwarding syrtsardo Linux - Newbie 2 07-03-2003 10:37 AM
Re: Forwarding email (.forward file) andy_sco123 Linux - General 3 05-24-2002 12:34 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:35 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration