15

I have + and = characters in my gmail password. How can I configure ssmtp to avoid authorization error?

My /etc/ssmtp/ssmtp.conf:

[email protected]
mailhub=smtp.gmail.com:465
rewriteDomain=gmail.com
AuthUser=username
AuthPass=1234+=5678
FromLineOverride=YES
UseTLS=YES
hostname=skynet

How do I run ssmtp:

$ echo "email content" | mail -s "email subject" [email protected]
send-mail: Authorization failed (535 5.7.1
http://support.google.com/mail/bin/answer.py?answer=14257
hz16sm4385885lab.6)
4
  • 1
    What program does the error occur in? Please give us some context. Brevity is good, but this is little to work on. Jun 1, 2012 at 17:54
  • I've attach some more information to the question. Jun 1, 2012 at 19:45
  • Did you try single quotes, that should work for you Jun 26, 2016 at 16:56
  • The bug is at github.com/ajwans/sSMTP/blob/master/ssmtp.c#L913, I remember I submitted a patch back in 2010...nobody cares. I guess it is a feature, rather than a bug!
    – David S.
    Sep 17, 2018 at 3:24

4 Answers 4

8

There are still a number of outstanding bugs dealing with special characters on the AuthPass line in the /etc/ssmtp/ssmtp.conf file:

https://bugs.debian.org/cgi-bin/pkgreport.cgi?repeatmerged=no&src=ssmtp#_0_3_4

These bug reports are specifically for the ssmtp page in Debian, but probably apply to others.

  • Debian Bug report logs - #463196: ssmtp cannot parse AuthPass with '=' or ':' in it
  • Debian Bug report logs - #768129: ssmtp: Same problem here with "#"

According to these report logs, lines containing the characters =, :, or # are either skipped entirely, or processed in a way that removes the part of password on the right-hand side these characters.

In other words, there is currently no way to "escape" these special characters on the AuthPass line.


As a side note, there are a number of devices, such as wireless home printers, that require passwords to be entered on a number pad, similar to those used on telephones. Some special characters are available on these devices, but many cannot be selected.

For situations like this, you are (unfortunately) forced to adjust your password for the device.

A longer password consisting of letters & numbers is preferred to a shorter one with more punctuation characters.


This question has also been asked and answered very well on the following page:

What characters are illegal in password in ssmtp.conf?

1
  • 1
    The maintainers should consider treating the config file entry as Urlencoded like in some other packages.
    – Old Geezer
    Jun 13, 2019 at 9:05
1

You can use the following workaround:

feed the password directly in the command line argument

ssmtp -ap "Hash#Password" ...

alternatively put the password in an environment variable.

ssmtp -ap $PASSWD ...

Hope it helped.

-1

The answer highly depends on the context in which you are entering or submitting the password. In some formats, you can surround your password in ""'s, in others you would need to escape the offending characters. This escape character, differs between programs, shells, Operating systems, etc. In Windows batch scripts the escape is ^ while in certain Linux or terminal situations, the escape is \.

2
  • 1
    I tryed to store my password in 1234\+\=5678 form, but got the same error. Jun 1, 2012 at 19:47
  • 1
    The context is the ssmtp package, not SMTP in general. Dec 15, 2016 at 23:49
-1

Try escaping the second equals sign:

AuthPass=1234+\=5678

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .