From: Ratan N. <nal...@ya...> - 2006-04-21 22:47:27
|
Hi all: I am still struggling a bit with the configuration. As suggested, I am going to describe what I am trying to achieve and then explain what I have done so far. - I want to download mail from the mailserver to my laptop, leaving an empty mailbox on the server. - The mailserver currently has IMAP and POP3 ports open, though POP3 may be closed in the future. There is no server on the POP3S port as we speak though. - Ideally, I don't want to enter the password to fetchmail, but have it use my ssh-agent if available and fail if not. - I sometimes read the mail directly on the mail server using squirrelmail and elm. In these cases, the messages are being marked as Read on the server ("Status: RO"). However, when I get them using fetchmail on IMAP protocol, the Status line disappears in the fetched e-mail. - When I fetch the same mail using fetchmail on POP3 protocol, the "Status" fields are retained but it leads to a different problem: insufficient integration with ssh/ssh-agent. I tried the following configuration with IMAP protocol with the result that all fetched mails were appearing as brand new: === IMAP config === set postmaster "ratan" set bouncemail set no spambounce set properties "" defaults mda "/usr/bin/procmail -d %T" poll bitter plugin "env -u DISPLAY /home/ratan/bin/%h exec /usr/local/bin/imapd" auth ssh; user 'ratan' there is 'ratan' here expunge 10 options fetchall mda "cat >> /home/ratan/TEST" ================= I tried the following configuration with POP3 at the suggestion of Matthias. This almost worked except that it is not using SSH. === pop3, attempt#1 === poll bitter with pop3 uidl options fetchall ========= After some research, I tried the following to force it to use ssh; but the results were still not good: this configuration still asks for password; if I enter a bad password, the authentication fails: i.e., apparently, unlike imap server, the pop3 server has no preauthorized state. ==== pop3, attempt#2 === poll bitter with pop3 via localhost port 8005 uidl preconnect "ssh -n -2 -a -C -f ratan@bitter -L 8005:bitter:110 sleep 5" ====== Any suggestions on how I can get the mail while retaining the "Seen" flags exclusively using the ssh-agent for connection would be great. BTW, I tried fetchmail version 6.3.4 and 6.2.5.2 both with the same results. Thanks! Ratan __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com |
From: Matthias A. <mat...@gm...> - 2006-04-21 23:37:36
|
Ratan Nalumasu <nal...@ya...> writes: > Hi all: > > I am still struggling a bit with the configuration. As > suggested, I am going to describe what I am trying to achieve > and then explain what I have done so far. > > - I want to download mail from the mailserver to my laptop, > leaving an empty mailbox on the server. That alone is easy. Don't use --keep and perhaps use --fetchall. > - The mailserver currently has IMAP and POP3 ports open, > though POP3 may be closed in the future. There is no server > on the POP3S port as we speak though. Does the POP3 port offer STLS? If it does, no need for POP3S. > - Ideally, I don't want to enter the password to fetchmail, > but have it use my ssh-agent if available and fail if not. Your configuration does that. > - I sometimes read the mail directly on the mail server > using squirrelmail and elm. That will only work until fetchmail has downloaded the messages. After that, your requirement "empty mailbox after fetch" prevents that. > In these cases, the messages are being marked as Read on the server > ("Status: RO"). However, when I get them using fetchmail on IMAP > protocol, the Status line disappears in the fetched e-mail. This looks a bit like a server issue. Fetchmail would mark downloaded messages read (rather than marking read messages unread), but as per your description the effect is quite the opposite. What I find most peculiar though is that (judging from the -v -v log) fetchmail marks the messages as seen and deleted, sends an EXPUNGE command that logs the two messages as expunged, and apparently the messages are still there (else you wouldn't have messages marked unread, but the messages should be gone). Any idea? > - When I fetch the same mail using fetchmail on POP3 protocol, > the "Status" fields are retained but it leads to a different > problem: insufficient integration with ssh/ssh-agent. Yes, that requires some experimenting on how exactly to start the server, and not all support it, since it's not standardized. > After some research, I tried the following to force it to use > ssh; but the results were still not good: this configuration > still asks for password; if I enter a bad password, the > authentication fails: i.e., apparently, unlike imap server, the > pop3 server has no preauthorized state. Well, it's possible to trick some servers into a similar state, but sometimes this requires wrapper scripts to get synchronization (who talks first) right. > ==== pop3, attempt#2 === > poll bitter with pop3 via localhost port 8005 > uidl > preconnect "ssh -n -2 -a -C -f ratan@bitter -L > 8005:bitter:110 sleep 5" > > ====== > > Any suggestions on how I can get the mail while retaining the > "Seen" flags exclusively using the ssh-agent for connection > would be great. > > BTW, I tried fetchmail version 6.3.4 and 6.2.5.2 both with the > same results. The basic code and how it works is mostly unchanged, but 6.3.4 has a slew of bugs less than 6.2.5.X, so you might want to stick with 6.3.4 nonetheless. -- Matthias Andree |
From: Ratan N. <nal...@ya...> - 2006-04-21 23:48:33
|
Matthias: I think I understand the confusion on "read" vs. "unread" status. What I want is the mail on server to disappear and the mail on laptop to have "read" or "unread" according to what was on the server before the fetch started. What is happening is that the mail on the server is disappearing (as I want), but all mail on the laptop is unread (disconcerting). --- Matthias Andree <mat...@gm...> wrote: > Ratan Nalumasu <nal...@ya...> writes: [...] > > - The mailserver currently has IMAP and POP3 ports open, > > though POP3 may be closed in the future. There is no > server > > on the POP3S port as we speak though. > > Does the POP3 port offer STLS? If it does, no need for POP3S. Yes, it does. Ok, at least one less thing to worry about. [...] > > - I sometimes read the mail directly on the mail server > > using squirrelmail and elm. > > That will only work until fetchmail has downloaded the > messages. After > that, your requirement "empty mailbox after fetch" prevents > that. That is a good thing for me. I login to the mail sever or use squirrelmail infrequently (e.g., when I am on the road and don't have access to laptop). Once I am back in the office, I want to fetch all the mails along with their status. > > In these cases, the messages are being marked as Read on the > server > > ("Status: RO"). However, when I get them using fetchmail on > IMAP > > protocol, the Status line disappears in the fetched e-mail. > > This looks a bit like a server issue. Fetchmail would mark > downloaded > messages read (rather than marking read messages unread), but > as per > your description the effect is quite the opposite. I think here, you are stating that fetchmail would mark the messages on the server as read, right? That is true. After this step, as you find below, the fetchmail does mark it as deleted and expunge it--that is good too. My trouble with the mail on the laptop. > What I find most peculiar though is that (judging from the -v > -v log) > fetchmail marks the messages as seen and deleted, sends an > EXPUNGE > command that logs the two messages as expunged, and apparently > the > messages are still there (else you wouldn't have messages > marked unread, > but the messages should be gone). Any idea? > > > - When I fetch the same mail using fetchmail on POP3 > protocol, > > the "Status" fields are retained but it leads to a > different > > problem: insufficient integration with ssh/ssh-agent. > > Yes, that requires some experimenting on how exactly to start > the > server, and not all support it, since it's not standardized. > [...] Thanks much for the help Ratan __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com |
From: Rob F. <rf...@fu...> - 2006-04-22 00:18:35
|
Ratan Nalumasu wrote: > Matthias: > > I think I understand the confusion on "read" vs. "unread" > status. > What I want is the mail on server to disappear and the mail on > laptop to have "read" or "unread" according to what was on the > server before the fetch started. What is happening is that the > mail on the server is disappearing (as I want), but all mail on > the laptop is unread (disconcerting). OK, so you're starting with a message in your mailbox with a header of "Status: RO". Programs on the server sees it as old and read. fetchmail downloads with IMAP, and you no longer have that Status header telling your local elm that it's old and read. I think the pop/imap server is the one removing the Status header, since that's just a feature of the mbox format that tells the mailreader (e.g. elm or the imap server) whether the mail is read. It isn't intended to be preserved outside the mbox. By the time fetchmail gets the message, that Status header is already gone; it has been translated into IMAP flags, which you're basically ignoring when you tell fetchmail to fetchall. If I'm correct, what you're asking for is basically for fetchmail to look at those IMAP flags and translate them back into a Status header to be added to the mail. I'm not sure that's a feature very likely to make it into fetchmail. -- ==============================| "A microscope locked in on one point Rob Funk <rf...@fu...> |Never sees what kind of room that it's in" http://www.funknet.net/rfunk | -- Chris Mars, "Stuck in Rewind" |