I am using postfix and need to send the mail using google apps smtp.  I am getting errors after I thought I had set everything up correctly:  May 11 09:50:57 zedsaid postfix/error[22214]: 00E009693FB: to=&lt;www-data@zedsaid.com&gt;, relay=none, delay=2466, delays=2462/3.4/0/0.06, dsn=4.7.0, status=deferred (delivery temporarily suspended: SASL authentication failed; cannot authenticate to server smtp.gmail.com[74.125.155.109]: no mechanism available) May 11 09:50:57 zedsaid postfix/error[22213]: 0ACB36D1B94: to=&lt;www-data@zedsaid.com&gt;, relay=none, delay=2486, delays=2482/3.4/0/0.06, dsn=4.7.0, status=deferred (delivery temporarily suspended: SASL authentication failed; cannot authenticate to server smtp.gmail.com[74.125.155.109]: no mechanism available) May 11 09:50:57 zedsaid postfix/error[22232]: 067379693D3: to=&lt;www-data@zedsaid.com&gt;, relay=none, delay=2421, delays=2417/3.4/0/0.06, dsn=4.7.0, status=deferred (delivery temporarily suspended: SASL authentication failed; cannot authenticate to server smtp.gmail.com[74.125.155.109]: no mechanism available)   main.cf:  # Debian specific:  Specifying a file name will cause the first # line of that file to be used as the name.  The Debian default # is /etc/mailname. #myorigin = /etc/mailname  smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU) biff = no  # appending .domain is the MUA's job. append_dot_mydomain = no  # Uncomment the next line to generate "delayed mail" warnings #delay_warning_time = 4h  readme_directory = no  # TLS parameters #smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem #smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key smtpd_use_tls=yes smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache  # See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for # information on enabling SSL in the smtp client.  myhostname = zedsaid.com alias_maps = hash:/etc/aliases alias_database = hash:/etc/aliases myorigin = /etc/mailname mydestination = #relayhost = mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 mailbox_command = procmail -a "$EXTENSION" mailbox_size_limit = 0 recipient_delimiter = + inet_interfaces = all delay_warning_time = 4h smtpd_recipient_limit = 16 # how many error before back off. smtpd_soft_error_limit = 3 # how many max errors before blocking it. smtpd_hard_error_limit = 12  ## Gmail Relay relayhost = [smtp.gmail.com]:587  smtp_use_tls = yes smtp_sasl_auth_enable = yes smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd smtp_sasl_security_options = noanonymous smtp_sasl_tls_security_options = noanonymous smtp_sasl_mechanism_filter = login smtp_tls_eccert_file = smtp_tls_eckey_file = smtp_use_tls = yes smtp_enforce_tls = no smtp_tls_CAfile = /etc/postfix/cacert.pem smtpd_tls_received_header = yes tls_random_source = dev:/dev/urandom  transport_maps = hash:/etc/postfix/transport debug_peer_list = smtp.gmail.com debug_peer_level = 3   What am I doing wrong?
120729
I've been trying to configure email to forward to Gmail, using Postfix to relay email to smtp.gmail.com. However, I'm failing to get it to authenticate with smtp.gmail.com, which is a rather vital prerequisite to getting anything working…  The mail logs show only:  Oct 29 15:50:14 gsnedders-1 postfix/master[6596]: daemon started -- version 2.7.1, configuration /etc/postfix Oct 29 15:50:19 gsnedders-1 postfix/pickup[6598]: EBA1F78750: uid=1000 from=&lt;gsnedders&gt; Oct 29 15:50:19 gsnedders-1 postfix/cleanup[6603]: EBA1F78750: message-id=&lt;20111029145019.EBA1F78750@mail.gsnedders.com&gt; Oct 29 15:50:19 gsnedders-1 postfix/qmgr[6599]: EBA1F78750: from=&lt;gsnedders@gsnedders.com&gt;, size=324, nrcpt=1 (queue active) Oct 29 15:50:19 gsnedders-1 postfix/cleanup[6603]: F2D557874F: message-id=&lt;20111029145019.EBA1F78750@mail.gsnedders.com&gt; Oct 29 15:50:19 gsnedders-1 postfix/local[6605]: EBA1F78750: to=&lt;me@gsnedders.com&gt;, orig_to=&lt;me&gt;, relay=local, delay=0.04, delays=0.03/0.02/0/0, dsn=2.0.0, status=sent (forwarded as F2D557874F) Oct 29 15:50:19 gsnedders-1 postfix/qmgr[6599]: F2D557874F: from=&lt;gsnedders@gsnedders.com&gt;, size=454, nrcpt=1 (queue active) Oct 29 15:50:19 gsnedders-1 postfix/qmgr[6599]: EBA1F78750: removed Oct 29 15:50:20 gsnedders-1 postfix/smtp[6606]: warning: SASL authentication failure: No worthy mechs found Oct 29 15:50:20 gsnedders-1 postfix/smtp[6606]: F2D557874F: SASL authentication failed; cannot authenticate to server smtp.gmail.com[74.125.157.108]: no mechanism available   And the postfix config is:  relayhost = [smtp.gmail.com]:587  smtp_use_tls = yes smtp_sasl_auth_enable = yes smtp_sasl_password_maps = hash:/etc/postfix/sasl/passwd smtp_sasl_security_options = noanonymous  smtp_tls_eccert_file = smtp_tls_eckey_file = smtp_tls_security_level = may smtp_tls_CAfile = /etc/postfix/cacert.pem smtpd_tls_received_header = yes tls_random_source = dev:/dev/urandom smtpd_tls_security_level = may
55138
mail -s "subject" xxxxx@gmail.com &lt;test.html works, but only for plain text email.  What is the correct way to send HTML email using the Linux command mail?
123595
I have a following setup:   linux box with postfix configured to be responsible for example.com domain domain's MX servers are configured so that mail sent to example.com is sent to google mail servers several user accounts on linux machine exist (same machine also hosts example.com site)   When someone from the outside attempts to send mail to address ending with @example.com, it gets routed to google mail (and there handled appropriately).  When linux machine tries to send mail to outside world, mail is delivered correctly, as reverse dns and spf records are configured correctly, so linux machine is valid mail sender for example.com domain (along with google mail servers).  However, here's the problem. When php application (hosted at linux box) tries to send mail to someuser@example.com (and someuser doesn't exist on linux box), it fails, since it doesn't even consult google mail servers, but postfix smtp locally concludes that "someuser" is unknown.  So, the question is: how do I tell postfix to relay mails sent to @example.com domain to google mail servers (so, to servers specified in MX records), IF and only if a mailbox is not found locally.
44067
I was wondering why using foo.bar@gmail.com works but not foo.bar@outlook.com.  In Gmail, foo.bar@gmail.com and foobar@gmail.com (and any combination of periods in the username) is equivalent.  Is this a hidden feature in Gmail?
50181
I've installed Postfix on Ubuntu 14.04 with the defaults. I then configured some virtual aliases to forward email from a few addresses to various personal (mostly Gmail) accounts. This is just to make these addresses all connect cosmetically to the domain on the website we are hosting.   Unfortunately, in a short amount of time Gmail has started rate blocking the forwarded emails due to spam. Apparently, Postfix is rewriting the headers in a way that makes Gmail think all the spam is originating with our server. Google  for information on how to best forward to them.  In it, they say:     We recommend that you do not change the envelope sender when   forwarding email to Gmail. Sometimes, when forwarding email, the   envelope sender gets changed to your domain. When this happens, Gmail   may learn that your domain is sending spam, and will treat other   emails from this domain as spam as well.   This make sense, but it would still seem that Gmail would have to see the IP and hostname of our mail server and register it as a source of spam. But this is what they say and I've found nothing on point anywhere.   I even tried using Mailgun to filter the forwards as they provide spam blocking, but within a day they deactivated the domain and are being rather slow to respond to my inquiries. Any help is appreciated. I would like to avoid a full fledged mail server setup just to handle a few rarely used forwards.  Update: My original assumption was incorrect in that Postfix is not rewriting the headers, however the original issue remains. Gmail is rate limiting forwards due to excessive spam. It would be understandable if they limited the servers that are actually sending the email, and these are listed in the headers as part of the delivery chain.
96065
Running this script on: "Red Had Enterprise Linux Server release 5.11 (Tikanga)"  Mail is: version 8.1 6/6/93 (appears quite old).  Have tried various things and cannot seem to get this to work..  echo "Email message" | mail -a /home/user/checks/notprocessed.txt -a /home/user/checks/dirlist.txt -s "Subject" recipient@company.com /home/user/checks   Resulting message:     mail: invalid option -- a   mutt is not installed and I have limited access to this system as it is owned by the company I work for.  I could add in other components, but has to go through change management, and related processes.  uuencode is not available either.  Here is what I am using today and I am trying to add a second file to:  if grep 'Not Empty' /home/user/checks/notprocessed.txt    then    echo "files were found";     SUBJECT="NIGHTLY DIRECTORY LISTING OF FILES SENT TO VENDOR";    FROM="SENDER&lt;sender@company.com&gt;"    # EMAIL="JOHN DOE&lt;recipient@company.com&gt;"    EMAIL="MARY DOE&lt;recipient@company.com&gt;";    /bin/mail -s "$SUBJECT" "$EMAIL" -- -f "$FROM" &lt; /home/user/checks/notprocessed.txt /home/user/checks/dirlist.txt     exit -20 fi   And..  /home/user/checks/dirlist.txt is not attached or included as part of the e-mail.  I would like /home/user/checks/dirlist.txt to be actually an attachment  This actually does work - but includes the notprocessed.txt as the body of the email..  if grep 'Not Empty' /home/user/checks/notprocessed.txt    then    echo "files were found";     SUBJECT="NIGHTLY DIRECTORY LISTING OF FILES SENT TO VENDOR";    FROM="SENDER&lt;sender@company.com&gt;"    # EMAIL="JOHN DOE&lt;recipient@company.com&gt;"    EMAIL="MARY DOE&lt;recipient@company.com&gt;";    /bin/mail -s "$SUBJECT" "$EMAIL" -- -f "$FROM" &lt; /home/user/checks/notprocessed.txt     exit -20 fi
59944
I used the  tutorial below to setup postfix and dovecot on a Digital Ocean server. But I'm getting "Connection Timed out" when postfix/smtp tries to deliver an email to a remote host like gmail or yahoo..      RECEIVING A NEW MESSAGE /var/log/mail.log    Feb 2 22:33:38 localhost dovecot: auth-worker: Debug: Loading modules from directory: /usr/lib/dovecot/modules/auth  Feb 2 22:33:38 localhost dovecot: auth-worker: Debug: pam(app,189.63.49.XXX): lookup service=dovecot  Feb 2 22:33:38 localhost dovecot: auth-worker: Debug: pam(app,189.63.49.XXX): #1/1 style=1 msg=Password:   Feb 2 22:33:38 localhost dovecot: auth: Debug: client out: OK#0111#011user=app  Feb 2 22:33:40 localhost postfix/submission/smtpd[1045]: E9AA724264: client=unknown[189.63.49.XXX], sasl_method=PLAIN, sasl_username=app  Feb 2 22:33:43 localhost postfix/cleanup[1052]: E9AA724264: message-id=  Feb 2 22:33:43 localhost postfix/qmgr[32661]: E9AA724264: from=, size=485, nrcpt=1 (queue active)  Feb 2 22:33:45 localhost postfix/submission/smtpd[1045]: disconnect from unknown[189.63.49.XXX]  Feb 2 22:34:14 localhost postfix/smtp[1053]: connect to mta5.am0.yahoodns.net[98.136.216.25]:25: Connection timed out    Feb 2 22:24:21 localhost postfix/smtp[1013]: connect to mta6.am0.yahoodns.net[98.136.217.202]:25: Connection timed out  Feb 2 22:24:21 localhost postfix/smtp[1014]: connect to gmail-smtp-in.l.google.com[173.194.76.27]:25: Connection timed out  Feb 2 22:24:21 localhost postfix/smtp[1015]: connect to gmail-smtp-in.l.google.com[173.194.76.27]:25: Connection timed out  Feb 2 22:24:21 localhost postfix/smtp[1012]: connect to aspmx.l.google.com[173.194.68.27]:25: Connection timed out    Here is /etc/postfix/main.cf   /etc/postfix/master.cf   Result from #> netstat -nlptu
56632
I've got a Postfix mail server setup for hosting multiple virtual domains (say xxx.com and yyy.com).  Users configure their outgoing mail server as mail.xxx.com and mail.yyy.com. All mail servers refer to the same physical Postfix server (same IP, single instance of Postfix running on this Linux server).  Which SSL certificate do I need for Postfix smtpd_tls_cert_file configuration option?  Or do I have to use a single certificate for mail.xxx.com and tell users of yyy.com to use mail.xxx.com as their outgoing server? This would break the illusion of separate virtual servers.  [Note: the domains are completely separate. These are not multiple subdomains sharing a common root].
66533
I've start a new job today and I am trying to set up my machine to run through their Windows server.  I've managed to get a internet connection through the server now but now I can't run apt-get update as I get a "403 Forbidden" error.  This is for every repo under my source list, apart from translations(?).  I do have a proxy in apt.conf, if I don't have it I get a 407 Permission Denied error.  Here's my apt.conf file (I have omitted my username and password)  Acquire::http::proxy "http://username:password@192.168.0.2:8080/";   Here's my sources.list  #deb cdrom:[Ubuntu 12.04.2 LTS _Precise Pangolin_ - Release amd64 (20130213)]/ dists/precise/main/binary-i386/  #deb cdrom:[Ubuntu 12.04.2 LTS _Precise Pangolin_ - Release amd64 (20130213)]/ dists/precise/restricted/binary-i386/ #deb cdrom:[Ubuntu 12.04.2 LTS _Precise Pangolin_ - Release amd64 (20130213)]/ precise main restricted  # See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to # newer versions of the distribution. deb http://gb.archive.ubuntu.com/ubuntu/ precise main restricted deb-src http://gb.archive.ubuntu.com/ubuntu/ precise main restricted  ## Major bug fix updates produced after the final release of the ## distribution. deb http://gb.archive.ubuntu.com/ubuntu/ precise-updates main restricted deb-src http://gb.archive.ubuntu.com/ubuntu/ precise-updates main restricted  ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu ## team. Also, please note that software in universe WILL NOT receive any ## review or updates from the Ubuntu security team. deb http://gb.archive.ubuntu.com/ubuntu/ precise universe deb-src http://gb.archive.ubuntu.com/ubuntu/ precise universe deb http://gb.archive.ubuntu.com/ubuntu/ precise-updates universe deb-src http://gb.archive.ubuntu.com/ubuntu/ precise-updates universe  ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu  ## team, and may not be under a free licence. Please satisfy yourself as to  ## your rights to use the software. Also, please note that software in  ## multiverse WILL NOT receive any review or updates from the Ubuntu ## security team. deb http://gb.archive.ubuntu.com/ubuntu/ precise multiverse deb-src http://gb.archive.ubuntu.com/ubuntu/ precise multiverse deb http://gb.archive.ubuntu.com/ubuntu/ precise-updates multiverse deb-src http://gb.archive.ubuntu.com/ubuntu/ precise-updates multiverse  ## N.B. software from this repository may not have been tested as ## extensively as that contained in the main release, although it includes ## newer versions of some applications which may provide useful features. ## Also, please note that software in backports WILL NOT receive any review ## or updates from the Ubuntu security team. deb http://gb.archive.ubuntu.com/ubuntu/ precise-backports main restricted universe multiverse deb-src http://gb.archive.ubuntu.com/ubuntu/ precise-backports main restricted universe multiverse  deb http://security.ubuntu.com/ubuntu precise-security main restricted deb-src http://security.ubuntu.com/ubuntu precise-security main restricted deb http://security.ubuntu.com/ubuntu precise-security universe deb-src http://security.ubuntu.com/ubuntu precise-security universe deb http://security.ubuntu.com/ubuntu precise-security multiverse deb-src http://security.ubuntu.com/ubuntu precise-security multiverse  ## Uncomment the following two lines to add software from Canonical's ## 'partner' repository. ## This software is not part of Ubuntu, but is offered by Canonical and the ## respective vendors as a service to Ubuntu users. # deb http://archive.canonical.com/ubuntu precise partner # deb-src http://archive.canonical.com/ubuntu precise partner  ## This software is not part of Ubuntu, but is offered by third-party ## developers who want to ship their latest software. deb http://extras.ubuntu.com/ubuntu precise main deb-src http://extras.ubuntu.com/ubuntu precise main   I can sort-of fix this by changing all the http in sources.list to ftp but I still have issues with ppas
32218
Using postfix, I'd like all incoming mail, to any address (including those that don't map to local users) to be piped to a script.  I've tried configuring mailbox_command in /etc/postfix/main.cf:  mailbox_command = /path/to/myscript.py   This works great if the user is a local user, but it fails for "unknown" users who don't have aliases.  I tried setting luser_relay to a local user, but this pre-empts mailbox_command, and so the command doesn't get run.  I tried setting local_recipient_maps= (empty string), but the message is still bounced (unknown user).  Is there a magic invocation I can use to get all known and unknown users to go to the script as well?  Full /etc/postfix/main.cf follows -- it's the default Ubuntu 10.04, with the exception of the mailbox_command line:  # See /usr/share/postfix/main.cf.dist for a commented, more complete version   # Debian specific:  Specifying a file name will cause the first # line of that file to be used as the name.  The Debian default # is /etc/mailname. #myorigin = /etc/mailname  smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu) biff = no  # appending .domain is the MUA's job. append_dot_mydomain = no  # Uncomment the next line to generate "delayed mail" warnings #delay_warning_time = 4h  readme_directory = no  # TLS parameters smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key smtpd_use_tls=yes smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache  # See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for # information on enabling SSL in the smtp client.  myhostname = ... snip ... alias_maps = hash:/etc/aliases alias_database = hash:/etc/aliases mydestination = sassafras, ... snip ...,localhost.localdomain, localhost relayhost = mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 mailbox_size_limit = 0 recipient_delimiter = + inet_interfaces = all  mailbox_command = /path/to/my/script.py
122941
I have dedicated FreeBSD box, The email sending without  is working perfectly but very slow. The receiver receives email after almost 15 mins. I checked the maillog it says delays and timeouts that means the server keeps on trying to send email again and again until it successfully sends one. This is consuming lots of CPU.  I am seeking help for configuring smpt module to use my dedicated box's  smtp server, I need help in following places where I have ???? sign:  #SMTP server settings SMTP server -&gt; smpt.mydomain.com  # Tested by pinging, its working SMTP backup server -&gt; mail.mydomain.com  # Also verified by Ping SMTP port -&gt; 25 USE SSL  #SMTP Authentication Username -&gt; ??????? Password -&gt; ???????   I tried using localhost, also username and password of the dedicated box or leaving both lines blank which gives me:     Unable to send e-mail. Contact the site administrator if the problem   persists.   also checking the debug log doesn't show any log, it says check admin/reports/dblog but when I got to the link it just shows me the contents from admin/reports no any dblog
104784
I've seen a couple other questions with this error message but it seemed that the host and ip in question were ones the OP knew. These two are unrelated to my server.  Where and why is postfix generating this error?     Jul 24 17:42:14 email postfix/smtpd[32277]: warning: hostname kimtake.respectedopinion.com does not resolve to address 62.210.28.114   Jul 24 17:42:14 email postfix/smtpd[32277]: connect from unknown[62.210.28.114]   Jul 24 17:42:14 email postfix/smtpd[32277]: disconnect from unknown[62.210.28.114]
18251
So we have many issues with the sub-domain that we are using with the marketing cloud. One of them is: If we want to reply to the emails from Outlook, we get an error message that says:     Undelivarable and the content is: reply-fecc157376670c7c-2139_HTML-104564539-100025066-1 wasn't found at hello.ourSubdomain.com.     Also every time a client replies to one of our emails, @hello.ourSubdomain.com is getting appended at the end of their actual email address.  We did whitelist our IP address and this was resolved for 2 days. But later, we started getting the same errors.
76600
I am looking to configure postfix to route messages to different relays based on the contents of a subject line.  The desired result would be if a user sent an outbound e-mail with a specific tag say "SECURE:" at the start of the subject line it would forward to one relay (1.1.1.1) but if the tag was not specified the message would be delivered another relay (2.2.2.2).  I have investigated header checks, before and after message filtering, and postfix proxy but I have not been able to pin down how to accomplish changing the mail route based on message contents (which seems like it should be a fairly simple thing to do).  I might expect to involve procmail for this task, but would like some assistance in where to begin. Can anyone assist?
60122
I'm using network, where services such as Gmail or any other e-mails, Google Drive, Dropbox, all social networks are blocked. Basically my goal is to access simply GMail, but I couldn't find any way to do that so far. I understand that different proxies have different filtering rules, so please post any tricks or your-way solutions.
17645
I want to configure postfix to only send mail to addresses in a whitelist. I have tried to use smtpd_recipient_restrictions in main.cf like so:  smtpd_recipient_restrictions =     reject_unauth_destination     check_recipient_access hash:/path/to/whitelist   The whitelist file is of the format  address@example.com    OK another@example.com    OK   And then translated into a hash with the postmap command.   Still, the relay is sending mail to non-whitelisted addresses. What am I missing?  Edit: I am sending this mail via the sendmail command, which apparently bypasses the smptd restrictions. Is there a way to deal with this?   Edit 2/The rest of the story: I spent quite a bit of time trying to make sendmail send via SMTP only to discover the command I was using was not sendmail, but postfix's sendmail compatibility interface which mimics functionality but can't be told to use SMTP as far as I could tell.   84104's solution worked perfectly though.
80125
How do I setup spamtraps with Postfix so clients that send to trapped addresses are prevented from sending me more spam?