Ubuntu Server, postfix, gmail relay

Discussion in 'Server Operation' started by sjau, Nov 2, 2008.

  1. sjau

    sjau Local Meanie Moderator

    Hi there

    I setup a small server and I want to have send the output of crons to my email. Problem is, that I'm on a dynamic IP and best is to relay the email through my ISP. However my ISP doesn't provide email anymore, instead they just use Gmail.

    So I thought I could relay it through Gmail.

    I found this thread here http://www.howtoforge.com/forums/showthread.php?p=105989 and added topdog's suggestions.

    However I get this when I try to send a mail from mailx:

    Code:
    Nov  2 09:41:23 server postfix/pickup[24156]: A40258EC0ED: uid=0 from=<root>
    Nov  2 09:41:23 server postfix/cleanup[24351]: A40258EC0ED: message-id=<[email protected]>
    Nov  2 09:41:23 server postfix/qmgr[24158]: A40258EC0ED: from=<[email protected]>, size=344, nrcpt=1 (queue active)
    Nov  2 09:41:23 server postfix/smtp[24343]: certificate verification failed for smtp.gmail.com[72.14.221.111]:587: untrusted issuer /C=ZA/ST=Western Cape/L=Cape Town/O=Thawte Consulting cc/OU=Certification Services Division/CN=Thawte Premium Server CA/[email protected]
    Nov  2 09:41:23 server postfix/smtp[24343]: warning: SASL authentication failure: No worthy mechs found
    Nov  2 09:41:23 server postfix/smtp[24343]: A40258EC0ED: SASL authentication failed; cannot authenticate to server smtp.gmail.com[72.14.221.111]: no mechanismavailable
    Nov  2 09:41:23 server postfix/smtp[24343]: certificate verification failed for smtp.gmail.com[72.14.221.109]:587: untrusted issuer /C=ZA/ST=Western Cape/L=Cape Town/O=Thawte Consulting cc/OU=Certification Services Division/CN=Thawte Premium Server CA/[email protected]
    Nov  2 09:41:24 server postfix/smtp[24343]: warning: SASL authentication failure: No worthy mechs found
    Nov  2 09:41:24 server postfix/smtp[24343]: A40258EC0ED: to=<[email protected]>, relay=smtp.gmail.com[72.14.221.109]:587, delay=0.37, delays=0.06/0/0.32/0, dsn=4.7.0, status=deferred (SASL authentication failed; cannot authenticate to server smtp.gmail.com[72.14.221.109]: no mechanism available)
    
    I read here (http://prantran.blogspot.com/2007/01/getting-postfix-to-work-on-ubuntu-with.html) , that I need to add the Thawte Certs to cacert.pem
    Code:
    cat /etc/ssl/certs/Thawte_Premium_Server_CA.pem >> cacert.pem
    
    When I did that, I get this output in the mail.log:

    Code:
    Nov  2 09:34:23 server postfix/pickup[23917]: B78628EC0EB: uid=0 from=<root>
    Nov  2 09:34:23 server postfix/cleanup[24061]: B78628EC0EB: message-id=<[email protected]>
    Nov  2 09:34:23 server postfix/qmgr[23919]: B78628EC0EB: from=<[email protected]>, size=317, nrcpt=1 (queue active)
    Nov  2 09:34:23 server postfix/smtp[24063]: certificate verification failed for smtp.gmail.com[72.14.221.111]:587: untrusted issuer /C=ZA/ST=Western Cape/L=Cape Town/O=Thawte Consulting cc/OU=Certification Services Division/CN=Thawte Premium Server CA/[email protected]
    Nov  2 09:34:23 server postfix/smtp[24063]: warning: SASL authentication failure: No worthy mechs found
    Nov  2 09:34:23 server postfix/smtp[24063]: B78628EC0EB: SASL authentication failed; cannot authenticate to server smtp.gmail.com[72.14.221.111]: no mechanismavailable
    Nov  2 09:34:24 server postfix/smtp[24063]: certificate verification failed for smtp.gmail.com[72.14.221.109]:587: untrusted issuer /C=ZA/ST=Western Cape/L=Cape Town/O=Thawte Consulting cc/OU=Certification Services Division/CN=Thawte Premium Server CA/[email protected]
    Nov  2 09:34:24 server postfix/smtp[24063]: warning: SASL authentication failure: No worthy mechs found
    Nov  2 09:34:24 server postfix/smtp[24063]: B78628EC0EB: to=<[email protected]>, relay=smtp.gmail.com[72.14.221.109]:587, delay=0.38, delays=0.04/0.02/0.32/0, dsn=4.7.0, status=deferred (SASL authentication failed; cannot authenticate to server smtp.gmail.com[72.14.221.109]: no mechanism available)
    
    Here's the output of saslfinger -c
    Code:
    saslfinger - postfix Cyrus sasl configuration Sun Nov  2 09:35:56 CET 2008
    version: 1.0.4
    mode: client-side SMTP AUTH
    
    -- basics --
    Postfix: 2.5.5
    System: Ubuntu 8.10 \n \l
    
    -- smtp is linked to --
            libsasl2.so.2 => /usr/lib/libsasl2.so.2 (0xb7e3c000)
    
    -- active SMTP AUTH and TLS parameters for smtp --
    relayhost = [smtp.gmail.com]:587
    smtp_sasl_auth_enable = yes
    smtp_sasl_password_maps = hash:/etc/postfix/gmail_passwd
    smtp_sasl_type = cyrus
    smtp_tls_note_starttls_offer = yes
    smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
    smtp_use_tls = yes
    
    -- listing of /usr/lib/sasl2 --
    total 740
    drwxr-xr-x  2 root root  4096 2008-11-01 11:12 .
    drwxr-xr-x 44 root root 12288 2008-11-02 09:01 ..
    -rw-r--r--  1 root root 13860 2008-10-10 16:40 libanonymous.a
    -rw-r--r--  1 root root   988 2008-10-10 16:39 libanonymous.la
    -rw-r--r--  1 root root 13752 2008-10-10 16:40 libanonymous.so
    -rw-r--r--  1 root root 13752 2008-10-10 16:40 libanonymous.so.2
    -rw-r--r--  1 root root 13752 2008-10-10 16:40 libanonymous.so.2.0.22
    -rw-r--r--  1 root root 16382 2008-10-10 16:40 libcrammd5.a
    -rw-r--r--  1 root root   974 2008-10-10 16:39 libcrammd5.la
    -rw-r--r--  1 root root 17848 2008-10-10 16:40 libcrammd5.so
    -rw-r--r--  1 root root 17848 2008-10-10 16:40 libcrammd5.so.2
    -rw-r--r--  1 root root 17848 2008-10-10 16:40 libcrammd5.so.2.0.22
    -rw-r--r--  1 root root 47752 2008-10-10 16:40 libdigestmd5.a
    -rw-r--r--  1 root root   997 2008-10-10 16:39 libdigestmd5.la
    -rw-r--r--  1 root root 46828 2008-10-10 16:40 libdigestmd5.so
    -rw-r--r--  1 root root 46828 2008-10-10 16:40 libdigestmd5.so.2
    -rw-r--r--  1 root root 46828 2008-10-10 16:40 libdigestmd5.so.2.0.22
    -rw-r--r--  1 root root 13902 2008-10-10 16:40 liblogin.a
    -rw-r--r--  1 root root   968 2008-10-10 16:39 liblogin.la
    -rw-r--r--  1 root root 13748 2008-10-10 16:40 liblogin.so
    -rw-r--r--  1 root root 13748 2008-10-10 16:40 liblogin.so.2
    -rw-r--r--  1 root root 13748 2008-10-10 16:40 liblogin.so.2.0.22
    -rw-r--r--  1 root root 30316 2008-10-10 16:40 libntlm.a
    -rw-r--r--  1 root root   962 2008-10-10 16:39 libntlm.la
    -rw-r--r--  1 root root 30196 2008-10-10 16:40 libntlm.so
    -rw-r--r--  1 root root 30196 2008-10-10 16:40 libntlm.so.2
    -rw-r--r--  1 root root 30196 2008-10-10 16:40 libntlm.so.2.0.22
    -rw-r--r--  1 root root 14222 2008-10-10 16:40 libplain.a
    -rw-r--r--  1 root root   968 2008-10-10 16:39 libplain.la
    -rw-r--r--  1 root root 17844 2008-10-10 16:40 libplain.so
    -rw-r--r--  1 root root 17844 2008-10-10 16:40 libplain.so.2
    -rw-r--r--  1 root root 17844 2008-10-10 16:40 libplain.so.2.0.22
    -rw-r--r--  1 root root 22394 2008-10-10 16:40 libsasldb.a
    -rw-r--r--  1 root root   999 2008-10-10 16:39 libsasldb.la
    -rw-r--r--  1 root root 21804 2008-10-10 16:40 libsasldb.so
    -rw-r--r--  1 root root 21804 2008-10-10 16:40 libsasldb.so.2
    -rw-r--r--  1 root root 21804 2008-10-10 16:40 libsasldb.so.2.0.22
    
    -- listing of /etc/postfix/sasl --
    total 12
    drwxr-xr-x 2 root root 4096 2008-11-02 09:03 .
    drwxr-xr-x 4 root root 4096 2008-11-02 09:35 ..
    -rw-r--r-- 1 root root   49 2008-11-02 09:03 smtpd.conf
    
    
    -- permissions for /etc/postfix/gmail_passwd --
    -rw-r--r-- 1 root root 52 2008-11-02 09:10 /etc/postfix/gmail_passwd
    
    -- permissions for /etc/postfix/gmail_passwd.db --
    -rw-r--r-- 1 root root 12288 2008-11-02 09:10 /etc/postfix/gmail_passwd.db
    
    /etc/postfix/gmail_passwd.db is up to date.
    
    -- active services in /etc/postfix/master.cf --
    # service type  private unpriv  chroot  wakeup  maxproc command + args
    #               (yes)   (yes)   (yes)   (never) (100)
    smtp      inet  n       -       -       -       -       smtpd
    pickup    fifo  n       -       -       60      1       pickup
    cleanup   unix  n       -       -       -       0       cleanup
    qmgr      fifo  n       -       n       300     1       qmgr
    tlsmgr    unix  -       -       -       1000?   1       tlsmgr
    rewrite   unix  -       -       -       -       -       trivial-rewrite
    bounce    unix  -       -       -       -       0       bounce
    defer     unix  -       -       -       -       0       bounce
    trace     unix  -       -       -       -       0       bounce
    verify    unix  -       -       -       -       1       verify
    flush     unix  n       -       -       1000?   0       flush
    proxymap  unix  -       -       n       -       -       proxymap
    proxywrite unix -       -       n       -       1       proxymap
    smtp      unix  -       -       -       -       -       smtp
    relay     unix  -       -       -       -       -       smtp
            -o smtp_fallback_relay=
    showq     unix  n       -       -       -       -       showq
    error     unix  -       -       -       -       -       error
    retry     unix  -       -       -       -       -       error
    discard   unix  -       -       -       -       -       discard
    local     unix  -       n       n       -       -       local
    virtual   unix  -       n       n       -       -       virtual
    lmtp      unix  -       -       -       -       -       lmtp
    anvil     unix  -       -       -       -       1       anvil
    scache    unix  -       -       -       -       1       scache
    maildrop  unix  -       n       n       -       -       pipe
      flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${recipient}
    uucp      unix  -       n       n       -       -       pipe
      flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)
    ifmail    unix  -       n       n       -       -       pipe
      flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)
    bsmtp     unix  -       n       n       -       -       pipe
      flags=Fq. user=bsmtp argv=/usr/lib/bsmtp/bsmtp -t$nexthop -f$sender $recipient
    scalemail-backend unix  -       n       n       -       2       pipe
      flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store ${nexthop} ${user} ${extension}
    mailman   unix  -       n       n       -       -       pipe
      flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py
      ${nexthop} ${user}
    
    -- mechanisms on [smtp.gmail.com]:587 --
    
    
    -- end of saslfinger output --
    
     
    Last edited: Nov 11, 2008
  2. falko

    falko Super Moderator ISPConfig Developer

    Not sure what's happening, but I see that you have a GMX account. You can use GMX for relaying emails instead of GMail.
     
  3. sjau

    sjau Local Meanie Moderator

    I solved it meanwhile BUT only gmail will accept the email - no other server :(

    Looking now at "esmtp" which seems to work fine but I can't figure out how to define a subject there...
     
  4. building39

    building39 New Member

    Nice to hear that you solved the problem. Could you please share with us how you resolved it?

    Thanks!
     

Share This Page