10

OfflineIMAP and isync are both programs that integrate well with mutt and will satisfy your other criteria. OfflineIMAP is written in Python and isync in C; both are very quick. Both programs are well documented and straightforward to set up; isync perhaps slightly easier. There is one significant difference between the functionality of each that is worth ...


7

I could not find a way to preserve or re-instate the 'unread' flag on the server. In the end, I switched to using getmail, a more modern alternative to fetchmail that's written in Python. Unlike fetchmail, getmail retrieves messages based upon the server's message id rather than the message 'unread' flag. This is the getmail configuration file I created ...


5

It does not appear that fetchmail supports TLS to the SMTP server. This is normally not a problem, as it usually delivers emails locally. You can work around this by delivering to a local SMTP server and have it handle the delivery. If your don't need or want a full service server like exim4 or postfix, you can use a light-weight relay like esmtp or '...


4

Since Jetchisel will not turn his comment into an answer, I am doing it here, with more details. Warning: I am not an expert on these issues and this is only to make available whatever understanding I gathered, painfully, as I did not have the right keywords for searching. As commented by Jetchisel, it seems that in some distros configuration files usually ...


3

Your DEFAULT=inbox/ says that mail should be delivered to a Maildir mailbox (with subdirectories cur, new and tmp). This mailbox is located in $HOME/Mail/. according to the MAILDIR variable. To deliver to an MH mailbox instead, you should set DEFAULT to inbox/. (note the dot at the end). MAILDIR can be set to $HOME/Mail. In short: The final mailbox path ...


3

The formail -s method is documented with a demo script in the procmail man page; look for this phrase: Procmail can also be invoked to postprocess an already filled system mailbox. You would also find this in http://www.iki.fi/era/procmail/mini-faq.html#split If your mailbox is not a Berkeley mbox single file, chances are you have a directory where ...


3

The fetchmail: SMTP ... logs indicate that fetchmail is talking to a Mail Transport Agent (MTA), here Postfix, and Postfix has rejected the message from fetchmail on account of not being able to resolve the (unqualified!) hostname of localhost. Thus, the solution is to correct the DNS (and possibly hostname) for the system. This may also make sending mail ...


3

There are options you can use when you call fetchmail that will make it print out logs and debug information. Here's from the man page: For troubleshooting, tracing and debugging, you need to increase fetch- mail's verbosity to actually see what happens. To do that, please run both of the two following commands, adding all of the options you'd ...


3

Try isync which sounds like it should fit your purpose: isync is a command line application which synchronizes mailboxes; currently Maildir and IMAP4 mailboxes are supported. New messages, message deletions and flag changes can be propagated both ways. isync is suitable for use in IMAP-disconnected mode.


3

Traditional mailx does not support IMAP or POP, but the one that comes with Linux does. For your particular problem, I recommend using fetchmail instead. You can use the --mda option to have fetchmail execute a script of your choice for each downloaded message. It can even pass the From and To addresses as parameters to your script if you use %F and %T as ...


3

Install procmail if not already installed. In your postfix configuration ( /etc/postfix/main.cf ) make sure you have a line: mailbox_command = procmail -a "$EXTENSION" in your ~/.procmailrc insert the following (you will need a different matching pattern): :0 * ^Subject:.*some_text_to_match | /usr/local/bin/your_processing_program In ...


2

In mutt, you can type v, and then select the alternative you want to display. You can also change the content-type of a part with Ctrl-E. As a more generic approach, you could use mutt's display_filter setting: set display_filter=/path/to/mutt-filter With mutt-filter being something like: #! /usr/bin/awk -f BEGIN { cmd="echo '[automatically converted ...


2

Short: it doesn't do that. Long: fetchmail is only designed to do one of these: read entire mailboxes, or read the unread messages from a mailbox When it has read a message, it can mark this (on the server) as "read". But there is no timestamp associated with this. The inability to do this is known, and according to a reply on fetchmail users by by Rob ...


2

according to this you shold go to your ~/.ssl/certs and: wget -O Equifax_Secure_Certificate_Authority.pem https://www.geotrust.com/resources/root_certificates/certificates/Equifax_Secure_Certificate_Authority.cer then you have to run following line: c_rehash ~/.ssl/certs then fechmail -v should not give Server certificate verification error.


2

Since mda is just a program read the whole email from stdin and write it to somewhere, you can write the simplest mda in bash: mda "/bin/sh -c 'cat > INBOX/new/$(date +%''s_%N)'" The tricky single quote is a work-around to avoid "%s", because fetchmail will replace "%s" with the current user name: Encode literal percent in fetchmail's mda option


2

That date is found inside the email headers. They look a bit like this: Received: from mail-pd0-f170.google.com (mail-pd0-f170.google.com [209.85.192.170]) by mailserver.example.com (Postfix) with ESMTP id DCFEE3983D for <someaddress@example.com>; Tue, 23 Jul 2013 20:32:34 +0200 (CEST) Received: by mail-pd0-f170.google.com with SMTP id ...


2

Ther eisn't really anything out of the box that I'm aware of with fetchmail but you could easily construct something yourself like so. If you had a start) section to your /etc/init.d/fetchmail service: start) # Start daemons. echo -n "Starting fetchmail: " update_boot_stage 'Starting email fetching service' conffile=/etc/...


