How do I encrypt plaintext with GnuPG?

What about: $ echo “hello” | gpg –symmetric –armor –passphrase “asdf” —–BEGIN PGP MESSAGE—– Version: GnuPG v1.4.11 (Darwin) jA0EAwMCWfhRZo0AiwVgyRw5Q26Tf+i6OCiQOVoUNJZEfz5ekBJw6BdVpE88 =ecV3 —–END PGP MESSAGE—– If this is what you’re looking for, you’ll want to setup gpg-agent to handle the passphrase… Passing it in from the command line like that is fairly insecure (as any program on … Read more

Precedence: header in email

There is a RFC 3834 dedicated for automated email responses. In short, it recommends: Send auto-responses only to address contained in the Return-Path header of an incoming message, if it is valid email address. Particularly “<>” (null address) in the Return-Path of the message means that auto-responses must not be sent for this message. When … Read more

Set email headers so bounced emails go to a specific address

I just figured this out myself in exim4 after a lot of reading about exim configuration. First, you want your app to add the following header: Return-Path: <bounced@yourdomain.com> Works with or without brackets. Exim will add brackets in the end either way. Second, this was the hard part. Exim always wanted to override my Return-Path: … Read more

Maximum length of a MIME Content-Type header field?

I hope I havn’t misread, but it looks like the length is max 127/127 or 255 total. RFC 4288 has a reference in 4.2 (page 6): Type and subtype names MUST conform to the following ABNF: type-name = reg-name subtype-name = reg-name reg-name = 1*127reg-name-chars reg-name-chars = ALPHA / DIGIT / “!”https://stackoverflow.com/”#”https://stackoverflow.com/”$”https://stackoverflow.com/”&”https://stackoverflow.com/”.”https://stackoverflow.com/”+”https://stackoverflow.com/”-“https://stackoverflow.com/”^”https://stackoverflow.com/”_” It is not … Read more

How to send an email using Go with an HTML formatted body?

Assuming that you’re using the net/smtp package and so the smtp.SendMail function, you just need to declare the MIME type in your message. subject := “Subject: Test email from Go!\n” mime := “MIME-version: 1.0;\nContent-Type: text/html; charset=\”UTF-8\”;\n\n” body := “<html><body><h1>Hello World!</h1></body></html>” msg := []byte(subject + mime + body) smtp.SendMail(server, auth, from, to, msg) Hope this helps … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)