~sbeattie/ubuntu/oneiric/dovecot/dovecot-lp792557

« back to all changes in this revision

Viewing changes to src/util/imap-utf7.c

  • Committer: Bazaar Package Importer
  • Author(s): Chuck Short
  • Date: 2011-05-16 10:18:41 UTC
  • mfrom: (4.1.20 sid)
  • Revision ID: james.westby@ubuntu.com-20110516101841-wo4hf1ewxssic6xj
Tags: 1:2.0.12-1ubuntu1
* Merge from Debian Unstable, remaining changes are:
  + Add mail-stack-delivery as per server-maverick-mail-integration spec:
    - Update debian/rules
    - Convert existing package to a dummy package and new binary in debian/control.
    - Update maintainer scripts.
    - Move previously installed backups and config files to a new package namespace in preinst.
    - Add new debian/mail-stack-delivery.prerm to handle downgrades.
    - Rename debian/dovecot-postfix.* to debian/mail-stack-delivery.*
  + Use Snakeoil SSL certifications by default:
    - debian/control: Depend on ssl-cert.
    - debian/dovecot-common.postinst: Relax grep for SSL_* a bit.
  + Add autopkgtest to debian/tests/*.
  + Add ufw integration:
    - Create debian/dovecot-common.ufw.profile.
    - debian/rules: install profile
    - debian/control: suggest ufw.
  + debian/{control,rules}: enable PIE hardening.
  + debian/dovecot-common.dirs: Added usr/share/doc/dovecot-common
  + Add apport hook:
    - debian/rules, debian/source_dovecot.py
  + Add upstart job:
    - debian/rules, debian/dovecot-common.dovecot.upstart, debian/control,
      debian/dovecot-common.dirs, dovecot-imapd.{postrm, postinst, prerm},
      debian/dovecot-pop3d.{postinst, postrm, prerm}. mail-stack-deliver.postinst:
      Convert init script to upstart. Apart of the server-maverick-upstart-conversion
      specification.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Copyright (c) 2008-2010 Dovecot authors, see the included COPYING file */
2
 
 
3
 
#include "lib.h"
4
 
#include "str.h"
5
 
#include "imap-utf7.h"
6
 
 
7
 
#include <stdio.h>
8
 
 
9
 
int main(int argc ATTR_UNUSED, const char *argv[])
10
 
{
11
 
        string_t *dest;
12
 
        bool reverse = FALSE;
13
 
        int ret;
14
 
 
15
 
        lib_init();
16
 
 
17
 
        if (argv[1] != NULL && strcmp(argv[1], "-r") == 0) {
18
 
                reverse = TRUE;
19
 
                argv++;
20
 
        }
21
 
 
22
 
        if (argv[1] == NULL) {
23
 
                fprintf(stderr, "Usage: %s [-r] <string>\n", argv[0]);
24
 
                return 1;
25
 
        }
26
 
 
27
 
        dest = t_str_new(256);
28
 
        ret = reverse ?
29
 
                imap_utf8_to_utf7(argv[1], dest) :
30
 
                imap_utf7_to_utf8(argv[1], dest);
31
 
        if (ret < 0) {
32
 
                fprintf(stderr, "Invalid input\n");
33
 
                return 1;
34
 
        }
35
 
        printf("%s\n", str_c(dest));
36
 
        return 0;
37
 
}