2

Check imapfilter, which this you can check remote imap server - https://github.com/lefcha/imapfilter


2

Your mail server is broken. It claims that it has a message numbered 1 in the UIDL command, but then the LIST command trying to get the size of that message claims there is no such message.


2

Fixed with this. poll pop.1and1.com protocol POP3 envelope "Delivered-To:" localdomains example.org user "*@example.org" there with password "Passw0rd!" is * here smtpaddress localhost ssl fetchall Then the postfix receive all mails and handles the correct mailbox. (Its funny: You can redirect fetched mails to internet :D :D) But thanks @...


2

Assuming that your mailbox file is in the mbox format, you can use the formail utility that comes with procmail to run a command on each mail, with the -s option to tell it that the input is a mailbox and not just a single mail. That command can be procmail if you want to apply your procmail rules, or it can be anything else that receives the mail on ...


2

Looks like you're talking about RFC 2047: MIME encoding for email headers. Further RFCs have since then augmented this RFC to allow more character sets and to optionally include a language specification. Because the initial email and MIME specifications included the assumption that headers would only contain strict US-ASCII, the header encoding is ...


1

Before the erratic behaviour, I had set up an mda ... line at the end of my .fetchmailrc, and for some reason I don't know yet, this was applied to all of my accounts. The problem I experienced was fetchmail falling back to its normal behaviour - the mda was set as last line, so it was applied only to the last account in the rc-file. Not sure how it ever ...


1

If your configuration allows it, Sendmail (and presumably also the sendmail program from ssmtp) lets you override the envelope sender with -f. Here's a quick whack at doing it from Procmail. :0 * ^Return-Path:[ ]*\/[^ ].+ ! -f "$MATCH" myusername@gmail.com The whitespace inside the square brackets should be a space and a tab, in any order. (Copy/paste ...


1

The accepted answer is correct, but I'd like to add some comments and amplifications. Your question seems to suggest that you believe that MH and Maildir are one and the same format. They are not; MH traditionally uses a single directory per folder, while Maildir, as you discovered, uses three subdirectories; it originally delivers into new, then moves to ...


1

I would suggest mutt. Install mutt, procmail and fetchmail. Mails will be stored here by default $HOME/Mail/ (your maildir; create). Help to setup Gmail in mutt. Setup fetchmail, procmail create an attachment directory Add this to the $HOME/.procmailrc ATTACH=`echo $HOME/Mail/Attachments` :0 c * ^To:.*me@email.com * ^From.*notification@email.com * ^...


1

You can instruct fetchmail which is the remote user and which is the local user by: poll pop.1and1.com protocol POP3: user "myuser@example.org" there with password "Passw0rd!" ssl fetchall is local-user here It is also possible to use another mda using: poll pop.1and1.com protocol POP3: user "myuser@example.org" there with password "Passw0rd!" ...


1

You might want to have a look at a filtering solution such as procmail. You can have fetchmail collect the mail from your IMAP or POP (or whatever) server and then specify in your ~/.fetchmailrc configuration that it should deliver with procmail (see the mda setting in the manual). You would then set up procmail to filter the incoming mail into one or ...


1

After reading fetchmail's source code (sink.c, around line 1183), I couldn't figure out a way to encode '%'. So the only work-around is to avoid "%s", and it's easy by using bash's single quote syntax: mda "/bin/sh -c 'cat > INBOX/new/$(date +%''s_%N)'"


1

You can run a periodic log analyzer of some sort to verify that you have received everything you expect to receive. Perhaps something like this. awk 'BEGIN { e="root1@example1.com:root2@example2.yu:root3@example3.yu:xenbackup@example4.rs"; split(e, expected, /:/) } /^From / { seen[$2]++ } END { for (x in expected) if (!(expected[x] in seen))...


Only top voted, non community-wiki answers of a minimum length are eligible