aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xfetchmailconf7
1 files changed, 7 insertions, 0 deletions
diff --git a/fetchmailconf b/fetchmailconf
index 51f64829..6b7f0cd4 100755
--- a/fetchmailconf
+++ b/fetchmailconf
@@ -167,6 +167,13 @@ class Server:
class User:
def __init__(self):
+ if os.environ.has_key("USER"):
+ self.remote = os.environ["USER"] # Remote username
+ elif os.environ.has_key("LOGNAME"):
+ self.remote = os.environ["LOGNAME"]
+ else:
+ print "Can't get your username!"
+ sys.exit(1)
self.remote = os.environ["USER"]# Remote username
self.localnames = [self.remote,]# Local names
self.password = None # Password for mail account access