Re: [PATCH] Add git-imap-send.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Mike McCormack <mike@xxxxxxxxxxxxxxx> writes:

> This probably needs a bit more work, but I'll solicit comments and
> flames anyway...

OK, then please work a bit more ;-)

I kind of like this approach and even wish my e-mail workflow
involved an imap server with draft folders.  Currently I do
everything in Gnus and my drafts are on local disk.

> The target IMAP folder:
>
> [imap]
>         Folder = "INBOX.Drafts"
>
> A command to open an ssh tunnel to the imap mail server.

The .git/config file is a good choice for storing this
information, because you might even use different draft folders
for different projects, i.e. the configuration is
per-repository.

> [imap]
>         Tunnel = "ssh -q user@xxxxxxxxxxxxxxx /usr/bin/imapd ./Maildir
> 2> /dev/null"
> [imap]
> 	Host = imap.server.com
> 	User = bob
> 	Password = pwd
> 	Port = 143

These I am not so sure.  It _might_ make sense to have something
like this under $HOME/.  Isn't there an established convention
for storing something like this for existing MUAs?

> + *  This program is free software; you can redistribute it and/or modify
> + *  it under the terms of the GNU General Public License as published by
> + *  the Free Software Foundation; either version 2 of the License, or
> + *  (at your option) any later version.
> + *...
> + * As a special exception, mbsync may be linked with the OpenSSL library,
> + * despite that library's more restrictive license.

Hmmm.  

> +#include <sys/types.h>
>...
> +#include <pwd.h>
> +
> +#include "cache.h"

If you are including "cache.h", you probably do not need to
include many of the standard include files.

> +#define as(ar) (sizeof(ar)/sizeof(ar[0]))

We have something like this in apply.c, exec_cmd.c and git.c;
probably we would want a macro in "cache.h".

	git.c:326:#define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0]))

> +static int
> +git_imap_config(const char *key, const char *val)
> +{
>...
> +	if (!strcasecmp( "Folder", key )) {

git_config calls you after downcasing the keys, so you do not
need to do strcasecmp.  Just spell things out in lowercase.

> +		if (!memcmp( "imaps:", val, 6 )) {
> +			if (!memcmp( "imap:", val, 5 ))

Is val always longer than 5 or 6 bytes here?

-
: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]