Postfix + Dovecot + IMAP SSL: imap-login: Aborted login

118

In /etc/postfix/master.cf add:

dovecot   unix  -       n       n       -       -       pipe
  flags=DROhu user=vmail:vmail argv=/usr/lib/dovecot/deliver -f ${sender} -d ${user}@${nexthop}

In /etc/postfix main.cf add:

dovecot_destination_recipient_limit = 1
virtual_mailbox_domains = your.domain.here
virtual_transport = dovecot 

This assume the user vmail is the owner of /home/virtual, adjust as necessary.

If after confirming you have this configuration in postfix you still have trouble, post you full postfix (feel free to sanitize domain info to examplt.com etc) and dovecot configuration files.

Share:
118

Related videos on Youtube

Charlie Hershberger
Author by

Charlie Hershberger

Updated on September 18, 2022

Comments

  • Charlie Hershberger
    Charlie Hershberger over 1 year

    Convert from channel to channel of type that implements interface in GO

    I am working on a problem that requires me to write a Go utility that can take a Go channel with a type that implements an interface and write to it. Right now if I know the type of the Go channel I can perform the writes to the channel without a problem. I make a new item of the appropriate type and send it on the channel.

    The problem occurs when I try to generalize this to any channel that implements the interface needed to make the new item. If I can make a converter that converts from my internal type "logFile" to the given channel's type using the interface "hasLog" to "SetLog" ensuring the internal field "Log" of the logFile and the struct that is passed on the channel are identical, this problem would be solved. However, since I cannot convert between a channel logFile and a channel any, or a channel hasLog, I can't make and send to the channel that is passed in even after the new item is created to be sent. Since the channel sent is not a channel logFile, or a channel hasLog, but instead a channel of type that implements hasLog, we can't do the conversion.

    currently it works something like what is below.

    type hasLog interface {
        setLog([]*string)
        getLog() []*string
    }
    
    // logFile this is a struct we use to send the log information.
    // this is used for channeling support.
    type logFile struct {
        Log []*string `json:",omitempty"`
    }
    
    // getLog this returns the log as sent by the logFile.
    // this is used for channeling support.
    func (r logFile) GetLog() []*string {
        return r.Log
    }
    
    // setLog this will set the log of the logFile.
    // this is used for channeling support.
    func (r logFile) SetLog(log []*string) {
        r.Log = make([]*string, 3)
        r.Log[0] = log[0]
        r.Log[1] = log[1]
        r.Log[2] = log[2]
    }
    
    func sendChannelInfo(r logFile) {
        if hasChannel() {
            logChannelMutex.Lock()
            defer logChannelMutex.Unlock()
            logChannel[getGID()] <- r
        }
    }
    
    // logSingle logs a formatted message sent to the appropriate place
    func logSingle(level Level, message string, values ...interface{}) {
        
        var r logFile
        r.Log = make([]*string, 3)
        var logs = make([]*string, 3)
    
    //generate the logs
    
        r.SetLog(logs)
    
        sendChannelInfo(r)
    
    }
    
    // SetChannel lets us set up a pipe between a channel that receives our channeled messages and our logger.
    func SetChannel(receiver interface{}) {
        GID := getGID()
        sender := ChannelHandle(receiver)
        if receiver != nil {
            logChannel[GID] = sender
            return
        }
    }
    
    func ChannelHandle(receiver interface{}) chan logFile {
        sender := make(chan logFile)
        go convertChannel(sender, receiver)
        return sender
    }
    
    func convertChannel[T any](sender <-chan logFile, receiver chan T) {
        for {
            item := <-sender
            channelType := reflect.ValueOf(receiver).Type().Elem()
            var new = reflect.New(channelType).Elem().Interface()
            log := item.GetLog()
            println(len(log))
            input := make([]reflect.Value, 1)
            input[0] = reflect.ValueOf(log)
            reflect.ValueOf(new).MethodByName("SetLog").Call(input)
            receiver <- new
        }
    }
    

    Is there a way to send to the channel provided by "SetChannel" by converting my internal type to the arbitrary other type so long as data structure implements "hasLog"?

  • user3484001
    user3484001 over 8 years
    Hi Aaron, Thanks for your answer. I added modifications to '/etc/postfix/master.cf' and '/etc/postfix main.cf', but still same "imap-login: Aborted login" error. My Postfix and Dovecot config files are here uploaded Other '/etc/postfix/vhosts', '/etc/postfix/vmaps', '/etc/dovecot/users', '/etc/dovecot/passwd' are identical to tutorial I posted earlier (just with my details of course). Thanks again
  • Aaron Tate
    Aaron Tate over 8 years
    In that log line with Aborted login, is the rip=xxx.xxx.xxx.xxx the ip of the local machine?
  • user3484001
    user3484001 over 8 years
    rip IP is of email client host, not of web-server.
  • Aaron Tate
    Aaron Tate over 8 years
    I dont think the error you posted really has anything to do with email delivery to your mailboxes and more related to an imap connection and authentication attempt, can you send a test message then grab and post the last 50 lines of your info/warn/error logs (usually mail.log and mail.err on recent debian based systems)
  • user3484001
    user3484001 over 8 years
    Indeed is linked with authentication. Sending test message from gmail to server now shows under '/home/vmail/domain/user/new', after opening port 25. Connecting via telnet port 143 or 'openssl s_client -connect' on port 993 both work, but not login process (wiki2.dovecot.org/TestInstallation). I moved all user data content to 1 file '/etc/dovecot/passwd', following format at wiki2.dovecot.org/AuthDatabase/PasswdFile. passwd file format is "user@domain:{CRAM-MD5}xxxx:5000:5000::/home/vmail/domain/us‌​er/:/bin/false::". Having problems understanding how Dovecot processes login.
  • user3484001
    user3484001 over 8 years
    All fixed now. My fault of not taking into account that I was using Virtual Users with Dovecot. Thanks again for your guidance