"Fossies" - the Fresh Open Source Software Archive

Member "msmtp-1.8.5/src/password.h" (11 Jan 2019, 1577 Bytes) of package /linux/privat/msmtp-1.8.5.tar.xz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "password.h" see the Fossies "Dox" file reference documentation.

    1 /*
    2  * password.h
    3  *
    4  * This file is part of msmtp, an SMTP client, and of mpop, a POP3 client.
    5  *
    6  * Copyright (C) 2019  Martin Lambers <marlam@marlam.de>
    7  *
    8  *   This program is free software; you can redistribute it and/or modify
    9  *   it under the terms of the GNU General Public License as published by
   10  *   the Free Software Foundation; either version 3 of the License, or
   11  *   (at your option) any later version.
   12  *
   13  *   This program is distributed in the hope that it will be useful,
   14  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
   15  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   16  *   GNU General Public License for more details.
   17  *
   18  *   You should have received a copy of the GNU General Public License
   19  *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
   20  */
   21 
   22 #ifndef PASSWORD_H
   23 #define PASSWORD_H
   24 
   25 typedef enum {
   26     password_service_smtp,
   27     password_service_pop3
   28 } password_service_t;
   29 
   30 /*
   31  * password_get()
   32  *
   33  * This function tries to get a password for service::user@hostname.
   34  * It tries to get it from the system's keychain (if available).
   35  * If that fails, it tries to read a password from .netrc.
   36  * If that fails, it tries to read a password from via getpass().
   37  * If getpass_only_via_tty is set, then getpass() will only be called
   38  * if it reads from /dev/tty instead of stdin.
   39  * This function returns NULL on failure or the password in an allocated
   40  * buffer.
   41  */
   42 char *password_get(const char *hostname, const char *user,
   43         password_service_t service, int getpass_only_via_tty);
   44 
   45 #endif