Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I've been wracking my brain trying to figure this one out: Is it possible to use Pine with more than one pop3 account? And if not, are there any command line email programs that do?
I would recommend setting up an IMAP server, and download all your POP3 e-mail with fetchmail.
fetchmail is able to download mail, and forward it (for example, to your postfix/sendmail server). Postfix could drop the message in your ~/Maildir/ with procmail or maildrop. (both have a filtering language to sort the mail, and add spam checks / use spamassassin). An IMAP server, for example courier-imap, is able to retreive all messages from your ~/Maildir/.
And there are a lot of IMAP clients including web based onces (ie. you could have webmail at your own machine)
this is a bit advanced, but worth all the effort if you want something better
I've got a lot of help from this site: http://www.firstpr.com.au/web-mail/ but I found it very confusing. But if there is anything about this idea you're confused about, please ask it took me quite some time before I understood the entire concept
I just thought I could explain a little more. Because that link has way to much details ..this story got a little long, but I think it's useful too
postfix + imap
first try to install postfix (and uninstall sendmail). You should be able to send e-mail through postfix to another host.
Try to use 127.0.0.1 as your SMTP server, and try to send a normal e-mail.
Postfix also requires you to use an aliases file. it's created by the program "newaliases". I've configured postfix to send all root@localhost mail to my own user@localhost for example
Then you should configure the local delivery: configure postfix to use maildrop as local mail delivery agent. In other words, when you send an e-mail to you@localhost, it will be passed to maildrop. maildrop will use the ~/.mailfilter to filter the file, and store the e-mail in ~/Maildir/...
Get courier imap working; instead of reading the e-mail directly from ~/Maildir/, you can connect to your system on the imap port. Most e-mail programs, also outlook express support imap.
receiving mail
There are 2 ways you could receive your e-mail:
make the postfix server accessible from the internet, and people could send e-mail to yourusername@yourmachine. You need to be careful with this; If your system is an open-relay, spammers could use your mailserver to send messages. And every service accessible from the internet is a possible way to break into your system.
To retreive pop3 mail you could use "fetchmail". fetchmail downloads pop3 mail, and forwards it to postfix automatically.
I run fetchmail every hour from a cron-job. If my msn messenger receives a new-mail notification, fetchmail is enabled as well
sending mail
Sending e-mail can be done very easy; you don't need to SMTP of your ISP anymore, you can just use localhost
reading e-mail
you can use any IMAP capable mail client. You could use outlook express from another Windows workstation, or KMail, Mozilla-mail, mutt, or Squirllmail (webmail). It doesn't matter which client you use, the e-mail will look exactly the same! (even the read-status, etc.. )
message filtering examples
Message filtering:
From the ~/.mailfilter file, I sort all messages. Maildrop rules apply to the message text.
This part of my ~/.mailfilter passes the message to spamassassin, and detects the changes that spamassassin makes to spam e-mails.
To filter virus e-mail, that causes outlook express to invoke attachments automatically if you only view a message!:
Code:
if( $SIZE < 200000 )
{
# Match the <iframe> exploit of outlook express, that causes execution
# of programs, loaded my the iframe, because on an mangled content type.
#
if( /<iframe src=3D"?cid:/:b )
{
log "---- *VIRUS* outlook <iframe> exploit"
to "Maildir/.Spam"
}
# Remove attachments with unwanted file extensions
# It seams another nasty trick is also popular:
# A lot of spaces between the .ext and .pif extension.
#
# Content-Type: audio/x-midi
# <tab> name=file.ext .pif
#
if( /[\n\r]Content\-Type: [a-zA-Z\-\/]+;[\n\r]*[:space:]+name=.*\.(bat|pif|scr)"?[\n\r]/:bw )
{
log "---- *VIRUS* unwanted extensions in content-type"
to "Maildir/.Spam"
}
# Content-Disposition: attachment; filename=file.src
if( /[\n\r]Content\-Disposition: attachment;[\n\r]*[:space:]+filename=.*\.(bat|pif|scr|exe)"?[\n\r]/:bw )
{
log "---- *VIRUS* unwanted extensions in content-disposition"
to "Maildir/.Spam"
}
}
Finally, this part of the code sorts a message to another folder:
Code:
# messages from my site to another imap folder:
if( /^Received: from mail\.codingdomain\.com/ )
{
if( /(To|Cc|Bcc): .*webmaster@codingdomain\.com/ )
{
to "Maildir/.codingdomain.Inbox"
}
...
}
# Default:
to "Maildir/"
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.