date int64 1,220B 1,719B | question_description stringlengths 28 29.9k | accepted_answer stringlengths 12 26.4k | question_title stringlengths 14 159 |
|---|---|---|---|
1,336,420,297,000 |
I'm using a third party mail server to receive/send emails for the domains hosted on the VPS. They provide MX, TXT, CNAME records (without any IP address) to add in the DNS zone file for each domain, which I did successfully and emails are being sent by the PHP script using SMTP authentication.
Thus, I have disabled all email related services (Postfix, Dovecot, etc.) on low resource CentOS 7 VPS. As a result, I'm not getting system emails like SSH login alert, IP block, etc. from LFD + CSF.
I want to receive these system notifications and by searching on the internet, I have come to know that I've to continue Postfix MTA and convert it as a send-only SMTP server.
However, is there any option to send system alerts using SMTP authentication without the Postfix? If yes then what do I need to configure exactly?
Additionally, I have checked the Reporting Settings in the Firewall configuration but couldn't understand how do I perform LFD/CSF to send these emails using third-party SMTP authentication for the primary domain name.
Can anyone please assist me to send System Emails without Postfix MTA on VPS? I'm using CentOS Web Panel to control hosting.
|
A similiar question has been asked here.
Stricly speaking, no, you need some kind of MTA / software running to forward email.
sSMTP sounds like the best choice because it's very leightweight / meant for forwaring only.
archlinux wiki has some additional details on configuring it.
| Send System Emails without MTA on VPS |
1,336,420,297,000 |
I have a RHEL6 system and I want to verify if the system is vulnerable to phpmailer remote code execution exploit. I did not setup the server.
How can I figure if the server is vulnerable?
I tried rpm -qa | grep php, yum list | grep php and it looks like there is no phpmailer installed.
|
The first step I would do is to find all phpmailer classes residing in your server and determine their versions, and see if those individual versions are affected by one or more vulnerability(ies).
The class name of phpmailer is class.phpmailer.php https://github.com/PHPMailer/PHPMailer
So you would search on your server for:
find / -name class.phpmailer.php
If you find some on your server, look inside the file for the version.
For example I just searched an old server of mine and found PHPMailer 5.1 there:
.---------------------------------------------------------------------------.
| Software: PHPMailer - PHP email class |
| Version: 5.1 |
| Contact: via sourceforge.net support pages (also www.worxware.com) |
| Info: http://phpmailer.sourceforge.net |
| Support: http://sourceforge.net/projects/phpmailer/ |
| ------------------------------------------------------------------------- |
Last step would be to verify if there are any known vulnerabilities for that version using a vulnerability database. I like using http://www.securityfocus.com/vulnerabilities, search for:
Vendor: PHPMailer
Title: PHPMailer
Version: 5.1
In this example, for version PHPMailer 5.1, I found no known vulnerabilities.
| PHPmailer remote execution vulnerability check |
1,336,420,297,000 |
I am trying to sort incoming mails from a ticket system into maildirs containing the ticket number.
The sender is: [email protected]
The Subject contains always: RequestID: <numbers>
So I tried with the following ruleset:
match "^From:.*ticketsys@test\.de" in headers {
match "^Subject:.*RequestID:[ \t]*([0-9]*)" action tag "ticketno" value "%1" continue
match matched action "ticket"
match unmatched action keep
}
The action ticket looks like this:
action "ticket" maildir "%h/Mails/work/INBOX.Ticket-%[ticketno]"
It matches but the newly created folder ends with the minus sign ( Mails/work/INBOX.Ticket- ) as if the tag was not successful.
Update:
Here are logs from fdm -kvvvv fetch:
WORK: trying (match) message 26
WORK: matching from 0 to 1586 (size=3876, body=1586)
WORK: tried regexp "^From:.*ticketsys@test\.de" in headers, result now 1
WORK: finished rule 17, result 1
WORK: matched to rule 17
WORK: entering nested rules
WORK: trying (match) message 26
WORK: matching from 0 to 3876 (size=3876, body=1586)
WORK: tried regexp "^Subject:.*RequestID:[ ]*([0-9]*)" in any, result now 1
WORK: finished rule 18, result 1
WORK: matched to rule 18
WORK: action <rule 18>:0 (tag), user andres
WORK: match message 26, deliver
WORK: trying (deliver) message 26
WORK: message 26, running action <rule 18>:0 (tag) as user andres
WORK: tagging message: ticketno ()
WORK: message 26 delivered (rule 18, tag) in 0.000 seconds
WORK: trying (deliver) message 26
WORK: deliver message 26, blocked
WORK: calling fetch state (0x416b00, flags 0x00)
WORK: 5 file descriptors in use
WORK: deliver started, pid 10023
WORK: deliver user is: andres (1001/1001), home is: /home/andres
WORK: saving to maildir /home/andres/Mails/work/INBOX.Ticket-
WORK: creating /home/andres/Mails/work
WORK: trying /home/andres/Mails/work/INBOX.Ticket-/tmp/1485412884.10023_0.HGL-049
WORK: writing to /home/andres/Mails/work/INBOX.Ticket-/tmp/1485412884.10023_0.HGL-049
WORK: moving .../tmp/1485412884.10023_0.HGL-049 to .../new/1485412884.10023_0.HGL-049
WORK: reading mail from: /home/andres/Mails/work/INBOX/cur/1485348562_1.29104.HGL-049,U=443306,FMD5=7e33429f656f1e6e9d79b29c3f82c57e:2,S
The ticketno was not writtern to the maildir.
Update 2:
Updated to latest fdm version to ensure all fixes are included
How can I write the tag into the maildir name?
Update 3:
The Subject line looks like this:
Subject: =?iso-8859-1?Q?Empfangsbest=E4tigung_f=FCr_Service?=
=?iso-8859-1?Q?_Request_mit_der_Service_RequestID:?=
=?iso-8859-1?Q?_1710000261_/__Domain:.test.de?=
=?iso-8859-1?Q?_Subdmonains_f=FCr_Staging_Zwecke?=
|
It seems that fdm does not do MIME-Header decoding, so when a mail header has been encoded, eg as =?iso-8859-1?Q?..., you will have to explicitly take this into account in your regexp. Note that fdm will join multi-line headers into one line during the regexp phase to help you.
So, if you can guarantee that the sender of the mail will always use exactly the same header encoding you could replace your regexp with something like
match "^Subject:.*RequestID:.*\?Q\?_([0-9]*)" action tag "ticketno" value "%1" continue
so that you skip over the encoding header. However, a cleaner solution would be to introduce some perl code (or similar) to decode the header into uft8 and then match with your original regexp. Create a file, say /tmp/decodesubject, with the following contents:
#!/usr/bin/perl
use open qw/:std :encoding(utf-8)/;
use Mail::Header; # perl-MailTools
use Encode;
my $head = new Mail::Header \*STDIN, FoldLength=>999;
my $subject = $head->get('Subject');
$subject = Encode::decode('MIME-Header', $subject); # -> utf8
print "Subject: $subject";
and make it executable with chmod +x /tmp/decodesubject. You may need to install a package such as perl-MIME-tools or libmime-tools-perl to get the Mail::Header functions.
The script reads a mail on stdin and prints just the decoded Subject header. To call it from your config file, replace the above match line with
match pipe "/tmp/decodesubject" returns (0,"Subject:.*RequestID:[ \t]*([0-9]*)")
action tag "ticketno" value "%[command1]" continue
Note that to get at the capture groups in the regexp of a pipe command it seems you cannot use %1 but must use "%[command1]".
| fdm - nested actions |
1,336,420,297,000 |
I am currently using the following command to send emails from my Ubuntu server, which I adapted from this question's answer: https://unix.stackexchange.com/a/90881/166614
printf "subject: the subject\n\nMessage body"| (cat - && uuencode "$attach" $(basename "$attach")) | ssmtp <email>
My only problem so far is that the command above creates two attachments consisting of the file indicated by the $attach variable and a text file containing what's supposed to be the message body with a seemingly random number for a name. If I remove the (cat - && uuencode "$attach" $(basename "$attach")) command, the email has a body as it should but (obviously) no attachment. Conversely, if I remove the body, the text file attchment is not present.
Does anyone know how I can send an email through SSMTP with both a body and attachment?
|
I ultimately decided to use mpack to accomplish this task. While this doesn't answer the exact question I posed, I think mpack provides a simple way of sending emails without installing email clients with functionality that you might not need.
That said, if anyone can answer the exact question, they are welcome to post it.
This is the command I'm now using to send an email from the command line with a body and attachment:
attachment=/location/of/attachment
printf "Body text here." | mpack -a -s "Subject here" -d /dev/stdin -m 0 -c $(file -b --mime-type $attachment) "$attachment" <email address>
| SSMTP: How to send email with both a body and attachment |
1,336,420,297,000 |
I am interested to get email notifications from my server to my Gmail account - the same notifications that the server gets in the /var/mail/root - either by forwarding the messages, or or directly emailing the notifications there (which one is better for security?) The Gmail account is set to have two-step-authentication for security reasons.
How can I do this on a Debian Jessie?
Following @tarleb recommendations, I found Gmail's application specific login:
Went to: https://security.google.com/settings/security/apppasswords
Created a mail specific password for a custom device (named it Debian):
Got the password:
Now, how to use this with Debian? is exim4 still a good package to use? Is it safer/better to forward the emails to Gmail? Or better skip the internal root mail altogether?
Update
I did follow the tutorial on VUTLR, but I am getting the following error:
root@vultr:/etc/exim4# update-exim4.conf
2015-12-07 11:05:18 Exim configuration error in line 22 of
/var/lib/exim4/config.autogenerated.tmp:
malformed macro definition
Invalid new configfile /var/lib/exim4/config.autogenerated.tmp, not
installing /var/lib/exim4/config.autogenerated.tmp to
/var/lib/exim4/config.autogenerated
|
I was able to get it running by creating an app specific password (as noted in the question). Then followed the tutorial on VULTR. But I was getting an error:
Exim configuration error in line 22 of/var/lib/exim4/config.autogenerated.tmp:
malformed macro definition
I had to apt-get remove --purge exim4-config to get it all cleaned up. Then reinstalled exim4 by apt-get install exim4.
| How to configure a two-factor-enabled Gmail account to work as sendmail on a Debian Jessie? |
1,336,420,297,000 |
We have a typical account domain with NFS home directories, accessible by the mail server as well as various user workstations.
Do the versions of the vacation package installed on the mail server and the workstations need to match?
My understanding is that the vacation program uses a Berkeley DB to keep track of which senders it has already auto-replied to, so as not to send bounce messages to the same sender twice. What if the database is created on a workstation whose vacation is linked to one version of Berkeley DB, and subsequently used by the MDA, where the vacation on the mail server is linked to some other version of Berkeley DB? Will that cause a failure?
According to the Oracle documentation,
Berkeley DB major and minor releases may optionally include changes in all four areas, that is, the application API, region files, database formats, and log files may not be backward-compatible with previous releases.
So I'm worried that letting different versions of the Berkeley DB library access the same ~/.vacation.{db,dir,pag} files could cause data corruption.
|
Yes, vacation does use Berkeley DB for the purpose you described.
Indeed, you could run into problems if you try and access the same Berkeley DB files using different versions of the client libraries. The on-disk format does change from time to time and upgrading is normally handled transparently by the client application (or manually, using the db_upgrade script). Once the database files have been upgraded, there's no guarantee that a client using a previous version of the client libraries will be able to access the database files that have been upgraded. In light of that, it's probably a prudent step to synchronise the vacation versions across your estate just to be safe.
There's another issue (although it's probably minor) - you can run into concurrent access problems accessing Berkeley DB over NFS. See the FAQ for more information. I'd imagine it's probably not a big problem though, as vacation isn't a transaction processing system.
| Can the vacation e-mail auto-responder cope with Berkeley DB version skew? |
1,336,420,297,000 |
I'm considering using Alpine on OS X (Yosemite). I have most things configured, but I want to be able to use a GUI text editor (specifically OS X's TextEdit) as the Alpine alternative editor, so that I can use the system keyboard shortcuts, spelling checker, mouse, etc. (I'm aware that I could use an editor like emacs or vim, but I don't want to use those.)
I know about the configuration setting in Alpine (Setup > Config > ... scroll down a lot ... Editor), which wants the name of a program/command to run when I invoke the alternate editor. I've tried "open -e", which tells TextEdit to open whatever filename follows, and invoking the alternate editor does indeed open TextEdit. However, the problem is returning the contents of the TextEdit buffer to Alpine — this doesn't work. I'm not sure what mechanism Alpine uses to obtain the text from the alternative editor, though I assume it uses a temporary file. In any case, I think the problem is that the "open" command returns immediately and Alpine thinks I didn't type anything. (I have also tried the "bbedit" command to invoke "BBEdit", with essentially the same result.)
Thanks in advance.
|
If Alpine indeed works with step files, then, according to man open, you could try:
open -W -n -e
The -W option ensures open waits until the app is closed to return.
The -n option is used to run a new instance of your app, even if it’s already running (this way, if you’re already running TextEdit, you don’t have to close the currently running instance).
If you’d like to use another editor, let’s say “Awesome Text Editor.app”, you can replace the -e by -a.
open -W -n -a "Awesome Text Editor"
Notice that you’ll need to close the application, not only the document.
Some editors also offer their own command-line utilities. In TextMate 2, the following command will wait for the document to be closed to return.
mate -w
| How to configure Alpine to use an alternate editor on Mac OS X? |
1,336,420,297,000 |
What specific syntax do I use to get mutt to send an email through port 587 on a CentOS 7 server?
For example, the sender is [email protected], the recipient is [email protected], the subject is This is the subject, and the message body is This is the message body..
|
In your ~/.muttrc or ~/.mutt/muttrc, files which may be or may not be reside in your home directory, you can add the following lines:
set smtp_url="smtp://[email protected]:587/"
set smtp_pass="insertyourpasswordhere"
This only works if the smtp option is enabled during compilation.
If neither of these files are in your home directory, you should create one of them first. If you have one of them, don't remove content that may be already there. Just make sure that the lines mentioned above contain the correct. Insert your own mailaddress and password of course.
The general method to send a mail with Mutt is like
echo "This is the message body" | mutt -s "This is the subject" [email protected]
or you can create a textfile with your message body ( let's say /tmp/message.txt) and do this
mutt -s "This is the subject" [email protected] < /tmp/message.txt
If you want to set sender details add the following to muttrc as mentioned above:
set from = "Enteryouremailaddresshere"<br>
set realname = "Yourname"
Mutt commands mentioned here should be one a single line.
| use mutt to send email through specific port on CentOS 7 |
1,336,420,297,000 |
When I send an eMail with Kontact (KDEPIM), my Message-ID headers look like this:
Message-ID: <1548233.Ax4hfq5P2Q@pbecbengr-rivy-znaqngrq-ba.tglase.lan.tarent.de>
In contrast, my regular MUA uses:
Message-ID: <[email protected]>
So, why does KMail not use just the FQDN of my host, and why does it use the string “pbecbengr-rivy-znaqngrq-ba” (which is rot13 for “corporate-evil-mandated-on”)? Duckduckgoïng and googling for either string does not yield anything informative or at all…
|
Args. Apparently, this has been written into my ~/.kde/share/config/kmail2rc under [Composer] ⇒ myMessageIdSuffix, which I could then backtrace to the “Headers” tab of the “Composer” group of “Settings → Co̲nfigure KMail…”.
Now, the only remaining question is, who has set it there, why, and how. But I guess this answers the initial question I had, and un-checking the “U̲se custom message-id suffix” box helped. (Funnily enough, the Message-ID suffix is normally set under Identities → Advanced…)
| Why does KDEPIM add “pbecbengr-rivy-znaqngrq-ba” to the domain part of outgoing Message-ID headers? |
1,336,420,297,000 |
I have an email address that I can access via POP3, but which I rarely use. Though it receives quite a bit of email. I cannot use a forwarding feature for this account.
Yet I want to forward incoming mail to my iCloud account.
I do have a dedicated root server running somewhere, which for example could run fetchmail to collect mail from the POP3 server and do something with it. The question is, can fetchmail -- or some other program -- directly forward that email to my iCloud account?
|
I got it working with fetch mail and msmtp. My target was iCloud, so I will leave in the MX of iCloud. First the .fetchmailrc:
poll pop.gmx.net
with proto POP3
user "user@pop-server"
there with password "secretpassword"
mda "/usr/bin/msmtp -- [email protected]"
options
no keep
ssl
sslcertck
sslcertpath /etc/ssl/certs
set daemon 300
Then the .msmtprc:
account default
host mx6.mail.icloud.com
port 25
auto_from off
from "user@localdomain"
tls on
tls_starttls on
tls_trust_file /etc/ssl/certs/ca-certificates.crt
logfile ~/.msmtp.log
domain mx.of.localdomain
Obviously this works only if you have your own MX for your own domain (called local domain in my example). Also if you are targeting something other than iCloud, you need to look up its MX.
I tried using authenticated SMTP with iCloud, so that I don't need to use my own domain with its MX, but that did not work. iCloud would reject the mails with a 550 5.7.0 error: the from mail address was not matching (which is of course true for mails that I received from other people).
Also, the example above runs on Debian stable, assuming some locations for the SSL certificates. You might need to tweak this, as well as the general TLS and SSL behavior.
This setup however runs well enough for me to be useful. There is a 5 minute delay in the fetchmail polling, but that's ok.
| How can I forward emails from a POP3 account to another SMTP or IMAP account? |
1,336,420,297,000 |
I have fetchmail running perfectly to fetch emails from Gmail, and then I am using procmail to store them in $HOME/Mail/Inbox. In my .procmailrc, I added this code which pipes to munpack to extract the attachment which can be a PDF or CSV file:
ATTACH=`echo $HOME/Mail/Inbox`
:0 c
* ^To:.*[email protected]
* ^From:.*[email protected]
| munpack -q -C $ATTACH
But I don't get any file in /var/tmp or anywhere else. Also if I use munpack manually in terminal I get the error of "Did not find anything to unpack from /Users/[username]/Mail/Inbox".
Does anyone have any experience how to solve the problem?
|
I found the problem! Munpack will work just in case you have one mail in your mailbox text file. If you have more than that munpack will not work!
| Problem extracting email attachment using munpack |
1,336,420,297,000 |
I have a debian 6.0 server with courier/courier-mta set up and some local domains. Now I want to create some forwards for some email address that should go directly to external addresses as there are no local users for those addresses.
Eg. I have an address "[email protected]" (its an example, I use a different address) and I want it to be redirected to "[email protected]" and also some other addresses from "example.com" but to different target domains.
I tried to configure courier with the webadmin interface and registered "example.com" as a local domain. Then under the aliases section i added the full "[email protected]" address (as there is no local account) and set "[email protected]" as recipient - but it didn't work. When I sent to the user I get:
The error that the other server returned was: 550 User unknown
Then I read something about courier aliases and created a new file "example.com" under the couriercfgdir/aliases and added some email addresses and targets (e.g.: "[email protected]: [email protected]") and run the "makealiases" command but it didn't change anything. I still receive the same 550 error when sending mail to [email protected].
I thought maybe aliases is ignored as long as I don't use maildrop, so I changed the courier delivery options to use "maildrop" (and installed the courier-maildrop package), restarted the courier server but still no change.
And I also don't know where to find some sort of log file. /var/log/mail.log was last updated in june but I have received emails since then and I don't see any other logfile for courier.
Somehow it looks as if my aliases are ignored but I don't get why.
Does anyone have an idea why?
|
You can do the following, but this requires a mailbox, create a dummy mailbox (/home/vmail/domains/mydomain/redir), and create a dot-courier file (/home/vmail/domains/mydomain/redir/.courier) with the following content:
[email protected]
[email protected]
And that's it, when you send a mail to [email protected], it will be forwarded to [email protected] and [email protected]
Aliases can be used for local mail accounts.
| Configure courier to forward certain mails to external addresses |
1,336,420,297,000 |
I'm running postfix on Debian, receiving email for my.com, and I would like all incoming emails from sender.com to be delivered to [email protected], regardless of the original recipient.
Emails from other domains still need to go to the original recipient.
Is this possible/easy to set up?
|
I found the answer here.
You can use sender-dependant aliases like that:
main.cf:
smtpd_sender_restrictions = check_sender_access hash:/etc/postfix/sender_access
sender_access:
sender.com redirect [email protected]
| Sender based redirection on Postfix |
1,336,420,297,000 |
I'm running a postfix/dovecot mail server and everything works quite well.
What I want to do now is forward all mails with a recipient that does not have an entry in the local recipient table, to another, existing user.
I've tried google'ing around, but I haven't found anything...it seems like this is an uncommon thing to do.
Does anyone know how to do that, or can maybe point me to a lead?
Thanks a lot in advance.
|
Ok, using simple aliases works well enough for me.
In case someone else needs a hint on this, I used this link to set up mail redirection:
http://www.cyberciti.biz/tips/how-to-redirect-one-users-mail-to-another-user-with-postfix.html
| Postfix: Forward/Reroute mails with unknown recipients |
1,336,420,297,000 |
I have Postfix suite installed locally on Ubuntu 10.10. I can send/receive mail to my local address, e.g. [email protected]. I'm given credentials to a remote mail server mailbox, e.g. [email protected].
What command line incantation on my local box would connect me to SMTP server at remote.com providing username and password and send mail through it?
I've read sendmail and smtp manpages but that didn't give me any clue.
|
Actually, Postfix turned out to be irrelevant to my problem. Using it would be an overkill for this task: it requires per-host configuration, where per-user would do.
I figured out msmtp is well enough for my task.
| How to send mail from a remote SMTP host? |
1,600,929,113,000 |
I am running mutt as my email client, with abook to manage addresses.
I understand that to send a query to abook I can use Q, with the relevant part of my muttrc being:
set query_command = "abook --mutt-query '%s'"
But this requires me to type some query, which will shorten my address list. Often I want to browse through my entire address book to find the relevant recipients, especially if I can't remember their name at first.
Is there a way to send an empty query to abook, to display all of my contacts?
|
You can use "" as an argument. Press Q in mutt and then just enter "" and press enter. You can also test it in a command line ( I added 2 public addresses for a test):
$ abook --mutt-query ""
[email protected] [email protected]
[email protected] Gmane Autoauthorizer
Alternatively you can use aliases. Set this in your .muttrc:
set alias_file=~/.mutt-alias
source ~/.mutt-alias
Now press a inside mutt to run create-alias function. You can then display a list of all of your aliases by pressing Tab when choosing a recipient.
| Mutt abook empty query |
1,600,929,113,000 |
When I run "postsuper -d ALL" all messages from mailq are deleted. For a few seconds I am able to send emails from terminal just fine. However, even if I just stand still and do nothing after clearing the mailq, after about 20 seconds some new entries starts to show up in the queue, which prevents any other email message to be sent. In other words, if I clear the mail queue, and do nothing, new entries shows in the mail queue... and they prevent me to be able to send new email messages through the server.
I already tried:
Restarting the server
postfix stop
postqueue -f
postfix flush
postsuper -d ALL deferred
I also tried to:
- Uninstall postfix
- Uninstall cyrus-sasl
- Uninstall cyrus-imapd
- Uninstall mailx
But when I re-install them, the issue comes back.
Nothing seems to prevent those new messages to show up on the mail queue again and again every 20 seconds.
How can I fix that?
|
I believe the issue was fixed by fixing permissions on the folder:
/var/lib/imap/socket/lmtp
There was also a small difference between the server's hostname and the hostname actually defined on the postfix config file. After those two things were fixed, the postfix was restarted.
| CentOS: postqueue -p show a message that keeps coming back to queue |
1,600,929,113,000 |
I have configured dovecot to use Client certificate authentication. I have used CA.pl (openssl wrapper) to create CA cert and sign client and server certs with that.(no certificate chain, CA cert is trusted in client) I have set the certificate as CA certificate in dovecot for client auth. Dovecot correctly asks IceDove for certificates but after clicking OK, It fails with error
"Client didn't present valid SSL certificate."
Using openssl to manually test IMAP connection also results in this error.
dovecot config: https://gist.github.com/Xcess/71f7eeeda0a270b252f1de5d7308c0e2
I have tried certificate with CN=user1 and [email protected]. both failed. Also set common-name to be username in dovecot conf...no difference.
I don't know what to do as this is all stated in manuals and seems pretty simple and straightforward. But it fails.
thanks
Update 1:
output of command openssl x509 -in certificate.crt -text -noout:
Certificate:
Data:
Version: 3 (0x2)
Serial Number:
8e:3d:9b:7c:13:35:88:b7
Signature Algorithm: sha256WithRSAEncryption
Issuer: C=IR, ST=Isf, O=Apps4you, CN=lnxsrv2
Validity
Not Before: Mar 1 10:45:32 2017 GMT
Not After : Mar 1 10:45:32 2018 GMT
Subject: C=AU, ST=Some-State, O=Internet Widgits Pty Ltd, CN=user1/[email protected]
Subject Public Key Info:
Public Key Algorithm: rsaEncryption
Public-Key: (2048 bit)
Modulus:
---
Exponent: 65537 (0x10001)
X509v3 extensions:
X509v3 Basic Constraints:
CA:FALSE
Netscape Comment:
OpenSSL Generated Certificate
X509v3 Subject Key Identifier: ---
-----Output ommited-----
Update 2:
this slightly modified config file also doesn't work:
https://gist.github.com/Xcess/599beaec17a4a524a2acbde1b7f5c70f
Update 3:
Verbose SSL Log file :
https://gist.github.com/Xcess/f54850ecdaa6bcd044a77d133cb9b9c2
|
I found the answer so I thought I should post it here too. (precisely @behrad-eslamifar did :)
you should append the CRL to the CA certificate given to dovecot EVEN IF YOU HAVE SET ssl_require_crl = no
like this way :
openssl ca -gencrl -out crlfile
cat crlfile >> cacert.pem
service dovecot restart
thanks everyone for their suggestions. <3
| Dovecot rejecting client certificate |
1,600,929,113,000 |
I have a dedicated server with a few VPSs for my clients. I'd like to immediately stop/suspend any VPS that send out mass emails.
I'm aware of a way to monitor SMTP connections on port 25 But this method doesn't work if the VPSs are configured to use another port to send out email.
I'm not sure if the method works if the client use mail() function in PHP, though.
I'd love to hear your opinion about the available methods that works great to prevent spam.
Thanks for any sharing!
Additional information:
I'm using Proxmox, my clients have openVZ VPS and LXC containers. I have access to guest system, but prefer not to use the access privileges since the clients may re-configure anything in the way they want.
|
For OpenVZ and LXC it is much easier task than for KVM, for example. You can use some already written tools like this and this (FastVPS specializes on OpenVZ VPSes).
Also, having access to guest system, you can not only monitor traffic from outside, but you also can monitor smtp queue from inside. And this can be much more efficient. From my practice, I can say that usually you'll have pretty common MTA installed (sendmail/exim/postfix).
You can write script that will jump into container, detect MTA used and get size of queue. Having that data you'll be able to see abnormal activities and with php mail() function you'll also will be able to detect particular script that is sending spam from X-PHP-Originating-Script header (refer here).
Regretfully, there is no silver bullet in fight against spam. So, you need to automate things as much as possible. For that purpose you can send alerts from you smap-in-queue-detencting script both to you and to VPS owner. In most cases there are just some infection caused by outdated or misconfigured CMS (like Wordpress or Joomla) and some giving VPS owner some recomendations to mitigate spam (like updating CMS, running maldet, etc.) can help you.
EDIT:
For case with KVM or any other case where you don't have access to guest system there is no convenient ways to mitigate spam activities, but still you have some options. Some of them will be unacceptable due to privacy policy.
Provide OS images for KVM with preinstalled monitoring agent and/or user with public key imported that will be used for purposes of monitoring and controlling spam. If this option is acceptable to you, then you can use the same steps as with OpenVZ to monitor queue and detect spam-generating php scripts.
Block or rate-limit traffic going out from public IPs and port common to SMTP protocol (usually 25). Some giant providers (for example, Amazon) have rate-limiting on port 25 enabled by default and to disable it you need to write request to support with description of your use-case.
| Prevent outgoing email spam from client's VPS |
1,600,929,113,000 |
Short description, what i'm searching for:
I want to have a detached tmux session automatically started as a systemd user service. Inside that, offlineimap should start and decrypt my login credentials. The graphical variant of pinentry should ask me for the password for decrypting my login credentials, when I attach to the session.
For managing my login credentials, I want to use the program pass.
What I've got so far:
The desired Behavior works perfectly and reproducibly (starting from reboot), when i start the user service after I've logged into my system.
But unfortunately it doesn't work when I do "symstemctl --user enable mail.service" and reboot:
$ systemctl --user status mail
● mail.service - load offlineimap for all mail accounts inside tmux
Loaded: loaded (/home/toogley/.dotfiles/systemd/user/mail.service; enabled; vendor preset: enabled)
Active: inactive (dead)
$ tmux attach-session -t mail
can't find session mail
I have no idea, what i could analyze or what might be the reason. Does somebody has tips how to address this issue?
Thanks a lot!
My mail.service
Description=load offlineimap for all mail accounts inside tmux
After=network.target graphical.target
Requires=gpg-agent.service
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/bin/tmux new-session -d -s mail -n dev 'export GPG_TTY=$(tty) && \
offlineimap'
ExecStop=/usr/bin/tmux kill-window -t mail
ExecReload=/usr/bin/kill -s USR1 $(pgrep offlineimap)
[Install]
WantedBy=graphical.target
my gpg-agent.service:
[Unit]
Description=GnuPG private key agent
IgnoreOnIsolate=true
[Service]
Type=forking
ExecStart=/usr/bin/gpg-agent --daemon --homedir=%h/.gnupg
ExecStop=/usr/bin/pkill gpg-agent
Restart=on-abort
[Install]
WantedBy=default.target
My ~/.offlineimaprc
[general]
accounts = dev
ui = ttyui
metadata = ~/.dev_offimap
pythonfile=~/.dotfiles/mutt/accounts/decrypt.py
[Account dev]
synclabels = yes
localrepository = dev-local
remoterepository = dev-remote
status_backend = sqlite
autorefresh = 1
quick = 10
[Repository dev-local]
type = Maildir
localfolders = ~/mail/dev/
[Repository dev-remote]
remotepasseval = get_pass("[email protected]")
ssl = yes
type = IMAP
remotehost = imap.mailbox.org
remoteuser = [email protected]
sslcacertfile = /etc/ssl/certs/ca-bundle.crt
keepalive = 60
holdconnectionopen = yes
|
It seems that what I'm searched for is currently not possible.
Initially I misread the description of graphical.target - I thought this target would be set after the login has happened. Instead, it just sets up the Login Screen (e.g. lightdm). And for "logged into graphical desktop" does currently no target exist.
The ArchLinux Wiki describes a method of starting the window manager per systemd user services - which doesn't work for me, because it depends when the user logs into lightdm.
As a workaround I use an alias for starting my service when I need it.
| Systemd Service for Offlineimap + gpg encrypted PW's inside tmux works manually after system start but not autmoatically |
1,600,929,113,000 |
When using mutt I don't want all the messages to be cached, which could take up a lot of disk space. But if I purge an email, it also gets deleted on the server side, which is undesired because I may need to reference it in future. Is it possible to automatically clean up cached old messages when it's >100MB, while keeping those messages as they are on server and never retrieve them back to my laptop?
|
AFAIK you cannot do that directly in neomutt.
But in GMail and maybe other e-mail providers you can set limit for number of messages beeing fetched from folder/label over IMAP.
GMail > Settings > Forwarding and POP/IMAP (IMAP access section) under Folder size limits
Limit IMAP folders to contain no more than this many messages
| Can mutt delete message locally but retain it on server? |
1,600,929,113,000 |
I have Kubuntu 14.04 and am mandated by my employer to use Outlook 2013 for company email for "security reasons". I currently solve this problem by having a virtual Windows 7. This seems like a bit of overkill. I have never used wine but in principle it would be an ideal solution. Can somebody please point me to a guide to using Office through wine? I have read that it is buggy on various posts but they are quite outdated. Does anybody have recent feedback on such an endeavour?
|
According to WineHQ the application will install but it's very likely that it won't run at all.
Your current solution (having Windows in a VM) seems like the more seamless and effective solution to the problem. Unless something change, I recommend using a Virtual Machine instead.
| Outlook on Kubuntu 14.0.4 with Wine |
1,396,426,859,000 |
My organization is running an exchange server 2007 with MAPI disabled for security reasons. How do I connect with evolution? When I connect using the Microsoft Exchange option I get the error
The Exchange server is not compatible
with Exchange Connector.
The server is running Exchange 5.5.
Exchange Connector supports Microsoft
Exchange 2000 and 2003 only.
If I use the Exchange MAPI option I get
Authentication failed.
MapiLogonProvider:MAPI_E_NETWORK_ERROR
Which appears to be a network timeout, which confirms that administrators have MAPI turned off.
|
As far as I know, this is not possible, at least if you want a reasonably stable solution. Which would, at this point, also exclude the Exchange MAPI option, even if it were available.
| Evolution and Exchange Server 2007 without MAPI |
1,396,426,859,000 |
I am doing the following:
x="Hello to the world of tomorrow\n <pre>";
x="${x}$(tail -n 50 log/logfile.log)"
x="${x}</pre>";
echo -e $x | ./perlscript
The Perl script:
#!perl
# perlscript
open(MAIL, "sendmail -t")
print MAIL "EMAIL HEADERS\n\n"
print MAIL <STDIN>
close(MAIL);
When I receive the email, the log file doesn't have any \n inside the <pre> tag. The Hello to the world of tomorrow works fine and the \n is represented.
How to I get tail not to remove any \n, or is it something further down/up the chain?
|
double quotes are missing in the command echo :
echo -e "$x" | ./perlscript
| $(tail) into variable removing \n |
1,396,426,859,000 |
Let's say I send an email, containing a link to my website, to someone that I really hope he'll visit it (fingers-crossed style):
http://www.example.com/?utm_source=email392
or
http://www.example.com/somefile.pdf?utm_source=email392
How to make Linux trigger an action (such as sending an automated email to myself) when this URL is visited, by regularly examining /var/log/apache2/other_vhosts_access.log?
I can't do it at PHP level because I need to do it for various sources/websites (some of them use PHP, some don't and are just link to files to be downloaded, etc.; even for the websites using PHP, I don't want to modify every index.php to do it from there, that's why I prefer an Apache log parsing method)
|
Live log monitoring using bash process substitution:
#!/bin/bash
while IFS='$\n' read -r line;
do
# action here, log line in $line
done < <(tail -n 0 -f /var/log/apache2/other_vhosts_access.log | \
grep '/somefile.pdf?utm_source=email392')
Process substitution feeds the read loop with the output from the pipeline inside <(...). The log line itself is assigned to variable $line.
Logs are watched using tail -f, which outputs lines as they are written to the logs. If your log files are moved periodically by logrotate, add --follow=name and --retry options to watch the file path instead of just the file descriptor.
Output from tail is piped to grep, which filters the relevant lines matching your URLs.
| Trigger an action when an URL has been visited |
1,396,426,859,000 |
I remember messing around with crontab and setting up email capabilities on a server many months back, and now all of a sudden I'm getting the following email:
EMAIL HEADER:
from: root <[email protected]>
to: root
date: Thu, Dec 5, 2013 at 6:48 AM
subject: Cron <root@server-ip> test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
mailed-by: gmail.com
BODY:
/etc/cron.daily/mlocate:
/usr/bin/updatedb.mlocate: `/var/lib/mlocate/mlocate.db' is locked (probably by an earlier updatedb)
run-parts: /etc/cron.daily/mlocate exited with return code 1
|
This is a cron job that updates the indexes for mlocate, which is used when you run locate on your system to find files. This index allows the program to quickly find files without traversing the filesystem (which is much more expensive, because it's not optimised for that use case). For some reason, the lock file that stops more than one database update happening at one time still remains, perhaps because mlocate was terminated unexpectedly and wasn't able to remove the lock file.
To fix this:
Check that there are no updatedb.mlocate processes running (pgrep -x 'updatedb\.mlocate');
If one is running, either wait for it to finish, or if you think it is stuck, terminate it (pkill -x 'updatedb\.mlocate', perhaps using more violent signals if there is no response);
Remove the lock if none are running (rm /var/lib/mlocate/*.lock).
| Mysterious automated emails |
1,396,426,859,000 |
I know that I can create a GPG keypair from the CentOS 7 terminal by typing gpg --gen-key and following the resulting steps, but how can I make sure that the resulting public key is self-signed? And how can I send the resulting key via email to a remote computer?
I know that I can send an email with an attachment using mailx from the command line as follows:
echo "this is the body of the email" | mailx -s"Subject" -a public.key [email protected]
But the mailx code snipped assumes that the key is available in a file. In reality, the key is locked up in a keyring and needs other syntax in order for it to be accessed.
EDIT
I am following @HaukeLaging's advice. I have created a new key, but when I type gpg --list-sigs in the command line, I get the following results:
/home/username/.gnupg/pubring.gpg
-----------------------------------------
pub 4096R/CODE1 2015-02-04
uid User Name <[email protected]>
sig 3 CODE1 2015-02-04 User Name <[email protected]>
sub 4096R/CODE2 2015-02-04
sig CODE1 2015-02-04 User Name <[email protected]>
Which of these key codes is the public key? And Which is the private key? I do not want to accidentally send the private key to anyone.
EDIT#2
As per @HaukeLaging's response to EDIT#1, I tried:
`sudo gpg --armor --export CODE1 >/home/username/my_public_cert.asc`
but the result is an empty file when I then cd /home/username/ and ls -al.
Also,
gpg --list-packets /home/username/my_public_cert.asc
resulted in gpg: processing message failed: Unknown system error
Why is gpg --armor --export CODE1 >/home/username/my_public_cert.asc producing an empty file?
|
First, find the public key you want to export:
gpg --list-public-keys
Look at the line marked 'pub'; it displays your public key type and number. For instance:
pub 1024D/5000280F 2009-07-10
Use the number to do your export:
gpg --armor --export 5000280F > klaatu_pubkey.asc
Check to make sure it worked:
cat klaatu_pubkey.asc
As long as it's not empty, you can send that file to your friends.
Since the PGP model is based on a web of trust, it is beneficial to get your public key out there into the world so people can start using it. The easiest way to do that is to post it to a key server:
gpg --export send-keys 5000280F --keyserver keys.fedoraproject.org
Key-servers mirror one another periodically, so your key will propagate and people who receive signed emails from you can just download/import your pub key from the network of key servers.
| creating and sending a self-signed public key using GnuPG in CentOS 7 |
1,396,426,859,000 |
Is 'marc' some person in the Linux/Unix community?
In /etc/aliases on a default centos install, the bottom line reads:
# Person who should get root's email
# root: marc
Or is it just a random name?
|
This is an example, but it wasn’t picked out of thin air: marc is Marc Ewing, who created Red Hat Linux and wrote the initial version of the /etc/aliases file which ends up in CentOS.
The line is commented out, so it doesn’t have any effect; if you want to redirect email sent to root, it’s up to you to choose whatever recipient is appropriate, correct the line to take that into account, and uncomment it.
| Who is marc, the default receiver of root mail in /etc/aliases? |
1,396,426,859,000 |
I am using offlineimap to fetch mail from several IMAP servers. This used to work but today offlineimap has been unable to fetch mail, producing the following errors:
*** Processing account example
Establishing connection to imap.gmail.com:993
ERROR: Unknown SSL protocol connecting to host 'imap.gmail.com' for
repository '<redacted>'. OpenSSL responded:
[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590)
*** Finished account 'example' in 0:00
Relevant parts of my configuration are:
[Account example]
localrepository = local-example
remoterepository = remote-example
[Repository local-example]
type = Maildir
localfolders = ~/mail/example
[Repository remote-example]
maxconnections = 1
type = Gmail
remotehost = imap.gmail.com
remoteuser = [email protected]
remotepasseval = get_keychain_pass(account="[email protected]",
server="imap.gmail.com")
ssl = yes
sslcacertfile = /usr/local/etc/openssl/certs/dummycert.pem
The sslcacertfile configuration was created in response to this SO answer. The get_keychain_pass function is from this offlineimap configuation.
I am using offlineimap 6.5.7 built with Homebrew on OS X 10.10.4.
|
The problem started when I installed Homebrew's version of python rather than the Apple version. The error was resolved by running
brew uninstall python
I discovered this was the solution by reading about a similar error produced by another Python program on OS X.
| Offlineimap unknown SSL protocol error |
1,396,426,859,000 |
I would like to send several times the same email to different recipients. I cannot put all recipients in CC or BCC because 1. one recipient should not see emails of the others (so not CC) and 2. I have to send this email at different time according to the recipient (so not BCC).
The solution seems to be "bouncing" the email ("b" in mutt). However, when I bounce a email I just send, mutt asks me only the new recipient email. This new recipient will receive an email addressed to the first recipient and not himself. In fact, he will not see at all that the email is addressed to him.
It seems I would like to bounce emails and modify recipient. How can I do this in mutt?
|
resend-message (Esc-e) lets you create and edit a new message based on a previous one. Just change the recipient and send.
If several is tens or hundreds, then make a shell/perl/whatever script to call mutt for each recipient in a database.
| How to modify recipient when bouncing email in Mutt? |
1,396,426,859,000 |
I am trying to send email via my web server using PHP but for some reason the email never arrives. According to PHP the email was sucessfully sent but I never receive the email. I know its not a spam problem as the web server used to be able to successfully send email until I reinstalled it last week. It has been installed with exactly the same OS and configuration except now it doesn't work.
It is using the default PHP settings for sending email and I have enabled SMTP in the firewall but this doesn't seem to be working.
Are there any logs for the PHP email sending that may be able to help me trouble shoot why it isn't working?
|
PHP is probably trying to talk to a local SMTP server, that is, one running on the same machine as the web server. So, have you set one up? There are many to choose from. The most popular are Sendmail, Exim, Postfix, and Qmail.
Try sending email using the primitive mailx client. If it can't send mail outside the machine, it's probably for the same reason PHP can't, so the problem would therefore lie outside PHP.
Try sending email by hand from the command line by telnetting to localhost on port 25 and speaking the SMTP by hand. There are many guides for this online. Here's one. Where you go from there depends on what happened:
If you get no answer on port 25, there is no SMTP server running.
If it answers, maybe it will give an error message that clues you in to the problem.
If it appears to accept the email, you have to go about debugging your local SMTP server.
| Email sent from web server using PHP does not arrive |
1,396,426,859,000 |
As we know that MAILTO is used for receiving any mail related to the Cron job. In my case I have three commands to execute, do I need to add MAILTO three times even if the receiver mail id is the same for each of the three commands? My jobs are running on a CentOS machine.
[email protected]
./first-Command
[email protected]
./second-Command
[email protected]
./third-Command
Or mentioning the mail id only once will work in my situation? like this:
[email protected]
./first-Command
./second-Command
./third-Command
I'm new to the Cron tool. Any idea/hint in the right direction will do!
|
The MAILTO variable, if set, is retrieved from the crontab file, so if it exists and is not "" then it will be used for all subsequent jobs in that file, just like if you had created a shell script like your second example.
Therefore, setting it at the top of the crontab file is enough, just like you could change the crontab shell from sh to bash with SHELL=/bin/bash in the beginning of the file per the man page.
| Do we have to rewrite the MAILTO after each cron command? |
1,396,426,859,000 |
Unable to send out emails from my Linux Host. Below is the command I try:
echo "This is the message body and contains the message" | sudo mailx -v [email protected] -s "This is the subject"
or
mail -s "Test Subject" [email protected] < /home/system/mailbody.txt
Output:
Mail Delivery Status Report will be mailed to <root>.
Here is the Running process.
$ ps -ef | grep postfix
postfix 2993 30866 0 19:15 ? 00:00:00 pickup -l -t unix -u
system 4399 594 0 19:28 pts/0 00:00:00 grep --color=auto postfix
root 30866 1 0 2020 ? 00:00:19 /usr/libexec/postfix/master -w
postfix 30868 30866 0 2020 ? 00:00:05 qmgr -l -t unix -u
Here is the telnet showing port 25 is LISTENING on my system:
$ telnet localhost 25
Trying ::1...
Connected to localhost.
Escape character is '^]'.
220 efendibey_live.localdomain ESMTP Postfix
Here is the output of mailq:
$ mailq
-Queue ID- --Size-- ----Arrival Time---- -Sender/Recipient-------
AE3BF1FC5 606 Sun Feb 7 19:15:10 system@efendibey_live.localdomain
(connect to mx2.zoho.com[136.143.191.44]:25: Connection timed out)
[email protected]
7410B47CA 602 Sun Feb 7 19:18:57 system@efendibey_live.localdomain
(delivery temporarily suspended: connect to alt2.gmail-smtp-in.l.google.com[2404:6800:4003:c06::1a]:25: Network is unreachable)
[email protected]
3EC5F1EC2 474 Sun Feb 7 19:13:34 system@efendibey_live.localdomain
(connect to mx2.zoho.com[136.143.191.44]:25: Connection timed out)
[email protected]
456251FC6 656 Sun Feb 7 19:18:04 system@efendibey_live.localdomain
(connect to mx2.zoho.com[136.143.191.44]:25: Connection timed out)
[email protected]
1CB9D48FB 652 Sun Feb 7 19:20:04 system@efendibey_live.localdomain
(connect to alt2.gmail-smtp-in.l.google.com[2404:6800:4003:c06::1a]:25: Network is unreachable)
[email protected]
1FE9B450F 652 Sun Feb 7 19:19:45 system@efendibey_live.localdomain
(connect to alt2.gmail-smtp-in.l.google.com[2404:6800:4003:c06::1a]:25: Network is unreachable)
[email protected]
B180025B5 654 Sun Feb 7 19:25:25 root@efendibey_live.localdomain
(delivery temporarily suspended: connect to alt2.gmail-smtp-in.l.google.com[2404:6800:4003:c06::1a]:25: Network is unreachable)
[email protected]
Update:
The outbound port is also open and connecting:
$ telnet gmail-smtp-in.l.google.com 25
Trying 108.177.119.26...
Connected to gmail-smtp-in.l.google.com.
Escape character is '^]'.
220 mx.google.com ESMTP g24si11485107edh.82 - gsmtp
Once I fire the command to sent out an email I can see it in the mailQ and then disappear from the Queue, however, I still do not receive the mail in my inbox.
[system@efendibey_live ~]$ echo "This is the message body and contains the message" | sudo mailx -v [email protected] -s "This is the subject"
Mail Delivery Status Report will be mailed to <root>.
[system@live ~]$ mailq
-Queue ID- --Size-- ----Arrival Time---- -Sender/Recipient-------
3723C16BC* 658 Mon Feb 8 13:37:13 root@ebey_live.localdomain
[email protected]
-- 1 Kbytes in 1 Request.
[system@live ~]$ mailq
Mail queue is empty
[system@live ~]$
The below is the output from tail -f /var/log/maillog for a single mail send command.
Feb 8 15:29:43 Efendibey_Live postfix/pickup[10591]: E4F5F16A9: uid=0 from=<root>
Feb 8 15:29:43 Efendibey_Live postfix/cleanup[18223]: E4F5F16A9: message-id=<20210208152943.E4F5F16A9@efendibey_live.localdomain>
Feb 8 15:29:43 Efendibey_Live postfix/qmgr[1193]: E4F5F16A9: from=<root@efendibey_live.localdomain>, size=467, nrcpt=1 (queue active)
Feb 8 15:29:45 Efendibey_Live postfix/smtp[18225]: E4F5F16A9: to=<[email protected]>, relay=mx.zoho.com[136.143.191.44]:25, delay=1.2, delays=0.03/0.01/0.67/0.51, dsn=5.7.1, status=bounced (host mx.zoho.com[136.143.191.44] said: 541 5.7.1 Mail rejected due to antispam policy (in reply to RCPT TO command))
Feb 8 15:29:45 Efendibey_Live postfix/cleanup[18223]: 468D216BC: message-id=<20210208152945.468D216BC@efendibey_live.localdomain>
Feb 8 15:29:45 Efendibey_Live postfix/qmgr[1193]: 468D216BC: from=<>, size=2472, nrcpt=1 (queue active)
Feb 8 15:29:45 Efendibey_Live postfix/bounce[18227]: E4F5F16A9: sender non-delivery notification: 468D216BC
Feb 8 15:29:45 Efendibey_Live postfix/qmgr[1193]: E4F5F16A9: removed
Feb 8 15:29:45 Efendibey_Live postfix/local[18228]: 468D216BC: to=<root@efendibey_live.localdomain>, relay=local, delay=0.02, delays=0.01/0.01/0/0, dsn=2.0.0, status=sent (delivered to mailbox)
Feb 8 15:29:45 Efendibey_Live postfix/qmgr[1193]: 468D216BC: removed
I even tried the -f [email protected] option in mailx but still, no emails received.
Here is my /etc/hosts entry
# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
127.0.0.1 guest
::1 guest
127.0.0.1 Efendibey_Live
::1 Efendibey_Live
Can you please suggest how can I get emails to work from my Linux host?
|
In an update you showed your /var/log/mail.log contained this:
Feb 8 15:29:43 Efendibey_Live postfix/qmgr[1193]: E4F5F16A9:
from=<root@efendibey_live.localdomain>, size=467, nrcpt=1 (queue active)
Feb 8 15:29:45 Efendibey_Live postfix/smtp[18225]: E4F5F16A9:
to=<[email protected]>,
relay=mx.zoho.com[136.143.191.44]:25,
delay=1.2, delays=0.03/0.01/0.67/0.51, dsn=5.7.1,
status=bounced (host mx.zoho.com[136.143.191.44] said:
541 5.7.1 Mail rejected due to antispam policy (in reply to RCPT TO command))
This means your message was sent successfully, but it was rejected by the recipient. What's also interesting is the from= address. It looks like your domain is efendibey_live.localdomain. If the recipient can't do a DNS lookup of your domain, then they will often reject your email.
When postfix is configured, it uses the output of hostname -f to set everything up. That's a function of your machine name, and of the DNS entry for your machine. The solution is to update your /etc/postfix/main.cf.
My stuff looks like this:
$ hostname -f
mail.example.com
$ cat /etc/hostname
mail.example.com
$ host -t mx example.com
example.com is handled by 10 MAIL.example.com
$ host -t a mail.example.com
mail.example.com has address aa.bb.cc.dd
$ cat /etc/postfix/main.cf | grep myhostname
smtpd_banner = $myhostname ESMTP $mail_name
myhostname = example.com
mydestination = $myhostname, example.com, mail.example.com, localhost.example.com, localhost
| Unable to send out emails from my Linux Host |
1,396,426,859,000 |
I'd like to connect to our mail server via POP3, look for a certain pass phrase in the subject and if found then run a script.
How can I achieve this with BASH other than awkwardly scripting Telnet?
Thanks!
|
The typical tool to query POP3 servers from the commandline is fetchmail which you can instruct to leave the original messages on the mail server (the 'keep' option or nokeep to empty the mailbox after downloading the messages) and then procmail is the typical mail filter, which can be used to trigger your script.
A sample .fetchmailrc would be someting like:
poll pop.example.com with proto pop3:
user "username.on.example" there has password "S3cr3t"
is herman here and wants ssl nokeep
mda "/usr/bin/procmail -t /home/herman/.procmailrc.pop.example.com"
And the .procmailrc.pop.example.com file contains a matching rule on a specific Subject: line to trigger your script. The complete message will be passed as STDIN to the script as normally scripts would actually do something with an email message.
:0
^Subject: passphrase
| /home/herman/bin/script
| Querying a remote POP3 Mail server using BASH |
1,396,426,859,000 |
I have a Perl script that uses NET::IMAPClient and MIME::Parser which simply reads new emails from an IMAP server and saves any attachments to disk.
My question is: what is the best way to run this script as soon as there's new email? I can use cron to periodically run the script, I could check every few seconds even, but I suspect there is a better way.
Ideally I would act upon the receiving of an email immediately, like a system event. What are common software and techniques to achieve this? I'm using a Debian system.
|
In general you keep checking for e-mail unless, as mentioned by @JoelDavis, the server can be extended with some push command.
Further if your e-mail server supports it one can make use of the IDLE extension for IMAP4:
https://www.rfc-editor.org/rfc/rfc2177
http://en.wikipedia.org/wiki/IMAP_IDLE
The IMAPClient has native support for IDLE:
http://search.cpan.org/~djkernen/Mail-IMAPClient-2.2.9/IMAPClient.pod#idle
| Receiving emails over IMAP and parsing with a script with minimal delay |
1,396,426,859,000 |
I am struggling with configuring two mails for two different users in Ubuntu.
Like if I login with User1 then whenever I use the command mail, it should send mail from [email protected].
And when User2 logins with its credentials then it should send mail from [email protected].
Currently I've changed my /etc/ssmtp/ssmtp.conf for my Gmail id.
But when I send mail from a different user, the same mail id is been used.
Can anyone please provide any pointer or links?
|
If you're using the mail command (aka mailx) you should be able to add this to the ~/.mailrc file for each user:
set from="[email protected]"
mutt follows the same syntax except ~/.muttrc is the file you edit.
| How can I configure two mails for two different users in Ubuntu |
1,396,426,859,000 |
I have been using a perl script to archive mail found here
The script uses ctime to process and decide which month sub folder to place mail. In most cases this is fine since the ctime = mtime and therefore the mails are archived by the month that they were sent or received.
But I have found occasions when it is not good to run the script.
Say for example a user moves mail back into the inbox or mail has been recovered from a backup into the inbox. If the script processes the touched mail it will move mail into a month it was touched not the time it was sent/received.
Is it not better to process mails by mtime ?
In other words what is the better POSIX qw I should use ?
|
I work with procmail and Dovecot, but the maildir structure is fairly standardized.
If you are trying to archive by date you may want to verify the Date from the headers. Reading from the top of the headers the first date you find should be very accurate. My messages have three fields which can be used Delivery-Date:, the Received: headers, and the Date: header. For received messages, the Delivery-Date: or first Received: header will have the appropriate date. For sent messages, you are likely to have only the Date: header, which may reflect the time of the system that created it, not your mail server. You may want to flag messages which don't have a usable date in the headers.
ctime should usually be the date of the message, but there are cases where a new copy of the message is created when it is moved or copied. Normally these actions take place by relinking the file to the correct directory.
EDIT: This script will print a list of messages with the first date in the file. It matches on the RFC date format. The regex may not be the best.
#!/usr/bin/perl
%months = ( 'Jan'=>'01', 'Feb'=>'02', 'Mar'=>'03', 'Apr'=>'04',
'May'=>'05', 'Jun'=>'06', 'Jul'=>'07', 'Aug'=>'08',
'Sep'=>'09', 'Oct'=>'10', 'Nov'=>'11', 'Dec'=>'12' );
foreach $filename (@ARGV) {
open( MESSAGE, $filename);
while (<MESSAGE>) {
if ( m/[A-Z][a-z][a-z], ([1230][0-9]) ([A-Z][a-z][a-z]) ([12][0-9][0-9][0-9])/ ) {
print "$3-$months{$2}-$1 $filename\n";
last
}
if ( m/^$/ ) { # End of header
print "-No--Date- $filename\n";
last
}
}
close MESSAGE;
}
# EOF
| Is it better to archive/move mail based on mtime or ctime? |
1,396,426,859,000 |
I'm looking for a simple smtp daemon, that supports aliases (due to issues with daemons, that refuse to send emails to anyone else than root).
If you don't know msmtp, then basically, I just want to configure an external SMTP that will handle all mail delivery.
|
msmtp seems to understand aliases, see http://msmtp.sourceforge.net/doc/msmtp.html#aliases . It seems just a matter of correct configuration.
| msmtp alternative that understands /etc/aliases |
1,396,426,859,000 |
I am trying to set up postfix with dovecot. I can telnet to localhost 25 and send a message to accounts on the server.
However, when I try to telnet to port 25 on this server from another server I get "421 Cannot connect to SMTP server" ... "connect error 10060".
The firewall is open right now:
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
Is there some setting in main.cf which tells it whether or not it should listen on port 25 or 587 or whatever?
|
The problem was that my MX records were not set up properly on my domain. The port 25 thing was a red herring. Godaddy just forbids servers from directly connecting to port 25 on other Godaddy servers.
| postfix doesn't respond on 25 from external server |
1,396,426,859,000 |
I am using a university server that runs linux (Ubuntu 16.04). I am trying to use this server to send email messages (using python, code below), but apparently outgoing SMTP connections are blocked (I say this because the code works on my mac, it only hangs on the server). Is there any way to unblock them?
I asked my system administrator, of course, but I figured that there may be something I can do in the meanwhile. I already had to add exports in order to make the server connect to the internet; in particular I added this to .bash_profile :
export https_proxy='...'
export http_proxy='...'
It is likely that I have to something like that to make it work? I read on a webpage (from the university) that I need to have " SMTP Authentification (SMTP AUTH) enabled" in order to be able to send emails. But looking online did not bring up anything useful. What does it mean to be SMTP AUTH enabled? Does it mean to connect using a secure connection when connecting to the email server?
This is the python code I use to send emails:
server = smtplib.SMTP_SSL(smtp_ssl_host, smtp_ssl_port) <--- this is where is hangs
server.login(username, password)
server.sendmail(username, targets, msg.as_string())
server.quit()
As a note, I am using my yandex account to send these emails
|
As I mention in my comment there are really several questions being asked. I will talk here a little bit about the port 25 issue.
Port 25 is the standard unencrypted SMTP port and it is quite common for system administrators to configure an organization's firewall to block outbound traffic on that port. This is done for two reasons primarily:
To prevent malware, rogue software, spammers, etc. from sending email for nefarious
purposes.
To prevent legitimate users from sending email over an unencrypted channel.
The second one presumes that email sent over an encrypted connection (e.g. using SSL/TLS) is allowed by administrators for authorized users. The standard port for secure outbound SMTP is 587. If in your case this is allowed then that solves your problem. Establish an encrypted connection to your SMTP relay server over port 587. You will have to figure out how to do this in your code (or ask how separately/somewhere else).
Unfortunately, #1 often supersedes #2 and even secured email communications are not allowed by admins. If so, check whether your email provider (whoever mantains the SMTP relay) accepts traffic on alternate ports. For instance, some will give the option of using port 10025. Alternatively, there are third party email providers that can forward emails. That is they accept email on port 10025 and simply forward it to your primary provider's relay on port 25. Here's one example, first one my search turned up: "Alternate-port SMTP" service. This one has a fee. You may be able to find someone offering this for free (for low-volume, at least).
Or perhaps your administrator allows special exceptions to the policy. For instance, if you work for a company and demonstrate that the access is critical for the business they may allow the traffic on 25/587 for a limited number of originating hosts and/or for a specific SMTP relay address.
If you're still not successful then your next best bet is probably SSH tunnelling. You will need access to some machine outside of your firewall that runs an SSH server (e.g. sshd). Then you can set up a special kind of connection that listens on one port and forwards outbound to another port on another host somewhere. I won't go into the details of how to do this because there are already many descriptions online.
Update: I should add that if you use an alternate port or set up an SSH tunnel without discussing with your admin and they find out later there's a chance they may not look too kindly on it. If they're not happy you can kiss that option goodbye. On the other hand if you discuss it with them ahead of time they might forbid it outright. You'll have to weigh your options. As long as what you do does not negatively impact security a reasonable admin would be okay with it. They're not all reasonable, though. :)
| How to enable SMTP forwarding? |
1,396,426,859,000 |
I'm trying to diagnose a problem with certain email addresses possibly being blocked on my server. I'm running PHP 5.3 on CentOS 5.7. The php.ini file lists a sendmail_path of /usr/sbin/sendmail -t -i, which when run in CLI hangs there. I've noticed that qmail is installed on my server, too, but I don't know if PHP is using it or not.
How do I find out which MTAs (i.e. sendmail, qmail, etc) PHP is using?
|
TL;DR: PHP doesn't care about what MTA you're using.
Longer explanation: this goes way back almost as far as the POSIX standards themselves, but every properly written MTA will provide a binary named sendmail that will behave exactly as the "official" sendmail program would be expected to behave.
As a result, every unix program or daemon that, for one reason or other, finds itself needing to email someone, knows they can just call /usr/sbin/sendmail with known options, and be confident that whatever MTA was installed will know what to do with the message from there on in.
As such, unless you use a specific SMTP PHP module and explicitly to use different mail settings (generally, a remote server/port with or without TLS and/or authentication), it will just call /usr/sbin/sendmail and let the underlying distribution worry about what happens next.
If your mail isn't arriving, I recommend you check the error logs of the MTA (usually in /var/log/mail.* but depends on your distribution and MTA) for answers.
| What Mail Transfer Agents is PHP using? |
1,396,426,859,000 |
I'm using fetchmail to download email, and using procmail for delivery as the mda. I'd like them to be delivered for use with mh, but procmail seems to deliver them in a manner that mh doesn't understand: I get subdirectories new/ cur/ and tmp/ with files in new/ named something like 1484079635.67044_0.HOSTNAME
If I rename these files to just integers and move them up one directory, mh will pick them up fine. I'd like to be able to do this automatically, as well as to maintain the sequence from the last fetchmail run.
fetchmail config:
set logfile /path/to/fetchmail.log
set no bouncemail
poll "imap.gmail.com"
protocol imap
username "USER"
password "PASSWORD"
fetchall
keep
ssl
mda "/path/to/procmail -m /path/to/.procmailrc"
procmail config:
LOGFILE=$HOME/procmail.log
VERBOSE=on
DELIVERED=yes
MAILDIR=$HOME/Mail/.
DEFAULT=inbox/
|
Your DEFAULT=inbox/ says that mail should be delivered to a Maildir mailbox (with subdirectories cur, new and tmp). This mailbox is located in $HOME/Mail/. according to the MAILDIR variable.
To deliver to an MH mailbox instead, you should set DEFAULT to inbox/. (note the dot at the end). MAILDIR can be set to $HOME/Mail.
In short:
The final mailbox path has / at the end: Maildir mailbox
... has /. at the end: MH mailbox
... has none of the above: Ordinary Unix mbox mailbox.
See the procmailrc(5) manual.
| How do you use procmail mda to deliver files to be read by mh? |
1,396,426,859,000 |
I am using a Debian Jessie server and have setup exim4 to send me emails instead of postfix or sendmail.
Thats when I started getting loads of emails as follows:
First:
Title: * SECURITY information for vultr.guest *
Body: vultr.guest: Dec 7 12:13:29 : root : unable to resolve host vultr.guest
Second:
Title: Cron test -x /etc/init.d/sendmail && /usr/share/sendmail/sendmail cron-msp
Body:
This is an automatically generated Delivery Status Notification
THIS IS A WARNING MESSAGE ONLY.
YOU DO NOT NEED TO RESEND YOUR MESSAGE.
Delivery to the following recipient has been delayed:
[email protected]
Message will be retried for 2 more day(s)
Technical details of temporary failure:
The recipient server did not accept our requests to connect. Learn more at https://support.google.com/mail/answer/7720
[(10) example.com. [xxx.xxx.xxx.90]:25: socket error]
----- Original message -----
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20120113;
h=from:to:subject:mime-version:content-type:content-transfer-encoding
:message-id:date;
bh=k/8GlT8DBvBIJzBOOfw8qR0kGPzj7m9ZR/aj+JOKBhg=;
b=eA6kpVtS0eNBO0CFBfLzlnaYwZ9/GubMaWTGUkG4MaxbNy55YxY2jZAuh3RHI2mo8Q
qp5OmKihchYTgCxcAx0xvJaXuuxDhoT9dCJ6YEIzqjmypWjpUEqoXkNu7uKU4Cd1vTfS
5/dSvE7zVE6TYe4L18vrOiYBEUNrJQ3lTdv//RrlHZs/f62GorIyMHgVL4XvkVNLWF/K
lK9SSybf9ee3KTKUxurBm1Tyah62Gk4/869Hynr1QEAjSAzM8sSKDyKH/KOZ06sDWtPQ
jE0Agxffk8RkhsFkEtIbpZBfS/zagGZ8+CXsGqR9541ylMAHGOGeYtRp4oiB8tVP2Sbv
h4Rw==
X-Received: by 10.129.114.10 with SMTP id n10mr3081975ywc.0.1449600002717;
Tue, 08 Dec 2015 10:40:02 -0800 (PST)
Return-Path: <[email protected]>
Received: from vultr.guest ([104.156.246.90])
by smtp.gmail.com with ESMTPSA id f203sm2998216ywf.45.2015.12.08.10.40.02
for <[email protected]>
(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
Tue, 08 Dec 2015 10:40:02 -0800 (PST)
From: Cron Daemon <[email protected]>
X-Google-Original-From: [email protected] (Cron Daemon)
Received: from smmsp by vultr.guest with local (Exim 4.84)
(envelope-from <[email protected]>)
id 1a6NBB-0007Vu-Os
for [email protected]; Tue, 08 Dec 2015 13:40:01 -0500
To: [email protected]
Subject: Cron <smmsp@vultr> test -x /etc/init.d/sendmail && /usr/share/sendmail/sendmail cron-msp
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Cron-Env: <MAILTO=root>
X-Cron-Env: <SHELL=/bin/sh>
X-Cron-Env: <HOME=/var/lib/sendmail>
X-Cron-Env: <PATH=/usr/bin:/bin>
X-Cron-Env: <LOGNAME=smmsp>
Message-Id: <[email protected]>
Date: Tue, 08 Dec 2015 13:40:01 -0500
I edited /etc/cron.d/sendmail and first tried to change the MAILTO= line from root to my gmail address. That did not help. So I commented that line out, and the
*/20 * * * * smmsp test -x /etc/init.d/sendmail && /usr/share/sendmail/sendmail cron-msp
That made it stop from sending me emails every 20 minutes with junk. But I still get many and often emails with the
Subject: * SECURITY information for vultr.guest *
Body:
This is an automatically generated Delivery Status Notification
THIS IS A WARNING MESSAGE ONLY.
YOU DO NOT NEED TO RESEND YOUR MESSAGE.
Delivery to the following recipient has been delayed:
[email protected]
Message will be retried for 1 more day(s)
Technical details of temporary failure:
The recipient server did not accept our requests to connect. Learn more at https://support.google.com/mail/answer/7720
[(10) example.com. [xxx.xxx.xxx.90]:25: socket error]
I did modify /etc/hostname and removed vultr.guest and replaced it with example.com. And in /etc/hosts I only have:
127.0.0.1 localhost
127.0.1.1 install.install install
# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
What did I configure wrong? And how can I fix it?
UPDATE: The /etc/exim4/update-exim4.conf.conf contents are:
dc_eximconfig_configtype='satellite'
dc_other_hostnames=''
dc_local_interfaces='127.0.0.1 ; ::1'
dc_readhost=''
dc_relay_domains=''
dc_minimaldns='false'
dc_relay_nets=''
dc_smarthost='smtp.gmail.com::587'
CFILEMODE='644'
dc_use_split_config='false'
dc_hide_mailname='true'
dc_mailname_in_oh='true'
dc_localdelivery='mail_spool'
|
It seems to me that VULTR's tutorial is not correct. When you configure exim4 by dpkg-reconfigure exim4-config, they tell you to choose mail sent by smarthost; no local mail, and configure it as follows:
System mail name: YOUR_HOSTNAME
IP-addresses to listen on for incoming SMTP connections: 127.0.0.1 ; ::1
Other destinations for which mail is accepted: <BLANK>
Visible domain name for local users: <BLANK>
IP address or host name of the outgoing smarthost: smtp.gmail.com::587
Keep number of DNS-queries minimal (Dial-on-Demand)? No
Split configuration into small files? No
Root and postmaster mail recipient: <BLANK>
But I doubt that the Other destinations for which mail is accepted: should be BLANK. If you configure it, add your email address, or your example.com domain/email.
Otherwise, try to edit the following locations:
/etc/aliases:
root: [email protected]
mailer-daemon: [email protected]
postmaster: [email protected]
nobody: [email protected]
hostmaster: [email protected]
usenet: [email protected]
news: [email protected]
webmaster: [email protected]
www: [email protected]
www-data: [email protected]
ftp: [email protected]
abuse: [email protected]
noc: [email protected]
security: [email protected]
*: [email protected]
and edit /etc/email-addresses to include the user:email combo:
root: [email protected]
mail: [email protected]
*: [email protected]
Then restart
service sendmail restart and service exim4 restart
| Delivery Status Notification (Delay) emails from my server? |
1,396,426,859,000 |
In Heirloom mailx, one can specify "from address" (-r) and "reply-to address" (-R). What is the difference between the two?
|
From RFC 2822 para 3.6.2:
When the "Reply-To:" field is present, it indicates the mailbox(es) to
which the author of the message suggests that replies be sent. In the
absence of the "Reply-To:" field, replies SHOULD by default be sent to
the mailbox(es) specified in the "From:" field unless otherwise
specified by the person composing the reply.
You can compose and send an email (from you) and have the reply sent to some other mailbox (your secretary maybe) or a group mailbox.
| Difference between Reply-To address and From address in an email |
1,396,426,859,000 |
I'm trying to send a log file every 24 hours or so via email. Currently I am using mutt for this. You can call mutt like this:
mutt -s "Log" -a file_attachment [email protected]
I know I can list the most recently created files using find and mtime but I want to be able to define a bash function that will find the most recently created file in a directory and then send it as an email attachment.
How can I accomplish this?
|
With zsh:
mutt -s "Log" -a /path/to/*.log(.om[1]) [email protected]
That uses zsh glob qualifiers. While other shell globs can only generate filenames based on their name, in zsh, you can use those qualifiers ((.om[1]) above), to select based on file attributes (type, size, times, permissions...) or other criteria of your own, affect the order, apply various transformations, or select a range.
In this case we use these qualifiers:
.: select only regular files.
om: order by modification time (newest first)
[1]: select only the first one.
Note that if there are no log files in /path/to, the glob will fail and the command will be aborted (as you'd expect, but other shells work differently).
GNUly, the equivalent would be something like:
latest=$(
find /path/to -maxdepth 1 -name '*.log' -printf '%T@:%p\0' |
sort -rzg | sed -z 's/^[^:]*://;q'
)
[ -n "$latest" ] &&
mutt -s "Log" -a "$latest" [email protected]
| Sending most recently created file via Email |
1,396,426,859,000 |
I successfully installed and configured Exim4 on my Debian/Squeeze machine, so now I am able to send outgoing emails with a command like this:
exim4 -v [email protected]
From: [email protected]
To: [email protected]
Subject: Test email
Body of the email
.
Is there a similar command to RETRIEVE emails into the Maildir folder?
NOTE: The emails I want to retrieve are from another email server on the same network. Typically, I use a regular email client to connect to the server via IMAP and SSL.
|
While it is quite viable to use exim to send emails, your question reads like you are using the wrong tools for what ever your overall goal is. exim cannot retrieve emails from another server, because exim is a mail transfer agent, cf. RFC 821. Accessing a users mailbox and retrieving email (what you want to do) is a completely different thing than sending and relaying emails (what exim has been developed for). To sync mailboxes you can use for example imapsync or offlineimap.
| How do I retrieve email with Exim4? |
1,396,426,859,000 |
The content of my signature file is
John Doe
but neomutt appends it to mails as
--
John Doe
How can I get rid of the --?
|
This is controlled by the sig_dashes config option so simply add unset sig_dashes to your neomuttrc config file, see neomutt documentation for more information.
| Remove -- from signature in neomutt |
1,605,590,299,000 |
Email lists keep their emails in archives. Sometimes I want to search through those archive but I don't know how to do it. Of course I can open it one by one (actually month by month) and search the content, but it's nonsense to do that. This afternoon I read the README file for u-boot. IT says :
Where to get help:
==================
In case you have questions about, problems with or contributions for
U-Boot, you should send a message to the U-Boot mailing list at
<[email protected]>. There is also an archive of previous traffic
on the mailing list - please search the archive before asking FAQ's.
Please see https://lists.denx.de/pipermail/u-boot and
https://marc.info/?l=u-boot
But when I see https://lists.denx.de/pipermail/u-boot, it's just emails archived by the past months. How can I search through them? For example if I want to search through, say, "lan9220"?
|
Some list archives have integrated search functions, the second one you mentioned has it: https://marc.info/?l=u-boot&w=2&r=1&s=lan9220&q=b but the easiest way would IMHO be google: "lan9220" site:https://lists.denx.de/pipermail/u-boot/
You could also download the compressed archives for every month, these contain just a single text file so it should be quite easy to create a script to download and extract all of them and then use grep to search through them, but it sounds like overkill -- I would just use google.
| how to search through a public email archive? |
1,605,590,299,000 |
My mail needs are simple. I only want to send system notifications via a non-SMTP hook. (The hook sends out to a mailgun account over https).
I imagine all linux programs (e.g. cron) calling something like "(send)mail [options] content". Or are they calling SMTP service directly?
If they are calling "(send)mail [options] content" then it should be easy to adapt/write a shell script or program to convert that call to my hook.
I did find this reference:
Linux Standard Base PDA Specification 3.0RC1
Synopsis /usr/sbin/sendmail [options] [address...] Description
To deliver electronic mail (email), applications shall support the
interface provided by sendmail (described here). This interface shall
be the default delivery method for applications.
This program sends an email message to one or more recipients, routing
the message as necessary. This program is not intended as a user
interface routine.
With no options, sendmail reads its standard input up to an
end-of-file or a line consisting only of a single dot and sends a copy
of the message found there to all of the addresses listed. It
determines the network(s) to use based on the syntax and contents of
the addresses.
If an address is preceded by a backslash, '\', it is unspecified if
the address is subject to local alias expansion.
The format of messages shall be as defined in RFC 2822:Internet
Message Format.
Options
-bm
read mail from standard input and deliver it to the recipient addresses. This is the default mode of operation.
... (etc) ...
Is this what I'm looking for? In other words, a program called "sendmail" is invoked, and stdin will be mail content compliant with RFC2882.
Note: I know there is program called "nullmail" but I believe that sends outbound using SMTP, which I don't want. May it could be adapted to for the RFC2822 parsing front end.
Thanks to @ivanivan for informing that sendmail is the de facto interface.
Therefore, to send all notifications to a fixed email address via a free Mailgun account (and logging it as well), the following code will suffice:
#!/bin/bash
Logfile=/var/log/sendmail-dummy.log
Tmpf=$(mktemp -t sendmail-dummy-XXXXXX.txt)
TmpCurlLog=$(mktemp -t sendmail-dummy-XXXXXX.txt)
trap 'rm -f ${Tmpf} ${TmpCurlLog}' 0
Date=$(date +%F-%T)
echo "[$Date] Caller: $(caller)" >>${Tmpf}
echo "[$Date] Caller: $0" >>${Tmpf}
echo "[$Date] Args: ${@}" >>${Tmpf}
echo "[$Date] Content:" >>${Tmpf}
while read line ; do
echo $line >>${Tmpf}
done
echo "" >>${Tmpf}
MailgunDomain="example.com"
# The key is assigned by Mailgun when signing up for free account
Key="key-<some hex string>"
# not sure if the from-mail-addr has to belong to example.com
FromAddr="[email protected]"
# the to-mail-addr must be registered on Mailgun by showing you own it
ToAddr="[email protected]"
curl -s --user "api:${Key}" "https://api.mailgun.net/v3/${MailgunDomain}/messages" \
-F from=" <$FromAddr>" \
-F to="${ToAddr}" \
-F subject='Notification' \
-F text="<${Tmpf}" > ${TmpCurlLog}
rc=$?
echo "----------------------------------------" >> ${Logfile}
echo "[$Date] curl result = $rc" >> ${Logfile}
cat ${Tmpf} >> ${Logfile}
echo "----------------------------------------" >> ${Logfile}
cat ${TmpCurlLog} >> ${Logfile}
echo "" >> ${Logfile}
echo "++++++++++++++++++++++++++++++++++++++++" >> ${Logfile}
Available as a gist
As can be seen, it doesn't try to interpret sendmail args or extract semantic information from the body. Just sends all that raw information as the preamble of the mail body.
The drawback is depending on the free, non open software service of a commercial venture, which might disappear someday. But, no real loss considering the simplicity.
As background info, I removed postfix (a sendmail replacement) because it was causing network failure on reboot. This happened possibly as some obscure side effect of having run a virtual machine with systemd-nspawn. (systemd-nspawn worked perfectly by the way). Considering the sendmail functionality was overkill for the simple need to send out system notifications, I was happy to dump the sendmail functionality in favor of the above solution, and avoid debugging.
|
Yes. Good old sendmail was one of the early mailers and the behavior and options it provided became ingrained into the various *nix and *nix-like systems (expensive Unix, the BSDs, Linux, the Hurd, etc) for both internal-to-system messages (cron output, user to user, root to user, etc) and for network based mail. It can be configured to listen on network interfaces and act as a SMTP server, or in the case of internal-to-system stuff it can be called directly at /usr/bin/sendmail or a similar location.
Now that we have plenty of other mail servers to choose from - Postfix, Exim, etc - either two mail systems have to co-exist, OR the other mail system has to provide the exact same options/behavior that sendmail does to keep from breaking just about anything having to do with internal-to-system messages.
So you have a few choices -
Install and/or configure some mailer, and set it up to act as a smarthost or relayhost. What this will do is accept mail, and if it isn't for a local recipient the smtpd will act as a mail client and connect to your ISPs (or other provider) mail server to send the mail out. A quick google shows that setting up Postfix to use mailgun is well documented and fairly straight forward as far as mail server config goes - I didn't check other mailer options simply because I like postfix. Note local recipients can be aliased to other addresses, or a ~/.forward file can be employed...
Find some other utility that gives a replacement /usr/bin/sendmail that is compliant and is configurable to send mail via a HTTPS call (I'm guessing API call to a RESTful like service?)
If that won't do, then you have one more option - fire up your favorite text editor and check your include path. Write your own implementation of the sendmail specified behavior. The man page should give you a good idea of the behaviors and options other programs/systems (like cron) would expect to be there, and you can always examine the source if needed.
| What is the standard interface used by linux system programs to send notification mail? |
1,605,590,299,000 |
I am working with a locked-down RHEL box.
The goal is to send an email with a file attached.
The only mail service available is sendmail (cannnot use sendemail, mail, mailx, mutt, etc.)
In addition, the uuencode command cannot be found and I cannot install sharutils.
I have verified that sendmail works with the simple test below:
echo "Subject: testing" | sendmail -v [email protected]
I have tried the command below but it just creates a dead.letter:
echo "Subject: testing" | sendmail /a /tmp/test.txt [email protected]
What is the correct way to send a file from the server using sendmail given the constaints?
|
The work-around was to use openssl base64 encoding like so:
( echo "to: [email protected]"
echo "subject: Message from the server"
echo "mime-version: 1.0"
echo "content-type: multipart/related; boundary=messageBoundary"
echo
echo "--messageBoundary"
echo "content-type: text/plain"
echo
echo "Please find the document attached."
echo
echo "--messageBoundary"
echo "content-type: text/plain; name=test.txt"
echo "content-transfer-encoding: base64"
echo
openssl base64 < /tmp/test.txt) | sendmail -t -i
| How can I add an attachment with Sendmail (limited options)? |
1,605,590,299,000 |
I have a standard Debian running with IP 203.0.113.2, with Postfix installed (default config).
I tried sending an email, with a Gmail address, to [email protected].
When doing
$ mail
I don't see this email.
How to make my server accept emails sent to [email protected] from outside?
PS: I had a response from Gmail: Bad recipient address syntax.
PS2: I know it's better to have a domain name, but this is just for a sandbox server
|
The Bad recipient address syntax response from Gmail indicates that the problem is not with your postfix server. Rather, Gmail expects a domain name and does not accept an IP address. The simplest solution is probably to set up a domain name, configure the MX record on the DNS to point to the Postfix server, and then configure postfix to accept emails for the domain.
Alternatively, you could set up a local SMTP server on the machine that you are using to send the test emails and then configure the MTA to send email through the local SMTP server.
| Email not arriving to my server, with address root@<IP> |
1,605,590,299,000 |
I have the following query in shell script:
mysql -e "use hive; select DISTINCT TAB.DB_NAME, TAB.TABLE_NAME from
TABLE_PARAMS INNER JOIN TAB ON TABLE_PARAMS.TBL_ID = TAB.TBL_ID
where PARAM_KEY = 'numRows'" -u root -p$Pass
If I run this on the command line, the formatting is great. However when I email the results using
| mail -s "Missing compute stats" [email protected] >/dev/null 2>&1
Its all over the place. Is there an easy way to format the results in the email?
What I have tried: putting \G at the end of a query which works okay, but I'd rather keep it in vertical format.
Thank you
EDIT: Here is the result in my email
DB_NAME TABLE_NAME
customer_touch tbldatelookup
customer_touch_archive_bb bb_comm_camphist_ltd
customer_touch_archive_bb bb_comm_camphist033114
customer_touch_archive_bb bb_ed_camphist
customer_touch_archive_bb camphist
customer_touch_archive_bb cd_drop
What I want to see:
+---------------------------------+-----------------------------+
| DB_NAME | TABLE_NAME |
+---------------------------------+-----------------------------+
| customer_touch | tbldatelookup |
| customer_touch_archive_bb | bb_comm_chist_ltd |
| customer_touch_archive_bb | st_cla_sa |
| customer_touch_archive_bb | st_cla_a |
| customer_touchpoint_archive_stg | tier_r_prod_h27 |
+---------------------------------+-----------------------------+
|
Use --table or -t with the mysql client:
mysql -t -D hive -u root -p"$Pass" \
-e "SELECT DISTINCT TAB.DB_NAME, TAB.TABLE_NAME
FROM TABLE_PARAMS
INNER JOIN TAB ON TABLE_PARAMS.TBL_ID = TAB.TBL_ID
WHERE PARAM_KEY = 'numRows'" |
mail -s etc. etc.
(By the way, isn't that SQL a bit wonky? Where's TAB coming from?)
From the manual:
--table, -t
Display output in table format. This is the default for interactive
use, but can be used to produce table output in batch mode.
| mysql query formatting in email |
1,605,590,299,000 |
We are developing a system that sends a lot of e-mails. For our testing purposes we would like to set up a mail server (smarthost) that accepts ALL mail to ALL domains, and then simply saves the mails to the local file system.
I would like hints in how to set up such a server.
|
You can deploy Postfix mail server with little changes of default configuration. See below.
Create transport map and open to edit:
> /etc/postfix/transport
Add the following:
* local:some_local_user
In main.cf:
luser_relay = some_local_user@your_domain.tld
transport_maps = hash:/etc/postfix/transport
Replace some_local_user with any existing user on your server.
Run one by one:
postmap /etc/postfix/transport
postmap /etc/aliases
service postfix reload
Check working. To do this you need to connect to your server with any mail client (or with your app) to 25 tcp port.
If you are a developer then you may be familar with Docker. And you can use Docker to build container with Postfix & Dovecot.
You can use this source to build image and run container.
| Mail server to receive all mail to file system |
1,605,590,299,000 |
To clarify the intent of my question, let me make an analogy to the question "What is the simplest way to put data into a file?"
The usual way that GUI users will put data into a (new) file is to double click on a program icon, click the menu bar, click "new," click "save," click to choose a location for the file, type the name of the file, and click the "save" button.
The simplest way to put data into a file (from the command line) is: echo whatever > file
As I understand it, email addresses originally referred to actual usernames on machines and actual machine names. So if the IP of the machine you logged into (say, at a university) was 7.7.7.7, and if you logged in with the username pete, you could be reached by email sent to [email protected]. (Is that right?)
The point is that the email was directly associated with your user name and computer. Hence why an email I received from the command line of a server at work showed as sent from "[email protected]".
So, what is the minimal setup needed to send and receive email between two computers (directly to command line user accounts), with no third computer or Google server or MS Exchange or whatever else?
(For UNIX and Linux systems, obviously. Mostly interested in Linux, though if Mac is included that would be nice.)
Note: If there are a huge number of different ways to do it so this is "too broad," please help me edit the question. I'm not asking for software recommendations, I'm asking for how the parts fit together at the simplest level without proxies and relays and other complexities.
Edit: The answers so far are helpful but omit any details on how to receive the email. It seems that the Google search phrase I was missing is "minimal MTA Linux" but if anyone would like to answer more fully I would love it. (If not I'll have to work it out and eventually self-answer.) :)
|
I'll assume that the two users and their two computers are independent, e.g. that user A can't simply access user B's computer and write files into the filesystem.
That means that the minimal config is one where A can connect to the MTA on B's machine, and the MTA considers itself responsible for email to B's machine/domain.
This means that when A says it has a message for B, the MTA takes responsibility for securing the message to B's mailbox.
Going down a level, this means:
A connects to the listener port of B's MTA (traditionally port TCP/25)
A identifies the sender and recipient, and B's MTA says ok
A passes the message, and B's MTA sends a response that indicates it takes responsibility
B's MTA then writes the message to disk (B's mailbox)
There are hacky ways past this, which I mention in passing. If A is root on B's machine, A can append a message directly to B's mailbox just by creating/editing a suitable file. For example by editing an mbox file. But that's a kinda pathological case.
| What is the simplest way to email between two computers? |
1,605,590,299,000 |
I am using Centos 5.6 , trying to compile postfix-3.1.3 with EAI support. I am following this guide and executing
yum install libicu-devel "dependencies"
make makefiles
make install
After installation I got the following warning:
smtputf8_enable is true, but EAI support is not compiled in
Any advice ?
|
Postfix needs to be recompiled after the installation of libicu-devel. When this library is not available during compile time, postfix will not link against it.
| Compile postfix with EAI support |
1,605,590,299,000 |
I'm trying to set up nullmailer with Google Apps. I think I have properly configured Google Apps and /etc/nullmailer/remotes, but somehow I'm getting this error
Sending failed: Could not exec program
Here's a bit more verbosity:
# sudo -u mail nullmailer-send
Rescanning queue.
Starting delivery, 1 message(s) in queue.
Starting delivery: protocol: --port=587 host: smtp-relay.gmail.com file: 1470693591.47284
Sending failed: Could not exec program
Delivery complete, 1 message(s) remain.
And my remotes:
sudo cat /etc/nullmailer/remotes
smtp-relay.gmail.com --port=587 --starttls
(I have Google Apps relay access configured by IP, not user/pass.)
|
I had the same problem and found the solution by using strace on the nullmailer daemon process. It tried to execute /usr/lib/nullmailer/--starttls which lead me to double-check the remotes file format and have a look at that directory.
The solution is to add smtp to your remotes line:
smtp-relay.gmail.com smtp --port=587 --starttls
| nullmailer: Sending failed: Could not exec program |
1,605,590,299,000 |
I'm trying to modify a script which emails a user group the contents of a directory. The modification I'm looking for is to check the script below to see if it has valid output before sending.
The script is:
cd $foo/bar && ls | mail -s "Filenames in the \$foo/bar Directory" [email protected]
I want to test if the file is null before sending this email, as this will go on three dozen servers and many to the same person/people, so I don't want to send a bunch of blank emails (which is the status quo).
I have looked at other similar questions, but none of them quite scratch the itch. This one is closest:
https://stackoverflow.com/questions/1169612/how-can-i-write-a-shell-script-that-will-email-me-a-file-if-the-file-is-not-empt
but is for a file attached, which won't work. Also, man mail returns a -E flag that is supposed to perform the content check, but I've played with it and my version doesn't seem to support the -E option (which is not something that can readily be changed). I get an error mail: invalid option -- E.
Any help would be appreciated. It doesn't have to be a one liner, but that sure would help!
EDIT - I need the directories to be dismissed in the output check, if this is possible! I did not clarify this originally, but if $foo/bar has a directory of /errors can this be avoided?
|
You could trying testing with wc -l, something like:
cd $foo/bar && [ `ls | wc -l` -gt 0 ] && ls | mail
| Mail one liner to check if null before sending [duplicate] |
1,605,590,299,000 |
I want to send a mail to myself at the restart of a server. We use AWS, and a restart results in a changed internal 10.x.x.x address. This address has to be configured in Postgres and elsewhere, and this would be a nice reminder.
I found this solution, but when trying it I get the error that mail is not installed. Sendmail/postfix is installed.
@reboot echo "Server has restarted "`hostname` | mail -s "System Restart" [email protected]
Do I need to install mail-utils or can I do without using another solution?
|
The error simply means that the mail package is not installed or the mail script is not present on the system.
To resolve the issue, install the mailx or mailutils package depending on your distro.
As you have tagged CentOS in the question, so you need to install the mailx package.
$ sudo yum install mailx
Mailx is an enhanced mail command, which provides the functionality of the POSIX mailx command, as well as SysV mail and Berkeley Mail from which it is derived. Whereas, Mailutils provides a set of useful mail libraries, daemons, clients and servers for delivering and reading electronic mail.
Mailx is available for RHEL, CentOS, Scientific Linux or their
variants. Whereas, Mailutils provides a set of useful mail libraries,
daemons, clients and servers for delivering and reading electronic
mail. Mailutils is available in Debian, Ubuntu or their variants.
Check this link for more info about it.
| Send mail at startup |
1,605,590,299,000 |
I am setting up an email server for my personal domain. There will only be one user (me). I am running a DigitalOcean VPS on Arch, everything is up to date as of yesterday.
I have got postfix installed and running: when you send an email to my new address, it gets stored in /var/spool/mail/richard.
My problem is with dovecot. Here is a transcript of my interaction with it via telnet:
$ telnet microbug.uk imap
Trying 46.101.26.207...
Connected to microbug.uk.
Escape character is '^]'.
* OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE AUTH=PLAIN] Dovecot ready.
a1 login richard [password]
a1 OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE SORT SORT=DISPLAY THREAD=REFERENCES THREAD=REFS THREAD=ORDEREDSUBJECT MULTIAPPEND URL-PARTIAL CATENATE UNSELECT CHILDREN NAMESPACE UIDPLUS LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH ESORT SEARCHRES WITHIN CONTEXT=SEARCH LIST-STATUS BINARY MOVE SPECIAL-USE] Logged in
a2 list "" "*"
* LIST () "." INBOX
a2 NO [SERVERBUG] Internal error occurred. Refer to server log for more information. [2015-06-16 20:58:30] (0.002 secs).
systemctl status dovecot reveals that dovecot wants /var/spool/mail/richard to be a directory (?!):
$ systemctl status dovecot
* dovecot.service - Dovecot IMAP/POP3 email server
Loaded: loaded (/usr/lib/systemd/system/dovecot.service; enabled; vendor preset: disabled)
Active: active (running) since Tue 2015-06-16 19:23:18 UTC; 1h 40min ago
Main PID: 739 (dovecot)
CGroup: /system.slice/dovecot.service
|- 739 /usr/bin/dovecot -F
|- 740 dovecot/anvil
|-1396 dovecot/log
`-1423 dovecot/imap
Jun 16 20:47:20 server dovecot[1360]: imap-login: Login: user=<richard>, method=PLAIN, rip=86.6.26.155, lip=46.101.26.207, mpid=1365, session=<ezk7rqgYLQBWBhqb>
Jun 16 20:50:41 server dovecot[739]: master: Warning: SIGHUP received - reloading configuration
Jun 16 20:50:41 server dovecot[1360]: imap(richard): Server shutting down. in=52 out=1059
Jun 16 20:50:49 server dovecot[1396]: imap-login: Login: user=<richard>, method=PLAIN, rip=86.6.26.155, lip=46.101.26.207, mpid=1401, session=<0kquuqgYWwBWBhqb>
Jun 16 20:53:31 server dovecot[1396]: imap(richard): Error: opendir(/var/spool/mail/richard) failed: Not a directory
Jun 16 20:53:31 server dovecot[1396]: imap(richard): Error: opendir(/var/spool/mail/richard) failed: Not a directory
Jun 16 20:58:04 server dovecot[1396]: imap(richard): Connection closed in=87 out=1077
Jun 16 20:58:23 server dovecot[1396]: imap-login: Login: user=<richard>, method=PLAIN, rip=86.6.26.155, lip=46.101.26.207, mpid=1423, session=<K2y+1agY/QBWBhqb>
Jun 16 20:58:30 server dovecot[1396]: imap(richard): Error: opendir(/var/spool/mail/richard) failed: Not a directory
Jun 16 20:58:30 server dovecot[1396]: imap(richard): Error: opendir(/var/spool/mail/richard) failed: Not a directory
Making /var/spool/mail/richard a directory stops dovecot complaining... but then postfix can't deliver mail.
postconf -n (postfix settings which are different to the default):
alias_database = $alias_maps
alias_maps = hash:/etc/postfix/aliases
command_directory = /usr/bin
compatibility_level = 2
daemon_directory = /usr/lib/postfix/bin
data_directory = /var/lib/postfix
debug_peer_level = 2
debugger_command = PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin ddd $daemon_directory/$process_name $process_id & sleep 5
html_directory = no
inet_protocols = ipv4
mail_owner = postfix
mail_spool_directory = /var/spool/mail
mailq_path = /usr/bin/mailq
manpage_directory = /usr/share/man
meta_directory = /etc/postfix
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
myhostname = microbug.uk
mynetworks_style = host
myorigin = $mydomain
newaliases_path = /usr/bin/newaliases
notify_classes = bounce, data, delay, policy, protocol, resource, software
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix
sample_directory = /etc/postfix
sendmail_path = /usr/bin/sendmail
setgid_group = postdrop
shlib_directory = /usr/lib/postfix
unknown_local_recipient_reject_code = 550
doveconf -n (dovecot settings which are different to the default):
# 2.2.18: /etc/dovecot/dovecot.conf
# OS: Linux 4.0.5-1-ARCH x86_64 ext4
disable_plaintext_auth = no
mail_location = maildir:/var/spool/mail/%u
mail_temp_dir = /
namespace inbox {
inbox = yes
location =
mailbox Drafts {
special_use = \Drafts
}
mailbox Junk {
special_use = \Junk
}
mailbox Sent {
special_use = \Sent
}
mailbox "Sent Messages" {
special_use = \Sent
}
mailbox Trash {
special_use = \Trash
}
prefix =
}
passdb {
args = scheme=CRYPT username_format=%u /etc/dovecot/users
driver = passwd-file
}
protocols = imap
ssl = no
userdb {
args = username_format=%u /etc/dovecot/users
driver = passwd-file
}
Any help would be deeply appreciated! I can post additional config as required.
EDIT: added config files
(I know this config is insecure but when it's working I'll add SSL)
|
Postfix is delivering to a mailbox file rather than a Maildir.
Try something like this in Dovecot:
mail_location = mbox:~/mail:INBOX=/var/mail/%u
Alternatively, configure postfix to deliver to a Maildir with a command like:
sudo postconf -e "home_mailbox = Maildir/"
And configure Dovecot to use a Maildir by specifying:
mail_location = maildir:~/Maildir
Check the Dovecot documentation if you want to mix Maildir for folders and mbox format for your INBOX.
| How can I get dovecot to retrieve my email? |
1,605,590,299,000 |
I'm running Debian
I've set up ssmtp as my MTA and this works perfectly
I can send mail using both mail and mailx with a standard user account
BUT... When I run sudo apticron I get:
send-mail: RCPT TO:<[user]@[mydomain].com> (550 Sender verify failed)
Any ideas? (I've blanked the email details myself - that's not part of the error)
UPDATE:
When running mail or mailx as root, these break too! They only work when I run them under my standard user account.
Error message I receive as root when running:
echo "test" | mail -s "test" [user]@[mydomain].com
is same as with apticron:
RCPT TO:[user]@[mydomain]> (550 Sender verify failed)
UPDATE 2:
sudo mail -v etc... shows that the root user actually replaces the first part of the email address with 'root' despite /etc/ssmtp/ssmtp.conf specifying FromLineOverride=NO:
[<-] 220 and/or bulk e-mail.
[->] EHLO [user]@[mydomain].com
[<-] 250 HELP
[->] AUTH LOGIN
[<-] 334 VXNlcm5hbWU6
[->] [redacted Base64 username]
[<-] 334 UGFzc3dvcmQ6
[<-] 235 Authentication succeeded
[->] MAIL FROM:<root@[mydomain.com]>
[<-] 250 OK
[->] RCPT TO:<[user]@[mydomain].com>
[<-] 550 Sender verify failed
send-mail: RCPT TO:<[user]@[mydomain].com> (550 Sender verify failed)
EDIT:
I've removed previously pasted code from apticron as clearly the problem lies with root not being able to send emails (this is no longer limited to an individual program)
|
Your remote mail server doesn't believe root@yourdomain in the SMTP envelope¹ is a valid email address, so it's refusing messages from you. And that's where apticron is trying to send from, so it doesn't work.
ssmtp allows you to override the default email address and relay on a per-user basis in the /etc/ssmtp/revaliases file. You can use this to set an acceptable (to your mail relay) address for root, by adding a line like:
root:EMAIL@DOMAIN:RELAY-HOST:RELAY-PORT
replacing the all-caps portions with email address and relay host you'd like to use.
Note: Much of this was from troubleshooting in chat, starting around this message.
1Note that the SMTP "envelope" sender is different than the From: field that shows up in your mail client. Though if you're lucky it's preserved in a different header.
| root can't send mail (apticron) but user can (mail/mailx) |
1,605,590,299,000 |
Does such a thing exist? I'd be interested in something like:
You right-click a file in a file viewing manager, and click "gmail yourself this file". One click, and you're done.
You open up the command-line, and type something like gmail ~/file.txt and file.txt is instantly sent to your own account.
|
Well, this one is not exactly the way you want. But still it could be useful for the second option in your question.
Install the required packages.
sudo apt-get install msmtp-mta
Edit the following file to add the details. If the file doesn't exist, you could create it.
vi ~/.msmtprc
#Gmail account
defaults
logfile ~/msmtp.log
account gmail
auth on
host smtp.gmail.com
from [email protected]
auth on
tls on
tls_trust_file /usr/share/ca-certificates/mozilla/Equifax_Secure_CA.crt
user [email protected]
password your_gmail_password
port 587
account default : gmail
Change the permissions of the above file so that others couldn't read your user account details.
chmod 600 .msmtprc
Now, install a command line email program to write your email.
sudo apt-get install heirloom-mailx
Now, again edit/create the below file.
vi ~/.mailrc
Add the below entries to the above file.
set sendmail="/usr/bin/msmtp"
set message-sendmail-extra-arguments="-a gmail"
We are done to send email from the command line.
Testing
mail -a hello.txt -s "CHECKING" recipient-mail-id
ENTER THE MAIL CONTENTS HERE.
ctrl - d to finish the mail contents.
References
http://tuxtweaks.com/2012/10/send-gmail-from-the-linux-command-line/
| One-Click Script to Gmail Yourself a File |
1,605,590,299,000 |
I need to override default colors in received HTML emails. I have followed this Howto, and modified my userContent.css accordingly. Basically, I need white text on dark background:
$ cat userContent.css
body {
color: white !important;
background-color: #303030 !important;
}
td {
color: white !important;
background-color: black !important;
}
This works OK for the background color, but the my desired font color (white) is being ignored, even when I use !important.
How can I make sure, that all received HTML emails have white font on dark bacckground?
|
You have changed the colors only on two HTML elements (body and td). You may need to do that for other elements, or * for all elements.
| Thunderbird: Override colors in received HTML emails |
1,605,590,299,000 |
I'm trying to automatize the updates of debian system, without making upgrades. Then i'll send an e-mail to me, everytime there is an upgrade available.
I've tryied to do it with cron-apt, but i really don't like how the configuration is organized, that's why i would prefer using a (cleaner) cron job that launch the script.
looking around i found that piece of code (not mein) :
if [[ `apt-get update 2>&1 | grep Get` ]]; then
if [[ `apt-get --simulate dist-upgrade 2>&1 | grep Inst` ]]; then
apt-get --simulate dist-upgrade
fi
fi
From what i can understand, that script update the local packages list, and make a simulation of an eventual upgrade.
Now if it's possible i would like to send to me via email the output of the update, and of the upgrade-simulation. For acheave that i could use mail command:
sending first email:
apt-get update | mail -s "daily update report" [email protected]
second email:
apt-get --simulate dist-upgrade | mail -s "daily upgrade-simulation report" [email protected]
My main question is if there a better approach to do all this..?
Secondarely, I've tryied without succed to send everything in just one email, anybody know how i could do it?
|
Don't reinvent the wheel.
apt-get install apticron
Apticron is a simple script which sends daily emails about pending package updates such as security updates, properly handling packages on hold both by dselect and aptitude.
| automate updates with a bash script and cron |
1,605,590,299,000 |
I'm a bit confused how mail servers work, and the process of setting them up. Say I have an domain called example.com, and I have an A record for it. I'll be using postfix/dovecot for this setup along with an SSL certificate.
When setting all this up, do I create a new A record for mail.example.com, as well as a MX record for mail.example.com, and assign the cert to mail.example.com, even though all mail is being sent to example.com accounts? Will this work, or does everything need to be pointed to just example.com?
In all the documentation I've read, everything says set up the mail server as a subdomain, and assign all the hostnames, MX records, A records (for webmail), and SSL certs to that. Just want to make sure I'm on the right path here.
|
Yep, you've got it right. Do all of that.
Here's why:
Usually (and traditionally) example.com does not resolve to an actual host, or is the same as www. In order to decouple the domain name from the host that handles mail delivery for a domain name, a separate mail exchanger (MX) is designated.
When mail is destined to example.com the sending (or relaying) MTA will look up the MX for example.com. If more than one MX is returned connections will be attempted to each in priority order. When the sending MTA contacts the MX the hostname specified in the MX must match the certificate supplied by the server in order to validate properly.
If there are no MX records for example.com then the sending MTA look up the A record for and attempt to contact example.com directly. If there's no A or CNAME the message will be bounced.
| Mail Server Setup, MX Records, and Hostnames? |
1,605,590,299,000 |
I have a CentOS 6.3 server. I would like to create an email address like, for example, [email protected] that will be a special kind of email that will trigger a script.
For example: suppose I mail [email protected] and the subject is an IP address. I want the server to receive that mail, extract that IP from the subject and append it to a file.
How is this done on Linux? Can you guys tell me how this can be done?
|
There are two things involved with doing this:
How to get the email to the system
process the email to append info to a file
The first you can solve by having the mail be sent to the server directly, but if the server is not online all the time (located at home), it is probably better to have the emails sent to some Google or Yahoo account and fetch them from there.
You can do that with fetchmail, and have the mail delivered locally to a user list.
For the second part you can use procmail, with specific rules for the user in ~/.procmailrc. The local mail delivery agent needs to be told to use procmail e.g. in postfix you add:
mailbox_command = procmail -a "$EXTENSION"
to your /etc/postfix/main.cf file.
In the file ~list/.procmailrc you can specify rules on what to do with mail (all mails arriving there, or the ones with specific characteristics (subject, from address, etc)). procmail has several useful build in actions, and if those do not suffice you can pipe the mail into a program to do something specific it cannot do.
| Creating an email that can trigger a script |
1,605,590,299,000 |
My problem is that I've been a heavy user of GMail's pop3-import feature and used it to pull mail from other GMail Accounts. Back then I did, however, only import new mail, not all the mail previously stored on the server. Now that I've started to use mutt as my mail client of choice I've decided to import all my former mail accounts and thus archive all my old mail locally.
My initial hope was that I could easily weed out the duplicate mails by using a tool like fdupes, but what I did not anticipate was that the Mail-Header is altered slightly by GMail when it it retrieves a mail via Pop3 as it can be seen here:
@@ -1,7 +1,16 @@
Return-Path: <[email protected]>
Delivered-To: unknown
Received: from pop.gmail.com (74.125.43.109:995) by localhost with POP3-SSL;
- 10 May 2011 13:35:06 -0000
+ 10 May 2011 14:29:41 -0000
+Delivered-To: [email protected]
+Received: by 10.204.52.199 with SMTP id j7cs172325bkg;
+ Sun, 2 May 2010 15:33:19 -0700 (PDT)
+Received: by 10.204.136.15 with SMTP id p15mr6011875bkt.172.1272839446530;
+ Sun, 02 May 2010 15:30:46 -0700 (PDT)
+Received-SPF: softfail (google.com: best guess record for domain of transitioning [email protected] does not designate 84.167.28.93 as permitted sender) client-ip=84.167.28.93;
+Received: by 10.188.26.17 with POP3 id 17mf826641bwz.107;
+ Sun, 02 May 2010 15:30:46 -0700 (PDT)
+X-Gmail-Fetch-Info: [email protected] 1 smtp.gmail.com 995 xxxx
Received: from aequitas ( [84.167.28.93])
by mx.google.com with ESMTPS id e20sm18902485fga.1.2008.01.04.07.58.46
(version=TLSv1/SSLv3 cipher=RC4-MD5);
The original looked like this: http://pastebin.com/U6YzNySP
Is there an easy way to get rid of those "duplicate files" in an easy way?
|
Use the ESMTPS id from mx.google.com to identify duplicates. These should be unmodified. In the example above:
by mx.google.com with ESMTPS id e20sm18902485fga.1.2008.01.04.07.58.46
A very simple implementation would put all mails in one dir, extract the id and symlink the file to the id without using -f. Like:
for FILE in *; do
smtpid=$(do_extract_smtp_id_here)
if test -f ${smptid}; then
echo "DUPE: ${FILE}"
else
ln -s ${FILE} ${smtpid}
fi
done
| Find 'duplicate' mails in maildir when header differs slightly |
1,605,590,299,000 |
The situation
I have the following ~/.fetchmailrc
poll pop.gmail.com protocol pop3 user "[email protected]" password "***" ssl
mda "/usr/bin/procmail -d default -a foo@example-com"
poll pop.gmail.com protocol pop3 user "[email protected]" password "***" ssl
mda "/usr/bin/procmail -d default -a bar@example-com"
So, I retrieve all the mails with fetchmail -v -m '/usr/bin/procmail -d %T'.
The problem
But the problem is all the accounts are retrieved.
The question
Is it possible from fetchmail command to ask for retrieving just one specific addresses’ mails?
|
You can give each account a different name and use the via option
eg
poll foo via pop.gmail.com ...
poll bar via pop.gmail.com ...
Now you can specify each one on the command line; fetchmail foo will only fetch mail for that one account.
I use this type of structure for Outlook:
poll outlook via imap-mail.outlook.com port 993
proto IMAP
user [email protected] is foo here
fetchall
password *****
ssl
poll outlook2 via imap-mail.outlook.com port 993
proto IMAP
user [email protected] is bar here
fetchall
password *****
ssl
This can be implemented as follows in zsh.
Alias and function to retrieve mail
alias retrieveallmails="fetchmail -v -m '/usr/bin/procmail -d %T'" # For all the accounts
function retrievemail()
{
# For a specific account
fetchmail $1 -v -m '/usr/bin/procmail -d %T'
}
Related completion
_retrievemail_complete() {
local accounts
accounts=($(fetchmail --configdump | sed -n 's/.*"pollname":"\(.*\)",/\1/p'))
_arguments \
'1: :->account' \
'*:: :->arguments'
case $state in
(account)
_describe 'accounts' accounts
;;
(arguments)
_files
;;
esac
}
compdef _retrievemail_complete retrievemail
| Retrieve mails of only one specific account with fetchmail |
1,605,590,299,000 |
The mails are stored with full headers in a text file. (The file is an INBOX from the Thunderbird mail client. File format is a mboxrd variation.)
How to list the first server for each mail, that the email travels through before hitting the inbox? The "Received" line lists server that the email travels through. You read "Received" lines from bottom to top. The bottom-most line is the originator.
One option could be a custom script for text processing via sed, grep, awk, etc. Also searched for mail analyzer and found E-Mail Header Analyzer (MHA), maildir-utils and nmh - Message Handling System. Is it easier with one of those tools to query my file to accomplish the list of the servers that relay the email first?
|
I would split the mbox file into an approximation of its constituent messages based on the occurrence of From (without a colon). Then I would iterate across the set, picking out the last Received header for each.
mbox=/path/to/mbox/file
mkdir xx
(
cd xx
csplit -ksz -n5 "$mbox" '/^From /' '{*}'
for m in *
do
awk '
/^\r?$/ { gsub(/[\r\n[:space:]]+/, " ", received); print received; exit }
/^[^[:space:]]/ { flag = 0 }
/^Received:/ { received = $0; flag = 1 }
/^[[:space:]]/ && flag { received = received " " $0 }
' "$m"
done
)
rm -rf xx
It wouldn't be much harder to have awk read the original mbox file, but when I set off to create a solution I worked with a single message. Extending that solution with a shell loop seemed easier than extending the awk, but in hindsight it was probably only about 60:40 one way or the other.
Given that the awk script does process one message at a time, a utility such as formail (mentioned originally in the comments as being from the procmail suite) can be used to iterate across the messages in an mbox format file:
formail < "$mbox" -s awk '....'
| List first relay mail server from header |
1,605,590,299,000 |
I run a small webserver that hosts a handful of domains which I use for personal and testing purposes. I want to set it up as a mail server as well, and I'm trying to understand the rDNS lookup that checks against the SMTP HELO header.
The problem is that I have no control over the PTR records for my server's IP address, and there's no chance the ISP would delegate that to me. Let's say my IP address is 123.45.67.89. Then the PTR record for my IP resolves to a hostname like 123-045-067-089.customers.my-isp.net.
TL;DR -- I'm trying to understand what rDNS domain is being looked for in the SMTP HELO header? Is it the domain name of the email's sender (e.g. [email protected]) or the hostname of the mail exchange server even IF the server has a completely different domain name than the sender?
If I were to use the ISP's hostname of my IP address (e.g. 123-045-067-089.customers.my-isp.net) as the HELO header** for emails sent from mydomain.com, would that validate emails from [email protected] sent by my mail server at IP address 123.45.67.89, or does the PTR record for 123.45.67.89 need to resolve to mydomain.com?
**I could also obtain a TLS cert for 123-045-067-089.customers.my-isp.net, and have the MX record and TXT-spf record for mydomain.com point to 123-045-067-089.customers.my-isp.net
Long version:
Here's my very novice understanding of how the SMTP HELO check against rDNS works. Let's say my domain was mydomain.com, and I wanted to send an email from [email protected] to [email protected]. I'd first connect my desktop client to my mail server. The mail server (at IP address 123.45.67.89) would then connect to the mail server at gmail.com. In this scenario, let's say the HELO header listed mydomain.com as its domain name. So the gmail server would then do rDNS lookup on my server's IP address, only to discover that 123.45.67.89 resolves to hostname 123-045-067-089.customers.my-isp.net. Because this does not match the domain provided in the HELO header, the gmail server assumes this is spam and rejects it.
So far so good? Or no?
Now, let's suppose instead of putting mydomain.com as the SMTP HELO header, my mail server instead puts 123-045-067-089.customers.my-isp.net, and furthermore has a TLS certificate for that domain signed by an established CA. Also, the MX and TXT-spf records for mydomain.com point to 123-045-067-089.customers.my-isp.net as the established mail server.
(Note: It's not clear to me whether the SMTP HELO also dictates the domain of the sender's email???)
In this second scenario, would the email being sent from [email protected] to [email protected] be validated by the gmail server and recognized as a legitimate email? Or would it still fail because 123-045-067-089.customers.my-isp.net provided in HELO does not match the email sender's mydomain.com. (again... it's not clear to me whether this is even possible with the SMTP protocol... I'm very new to email servers)
Of course (this should go without saying...) I DO have full control over all of the DNS forward zone records for the domains I own. Also, I do have a stable long-term IP address, and all of my domains (and sub-domains) are configured to resolve back to my established IP address.
|
A server can send mail for a lot of different domains, even in one connection, that only has one HELO/EHLO. From that it's quite easy to see that the HELO/EHLO can not relate to any specific mail, instead it relates to the mail server, typically it's something that resolves to the ip the mail server is on.
Technically any mail server receiving a HELO/EHLO can validate the information in any way that server likes, and use that information in validating any thing else in the mail. But typically you're good if the value after HELO/EHLO resolves to the ip your server is on, i.e. rDNS for the ip typically doesn't matter.
| Which domain is HELO checked against with rDNS? Mail server's domain, even if different from the sender's domain? Or the email sender's domain? |
1,605,590,299,000 |
I'm using linux:
Distributor ID: Ubuntu
Description: Ubuntu 18.04.6 LTS
Release: 18.04
Codename: bionic
I noticed a few weeks ago that there is a file in my home directory: dead.letter.
The file is updating at the first second of every minute with the same number of log line.
I have been searching for the process that cause this over a week for now and still can't find it.
I've tried https://www.baeldung.com/linux/find-process-file-is-busy +
auditctl, killing and uninstalling docker, verifying multiple location where cron jobs may be. Disabling the cron process.
+ mail sendmail and mailx commands are not recognized.
I can't find the process that causes this.
Please help.
|
Found the problem:
We use nfs mounts in our organization. We also use AWS.
We created a new instance from an ec2 instance I was working on.
The template instance had a cron job, that kept running on the new instance, and writing data to the shared directory.
| What process is generating dead.letter? |
1,605,590,299,000 |
I have already read Why use Dovecot AND Postfix/Sendmail?, Why use both Dovecot and Postfix?, Why use both Dovecot and Postfix? which give the general idea, but here I'm looking for more precise details to understand how email servers connect together.
Let's say I own the domain example.com with DNS configured like this:
example.com MX mail.example.com
mail.example.com A 1.2.3.4
and postfix and dovecot are intalled on my Debian server of IP 1.2.3.4.
Let's say I send an email:
from my ISP address [email protected], from my local computer Thunderbird
... to the address [email protected]
What is the big picture of the different connections that will happen during this process?
Is the following correct:
My local computer connects to smtp.myisp.com (port 25 or 587)
My ISP's SMTP server (postfix?) queries the DNS of example.com and eventually will connect to mail.example.com, i.e. my own server where postfix is listening on port 25 or 587
My server's postfix saves the email on disk (where, by default?)
or postfix sends the email to dovecot (how do they connect together?)
When eventually I want to fetch mail on [email protected] with another Thunderbird account, the computer will connect my server 1.2.3.4 on port 110 or 995 (POP3).
?
In this case, postfix is the MTA, dovecot is the POP3/IMAP server, but what is the MDA/LDA (Delivery Agent)?
|
That depends on how your SMTP client is set up but in general that's correct.
Correct.
Let's talk about qmail-compatible maildirs as no one really uses /var/mail/username UNIX-style mailboxes any longer (too many disadvantages, barely any advantages). Emails are stored where you specify your Maildir is, by "default" it's
sudo postconf -e "home_mailbox = Maildir/"
By default postfix doesn't send emails to anyone or anything, it just stores them using the built-in delivery agent. There's no communication between dovecot and postfix per se AFAIK.
You connect to dovecot, and it allows you to work with the user qmail-compatible maildir specified above, e.g.
mail_location = maildir:~/Maildir
In this case, postfix is the MTA, dovecot is the POP3/IMAP server, but what is the MDA/LDA (Delivery Agent)?
Postfix again: http://www.postfix.org/OVERVIEW.html : man 8 local.
| During email delivery, how do MTA, MDA, POP/IMAP connect with each other? |
1,605,590,299,000 |
I'd like to have Thunderbird running on Debian10/KDE in Offline mode (mostly for security and privacy purposes but also to not receive any other mails) but still be able to receive mails to the user or root from processes / apps running on the machine (e.g. for popup KDE notifications about system events like cronjob-scan-results, intrusion-attempts, file-monitoring etc).
Is that possible (how)?
|
The workaround was to create a new Thunderbird profile like described here.
Then one can read the root@localhost mails with Thunderbird after setting the account up (without entering the root password into Thunderbird) like described here.
This doesn't work if Thunderbird is in Offline mode but still keeps it fairly isolated (or does it?) from other profiles/accounts and I created an issue (an enhancement request) for a proper solution here.
| How to allow Thunderbird to receive local mail (from apps to the user/root) while in offline mode? |
1,605,590,299,000 |
I have the following keybindings in my muttrc (among others).
bind generic,index,pager \Cf next-page
bind generic,index,pager \Cb previous-page
bind generic,index,pager \Cd half-down
bind generic,index,pager \Cu half-up
I have been trying to get a vim-like key-binding in mutt and as a part of that, I'd like Ctrl-D and Ctrl-U to work as page-up/page-down globally. When reading an email, this works just fine except that when I've reached the end of the email (by hitting enough number Ctrl-Ds), an additional Ctrl-D moves me to the next email in the mailbox.
I would like it stop there and show "Bottom of message is shown" consistent to "Top of message is shown" when I try to page-up beyond the top of the email. This looks like the "expected" default behaviour IMO.
|
Answer
Adding following line into your muttrc will serve Your needs.
set pager_stop = yes
References
From muttrc(5) / neomuttrc(5):
pager_stop
Type: boolean
Default: no
When set, the internal-pager will not move to the next message when you are at the end of a message and invoke the <next-page> function.
| Prevent Ctrl-D from moving to next mail when reaching bottom of email in mutt pager |
1,605,590,299,000 |
Is there a way to use different color for new email in inbox, when I am only a "cc/bcc" recipient, instead of regular "to" recipient ?
I am alredy using custom color for new emails in inbox. This is what i have in my userChrome.css:
/* unread messages */
#threadTree treechildren::-moz-tree-cell-text(unread),
treechildren::-moz-tree-cell-text(hasUnreadMessages-true) {
font-weight: bold !important;
color: red !important;
}
How can I modify it, so that new emails are colored differently, depending wether I am in "to" or "cc/bcc" ?
|
While it seems they can't be set using CSS, colors can be set based on To, Cc, and Bcc state by setting up one or more message filters to tag the messages.
First, create a tag of the desired color, e.g. a tag named Cc/Bcc. Then, create a filter to tag messages at a particular email address received as either Cc or Bcc to Cc/Bcc, as shown below. Use your own email address, of course.
By default, there is no Bcc in the list of headers to match. A custom Bcc header entry needs to be added to the list of headers when setting up the rules. To do so:
Select Customize... from the drop-down list for selecting the header to match,
type Bcc in the "Customize Headers" dialog that appears,
click Add,
click OK.
One caveat: The functionality for removing a custom header seems not to work (at least in the 64-bit version of Thunderbird 68.8.0), so add carefully.
| thunderbird: different color for new email, when I am only a "cc" recipient, instead of regular "to" recipient |
1,605,590,299,000 |
I have Mutt set up to switch to different accounts using a macro which works fine, but when I switch the Sidebar simply appends the folders of the account I'm switching over to below the folders of the mailbox I was in.
I wish the Sidebar just to display the folders of the account I'm currently in.
I use imap_check_subscribed to automatically get a list of the folders of the mailbox. I have attempted the 'refresh' command within the macro of the account switching in the hope this will re-draw the sidebar to just show my current folders but it does not work.
Strangely, using the C keybind to display the list of folders, it just list the ones of the mailbox I am in ... which is exactly what I want the sidebar to display only.
A hint - I'm not sure if the 'folder-hook' I have is at fault. Commenting these lines out in .muttrc has no effect whatsoever on the working of the account switch. I can't see where I'm going wrong with it though.
The .muttrc :
# ACCOUNT 1
source "~/.mutt/accounts/ACCOUNT1/accountinfo"
folder-hook $folder source '~/.mutt/accounts/ACCOUNT2/accountinfo'
# ACCOUNT 2
source "~/.mutt/accounts/ACCOUNT2/accountinfo"
folder-hook [email protected]/ source 'source ~/.mutt/accounts/ACCOUNT2/accountinfo'
# ACCOUNT 3
source "~/.mutt/accounts/ACCOUNT3/accountinfo"
folder-hook [email protected]/ source ~/.mutt/accounts/ACCOUNT3/accountinfo'
set sidebar_visible = yes
set sidebar_short_path = yes
bind index,pager B sidebar-toggle-visible
# Assign key to switch between accounts
macro index <f2> '<sync-mailbox><enter-command>source ~/.mutt/accounts/ACCOUNT1/accountinfo<enter><change-folder>!<enter><refresh>'
macro index <f3> '<sync-mailbox><enter-command>source ~/.mutt/accounts/ACCOUNT2/accountinfo<enter><change-folder>!<enter><refresh>'
macro index <f4> '<sync-mailbox><enter-command>source ~/.mutt/accounts/ACCOUNT3/accountinfo<enter><change-folder>!<enter><refresh>'
macro index 'c' '<change-folder>?<change-dir><home>^K=<enter>'
# LOOK AND UI SETUP
source ~/.mutt/colours
source ~/.mutt/behaviour
Example of account file:
# RECEIVE OPTIONS
set imap_user = [email protected]
set imap_pass = xxx
set folder = imaps://[email protected]@imap.gmail.com/
set spoolfile = +INBOX
set postponed = +Drafts
set record = +Sent
# SEND OPTIONS
set smtp_url = smtps://smtp://[email protected]@smtp.gmail.com
set smtp_pass = xxx
set realname = 'xxx xxx'
set from = [email protected]
set hostname = "gmail.com"
# OTHER
set header_cache = "~/.mutt/accounts/xxx/cache"
account-hook $folder "set [email protected] imap_pass=xxx"
set imap_check_subscribed = yes
And behaviour file:
# Check mail every 30 mins
set mail_check = 1800
# View HTML messages using w3m (defined in ~/.mailcap)
auto_view text/html
# Keybindings
bind pager j next-line
bind pager k previous-line
I'm new to the game but been finding my way mostly OK until now... any help much appreciated.
|
Add unmailboxes * to the beginning of each account config file
Mutt docs:
The “unmailboxes” command is used to remove a token from the list of folders which receive mail. Use “unmailboxes *” to remove all tokens.
| Mutt sidebar: switching accounts only appends mailboxes |
1,605,590,299,000 |
In Thunderbird, I can go to Add-ons manager, search for extension, and click on Add to Thunderbird to install it.
But I have multiple Thunderbird profiles, and installing every extension in every profile is tedious.
Is there a way to download the extension file, unpack it somewhere (presumably in /usr) so that all clients, all users, all profiles can see it as available and use it?
I found similar question here but that does not seem to work any longer in newer versions of Thunderbird. The paths are definitely different.
I am using Thunderbird 68.2.2 on Debian Buster.
As an example, here is an extension that I would like to install globally: No Message Pane Sort
I have tried installing that extension from Add-ons manager, and it works. So it is definitely compatible with my version of Thunderbird.
However, when I tried to unpack the file in /usr/share/xul-ext/nomessagepanesort/, other clients (other thunderbird profiles) don't see it.
Update
The accepted solution no longer works on Thunderbird 102.
I am trying to install globally the same extension: No Message Pane Sort
I have tried copying the .xpi file to both locations:
/usr/lib/thunderbird/extensions/[email protected]
/usr/local/thunderbird-current/distribution/extensions/[email protected]
But when I start Thunderbird, it does not recognize a new extension available.
This is a new installation, and new profile. Do I need to enable something in about:config, so that locally installed extensions are supported?
Or have the paths changed?
|
You'll still need to find the ID of the extension, but you can find it by extracting the manifest.json file from the .xpi package. Then you can either read it by eye, or using any JSON tool, for example:
$ jq .applications.gecko.id </tmp/manifest.json
"{e2fda1a4-762b-4020-b5ad-a41df1933103}"
Once you know the ID, you can place the XPI file into <your Thunderbird installation directory>/distribution/extensions/<extension ID here>.xpi. With modern versions of Thunderbird, you should find the Lightning calendar extension ({e2fda1a4-762b-4020-b5ad-a41df1933103}.xpi) already in that directory.
From this MozillaZine KB article:
Note: Starting in Gecko 2.0 (Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1), XPI files are no longer unpacked when extensions are installed. Instead, the XPI itself is placed in the extensions directory, and files are loaded directly out of the package. See Updating extensions for Firefox 4 for details.
For your specific example extension, after downloading the no_message_pane_sort_by_mouse-1.5-tb.xpi file, with my Thunderbird installation directory being /usr/local/thunderbird-current/:
$ unzip no_message_pane_sort_by_mouse-1.5-tb.xpi manifest.json
$ jq .applications.gecko.id <manifest.json
"[email protected]"
$ cp no_message_pane_sort_by_mouse-1.5-tb.xpi /usr/local/thunderbird-current/distribution/extensions/[email protected]
## clean up temporary files in current working directory
$ rm no_message_pane_sort_by_mouse-1.5-tb.xpi manifest.json
And the next time Thunderbird is started, it will be automatically there as an installed extension (unless it requires further configuration, in which case the user may be prompted to configure it unless you supply the required configuration items some other way).
| Install Thunderbird extension globally |
1,605,590,299,000 |
I followed this tutorial: https://computingforgeeks.com/how-to-install-and-configure-postfix-as-a-send-only-smtp-server-on-ubuntu-18-04-lts/
I'm trying to setup a send only mail from my Ubuntu 19 server. I followed the guide above and tried to install mailutils using:
apt install mailutils
It installed something but I'm not sure what as the mailutils command doesn't work as seen here:
I then installed via the following command:
apt install libmailutils-dev
That worked as mailutils command now runs, but I didn't get a GUI interface to select like how the guide shows it:
What do I need to do now since the Postfix install GUI didn't popup according to the guide?
Also is it an issue if I installed mailutils and then libmailutils-dev?
|
Run dpkg-reconfigure postfix to see the wizard/GUI
| Install Postfix using Mailutils on Ubuntu 19.04 server for sending out mail only |
1,605,590,299,000 |
I am writing a shell script to setup a few servers and once it is done, it will send an email to our help desk letting us know that the server is ready to be used.
I would like to use the following subject line: New Space Loop Activated! üéâ
But I cannot for the life of me figure out how to make accept that emoji. I can use emojis on the email body, but it does not work on the subject.
#
# Send an email to let us know that the server is ready to be used.
# Credentials will be sent to Vault instead of being stored on the server
# once the Vault server has been properly configured.
#
# @since 0.0.1
#
mail -s 'New Space Loop Activated!' \
-a 'From:Kerb!am Man<[email protected]>' [email protected] << END_MAIL
Delivery for The Humans,
Your new space loop ($HOSTNAME) has been configured $(printf '\xf0\x9f\x8e\x89') and credentials are
available at /home/gatekeeper/. Please remove them from the server once they
have been placed in a secure location.
Delivery fulfilled,
Kerb!am Man $(printf '\xf0\x9f\xa4\x96\n')
And remember: if you want it, Kerblam it!
END_MAIL
I have tried a few ideas:
Tried using encoded-character, but it does not seem to work for shell scripts — or I am too stupid to figure it out
Tried using unicode and utf-8
Tried using printf and echo
But nothing seems to work. Is that even supported? I am using postfix and mailutils, with Postmark as the SMTP relay.
|
The character üéâ in UTF-8 is:
f0 9f 8e 89
So you need this string in the subject line:
=?utf-8?Q?=F0=9F=8E=89?=
or for the whole subject:
New Space Loop Activated! =?utf-8?Q?=F0=9F=8E=89?=
The sequence means character set is utf-8 and the Q means quoted-printable encoding. You can also use BASE64 encoding to save a few bytes.
| How to use emojis on the subject line of mail? |
1,605,590,299,000 |
I've set up a mail server following https://thomas-leister.de/en/mailserver-debian-stretch/ and when trying to connect a client (Outlook 365) it's unable to connect to the SMTP server. Checking mail.log with full Dovecot verbosity it looks like it's authenticating IMAP then immediately closing the connection.
Here's my mail.log when attempting to connect client just once.
Jun 21 07:53:50 mail dovecot: master: Warning: Killed with signal 15 (by pid=10163 uid=0 code=kill)
Jun 21 07:53:50 mail dovecot: imap([email protected]): Server shutting down. in=152 out=2220
Jun 21 07:53:50 mail dovecot: master: Dovecot v2.2.27 (c0f36b0) starting up for imap, lmtp, sieve (core dumps disabled)
Jun 21 07:53:56 mail postfix[10184]: Postfix is running with backwards-compatible default settings
Jun 21 07:53:56 mail postfix[10184]: See http://www.postfix.org/COMPATIBILITY_README.html for details
Jun 21 07:53:56 mail postfix[10184]: To disable backwards compatibility use "postconf compatibility_level=2" and "postfix reload"
Jun 21 07:53:56 mail postfix/postfix-script[10190]: stopping the Postfix mail system
Jun 21 07:53:56 mail postfix/master[5066]: terminating on signal 15
Jun 21 07:53:56 mail postfix[10253]: Postfix is running with backwards-compatible default settings
Jun 21 07:53:56 mail postfix[10253]: See http://www.postfix.org/COMPATIBILITY_README.html for details
Jun 21 07:53:56 mail postfix[10253]: To disable backwards compatibility use "postconf compatibility_level=2" and "postfix reload"
Jun 21 07:53:57 mail postfix/postfix-script[10352]: starting the Postfix mail system
Jun 21 07:53:57 mail postfix/master[10354]: daemon started -- version 3.1.8, configuration /etc/postfix
Jun 21 07:54:00 mail dovecot: auth: Debug: Loading modules from directory: /usr/lib/dovecot/modules/auth
Jun 21 07:54:00 mail dovecot: auth: Debug: Module loaded: /usr/lib/dovecot/modules/auth/libdriver_mysql.so
Jun 21 07:54:00 mail dovecot: auth: Debug: Read auth token secret from /var/run/dovecot/auth-token-secret.dat
Jun 21 07:54:00 mail dovecot: auth: Debug: auth client connected (pid=10359)
Jun 21 07:54:00 mail dovecot: auth: Debug: client in: AUTH#0111#011PLAIN#011service=imap#011secured#011session=g4gzkiVv7OesUygU#011lip=208.146.44.129#011rip=172.83.40.20#011lport=993#011rport=59372#011local_name=imap.mysite.ca#011resp=AEpvc2hAandha2UuY2EAMXBPb3AyVFQ= (previous base64 data may contain sensitive data)
Jun 21 07:54:00 mail dovecot: auth-worker(10362): Debug: Loading modules from directory: /usr/lib/dovecot/modules/auth
Jun 21 07:54:00 mail dovecot: auth-worker(10362): Debug: Module loaded: /usr/lib/dovecot/modules/auth/libdriver_mysql.so
Jun 21 07:54:00 mail dovecot: auth-worker(10362): Debug: sql([email protected],172.83.40.20,<g4gzkiVv7OesUygU>): query: SELECT username AS user, domain, password FROM accounts WHERE username = 'josh' AND domain = 'mysite.ca' and enabled = true;
Jun 21 07:54:00 mail dovecot: auth-worker(10362): Debug: sql([email protected],172.83.40.20,<g4gzkiVv7OesUygU>): username changed [email protected] -> Josh
Jun 21 07:54:00 mail dovecot: auth-worker(10362): Debug: sql(Josh,172.83.40.20,<g4gzkiVv7OesUygU>): username changed Josh -> [email protected]
Jun 21 07:54:00 mail dovecot: auth: Debug: sql([email protected],172.83.40.20,<g4gzkiVv7OesUygU>): username changed [email protected] -> [email protected]
Jun 21 07:54:00 mail dovecot: auth: Debug: sql([email protected],172.83.40.20,<g4gzkiVv7OesUygU>): username changed [email protected] -> Josh
Jun 21 07:54:00 mail dovecot: auth: Debug: sql(Josh,172.83.40.20,<g4gzkiVv7OesUygU>): username changed Josh -> [email protected]
Jun 21 07:54:00 mail dovecot: auth: Debug: client passdb out: OK#0111#[email protected]
Jun 21 07:54:00 mail dovecot: auth: Debug: master in: REQUEST#0111298792449#01110359#0111#011eea41cbba6c921b40a93a702989eed61#011session_pid=10363#011request_auth_token
Jun 21 07:54:00 mail dovecot: auth-worker(10362): Debug: sql([email protected],172.83.40.20,<g4gzkiVv7OesUygU>): SELECT concat('*:storage=', quota, 'M') AS quota_rule FROM accounts WHERE username = 'Josh' AND domain = 'mysite.ca' AND sendonly = false;
Jun 21 07:54:00 mail dovecot: auth: Debug: master userdb out: USER#0111298792449#[email protected]#011quota_rule=*:storage=2048M#011auth_token=6716f415ff804ba96add892baeeaecff7f0592cd
Jun 21 07:54:00 mail dovecot: imap-login: Login: user=<[email protected]>, method=PLAIN, rip=172.83.40.20, lip=208.146.44.129, mpid=10363, TLS, session=<g4gzkiVv7OesUygU>
Jun 21 07:54:00 mail dovecot: imap([email protected]): Debug: Loading modules from directory: /usr/lib/dovecot/modules
Jun 21 07:54:00 mail dovecot: imap([email protected]): Debug: Module loaded: /usr/lib/dovecot/modules/lib10_quota_plugin.so
Jun 21 07:54:00 mail dovecot: imap([email protected]): Debug: Module loaded: /usr/lib/dovecot/modules/lib11_imap_quota_plugin.so
Jun 21 07:54:00 mail dovecot: imap([email protected]): Debug: Module loaded: /usr/lib/dovecot/modules/lib90_antispam_plugin.so
Jun 21 07:54:00 mail dovecot: imap([email protected]): Debug: Added userdb setting: plugin/quota_rule=*:storage=2048M
Jun 21 07:54:00 mail dovecot: imap([email protected]): Debug: Effective uid=1001, gid=1001, home=/var/vmail/mailboxes/mysite.ca/Josh
Jun 21 07:54:00 mail dovecot: imap([email protected]): Debug: Quota root: name=User quota backend=maildir args=
Jun 21 07:54:00 mail dovecot: imap([email protected]): Debug: Quota rule: root=User quota mailbox=* bytes=2147483648 messages=0
Jun 21 07:54:00 mail dovecot: imap([email protected]): Debug: Quota grace: root=User quota bytes=214748364 (10%)
Jun 21 07:54:00 mail dovecot: imap([email protected]): Debug: Namespace inbox: type=private, prefix=, sep=, inbox=yes, hidden=no, list=yes, subscriptions=yes location=maildir:~/mail:LAYOUT=fs
Jun 21 07:54:00 mail dovecot: imap([email protected]): Debug: fs: root=/var/vmail/mailboxes/mysite.ca/Josh/mail, index=, indexpvt=, control=, inbox=/var/vmail/mailboxes/mysite.ca/Josh/mail, alt=
Jun 21 07:54:00 mail dovecot: imap([email protected]): Debug: quota: quota_over_flag check: STORAGE ret=1 value=0 limit=2097152
Jun 21 07:54:00 mail dovecot: imap([email protected]): Debug: quota: quota_over_flag check: MESSAGE ret=0 value=0 limit=0
Jun 21 07:54:00 mail dovecot: imap([email protected]): Debug: quota: quota_over_flag=0((null)) vs currently overquota=0
Jun 21 07:54:33 mail dovecot: auth: Debug: auth client connected (pid=10381)
Jun 21 07:54:34 mail dovecot: auth: Debug: client in: AUTH#0111#011PLAIN#011service=imap#011secured#011session=vIIvlCVv8eesUygU#011lip=208.146.44.129#011rip=172.83.40.20#011lport=143#011rport=59377#011local_name=mail.mysite.ca#011resp=AEpvc2hAandha2UuY2EAMXBPb3AyVFQ= (previous base64 data may contain sensitive data)
Jun 21 07:54:34 mail dovecot: auth-worker(10362): Debug: sql([email protected],172.83.40.20,<vIIvlCVv8eesUygU>): query: SELECT username AS user, domain, password FROM accounts WHERE username = 'josh' AND domain = 'mysite.ca' and enabled = true;
Jun 21 07:54:34 mail dovecot: auth-worker(10362): Debug: sql([email protected],172.83.40.20,<vIIvlCVv8eesUygU>): username changed [email protected] -> Josh
Jun 21 07:54:34 mail dovecot: auth-worker(10362): Debug: sql(Josh,172.83.40.20,<vIIvlCVv8eesUygU>): username changed Josh -> [email protected]
Jun 21 07:54:34 mail dovecot: auth: Debug: sql([email protected],172.83.40.20,<vIIvlCVv8eesUygU>): username changed [email protected] -> [email protected]
Jun 21 07:54:34 mail dovecot: auth: Debug: sql([email protected],172.83.40.20,<vIIvlCVv8eesUygU>): username changed [email protected] -> Josh
Jun 21 07:54:34 mail dovecot: auth: Debug: sql(Josh,172.83.40.20,<vIIvlCVv8eesUygU>): username changed Josh -> [email protected]
Jun 21 07:54:34 mail dovecot: auth: Debug: client passdb out: OK#0111#[email protected]
Jun 21 07:54:34 mail dovecot: auth: Debug: master in: REQUEST#0111986658305#01110381#0111#0114a81a655e2fd95775a69d67377032381#011session_pid=10382#011request_auth_token
Jun 21 07:54:34 mail dovecot: auth-worker(10362): Debug: sql([email protected],172.83.40.20,<vIIvlCVv8eesUygU>): SELECT concat('*:storage=', quota, 'M') AS quota_rule FROM accounts WHERE username = 'Josh' AND domain = 'mysite.ca' AND sendonly = false;
Jun 21 07:54:34 mail dovecot: auth: Debug: master userdb out: USER#0111986658305#[email protected]#011quota_rule=*:storage=2048M#011auth_token=345528122fb785f133c083192ec59c03663f0b95
Jun 21 07:54:34 mail dovecot: imap-login: Login: user=<[email protected]>, method=PLAIN, rip=172.83.40.20, lip=208.146.44.129, mpid=10382, TLS, session=<vIIvlCVv8eesUygU>
Jun 21 07:54:34 mail dovecot: imap([email protected]): Debug: Loading modules from directory: /usr/lib/dovecot/modules
Jun 21 07:54:34 mail dovecot: imap([email protected]): Debug: Module loaded: /usr/lib/dovecot/modules/lib10_quota_plugin.so
Jun 21 07:54:34 mail dovecot: imap([email protected]): Debug: Module loaded: /usr/lib/dovecot/modules/lib11_imap_quota_plugin.so
Jun 21 07:54:34 mail dovecot: imap([email protected]): Debug: Module loaded: /usr/lib/dovecot/modules/lib90_antispam_plugin.so
Jun 21 07:54:34 mail dovecot: imap([email protected]): Debug: Added userdb setting: plugin/quota_rule=*:storage=2048M
Jun 21 07:54:34 mail dovecot: imap([email protected]): Debug: Effective uid=1001, gid=1001, home=/var/vmail/mailboxes/mysite.ca/Josh
Jun 21 07:54:34 mail dovecot: imap([email protected]): Debug: Quota root: name=User quota backend=maildir args=
Jun 21 07:54:34 mail dovecot: imap([email protected]): Debug: Quota rule: root=User quota mailbox=* bytes=2147483648 messages=0
Jun 21 07:54:34 mail dovecot: imap([email protected]): Debug: Quota grace: root=User quota bytes=214748364 (10%)
Jun 21 07:54:34 mail dovecot: imap([email protected]): Debug: Namespace inbox: type=private, prefix=, sep=, inbox=yes, hidden=no, list=yes, subscriptions=yes location=maildir:~/mail:LAYOUT=fs
Jun 21 07:54:34 mail dovecot: imap([email protected]): Debug: fs: root=/var/vmail/mailboxes/mysite.ca/Josh/mail, index=, indexpvt=, control=, inbox=/var/vmail/mailboxes/mysite.ca/Josh/mail, alt=
Jun 21 07:54:34 mail dovecot: imap([email protected]): Debug: quota: quota_over_flag check: STORAGE ret=1 value=0 limit=2097152
Jun 21 07:54:34 mail dovecot: imap([email protected]): Debug: quota: quota_over_flag check: MESSAGE ret=0 value=0 limit=0
Jun 21 07:54:34 mail dovecot: imap([email protected]): Debug: quota: quota_over_flag=0((null)) vs currently overquota=0
Jun 21 07:54:34 mail dovecot: imap([email protected]): Connection closed (IDLE running for 0.001 + waiting input for 0.001 secs, 2 B in + 10+10 B out, state=wait-input) in=11 out=372
Jun 21 07:57:10 mail postfix/postscreen[10463]: CONNECT from [185.234.218.188]:64778 to [208.146.44.129]:25
Jun 21 07:57:10 mail postfix/postscreen[10463]: PREGREET 11 after 0.16 from [185.234.218.188]:64778: EHLO User\r\n
Jun 21 07:57:10 mail postfix/postscreen[10463]: DISCONNECT [185.234.218.188]:64778
Jun 21 07:58:51 mail dovecot: auth: Debug: Loading modules from directory: /usr/lib/dovecot/modules/auth
Jun 21 07:58:51 mail dovecot: auth: Debug: Module loaded: /usr/lib/dovecot/modules/auth/libdriver_mysql.so
Jun 21 07:58:51 mail dovecot: auth: Debug: Read auth token secret from /var/run/dovecot/auth-token-secret.dat
Jun 21 07:58:51 mail dovecot: auth: Debug: auth client connected (pid=10530)
Jun 21 08:01:52 mail dovecot: imap-login: Disconnected: Inactivity (no auth attempts in 181 secs): user=<>, rip=92.63.193.40, lip=208.146.44.129, TLS, session=<4VNJriVvVWVcP8Eo>
Every now and again when inactive I will get
Jun 21 08:17:12 mail dovecot: auth: Debug: sql([email protected],92.63.193.40,<KGX85CVv3MlcP8Eo>): username changed [email protected] -> Josh
Jun 21 08:17:12 mail dovecot: auth: Debug: sql(Josh,92.63.193.40,<KGX85CVv3MlcP8Eo>): username changed Josh -> [email protected]
Jun 21 08:17:14 mail dovecot: auth: Debug: client passdb out: FAIL#0111#[email protected]#[email protected]
Jun 21 08:17:14 mail dovecot: imap-login: Debug: Ignoring unknown passdb extra field: original_user
Jun 21 08:17:25 mail dovecot: imap-login: Disconnected (auth failed, 1 attempts in 16 secs): user=<[email protected]>, method=PLAIN, rip=92.63.193.40, lip=208.146.44.129, TLS, session=<KGX85CVv3MlcP8Eo>
Right now I'm not sure where to go from here. Let me know if more logs or configs are required.
Server settings in Outlook:
Incoming: mail.mysite.ca port 143 STARTTLS
Outgoing: mail.mysite.ca port 587 STARTTLS
EDIT1:
I noticed when postfix shows in the log it's trying to connect on port 25 I think? It rarely appears in the log. Trying port 25 on outlook doesn't work.
Nevermind looking it up it's normal for pregreet to be on port 25.
EDIT2:
Setting dovecot to performance didn't seem to change anything.
EDIT3:
netstat: Looks like my server is listening on port 25 and 587, right?
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:143 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:53 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:7832 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN
tcp 0 0 208.146.44.129:25 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:8953 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:4190 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:993 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:11332 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:11333 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:11334 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:587 0.0.0.0:* LISTEN
tcp 0 0 208.146.44.129:587 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:6379 0.0.0.0:* LISTEN
tcp6 0 0 :::143 :::* LISTEN
tcp6 0 0 :::80 :::* LISTEN
tcp6 0 0 :::7832 :::* LISTEN
tcp6 0 0 ::1:25 :::* LISTEN
tcp6 0 0 ::1:8953 :::* LISTEN
tcp6 0 0 :::443 :::* LISTEN
tcp6 0 0 :::4190 :::* LISTEN
tcp6 0 0 :::993 :::* LISTEN
tcp6 0 0 ::1:11332 :::* LISTEN
tcp6 0 0 ::1:11333 :::* LISTEN
tcp6 0 0 ::1:11334 :::* LISTEN
tcp6 0 0 ::1:587 :::* LISTEN
udp 0 0 0.0.0.0:21902 0.0.0.0:*
udp 0 0 127.0.0.1:53 0.0.0.0:*
udp 0 0 0.0.0.0:26738 0.0.0.0:*
EDIT4: netstat -nap | awk 'NR<3 || /:25/ || /:587/'
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 814/master
tcp 0 0 208.146.44.129:25 0.0.0.0:* LISTEN 814/master
tcp 0 0 127.0.0.1:587 0.0.0.0:* LISTEN 814/master
tcp 0 0 208.146.44.129:587 0.0.0.0:* LISTEN 814/master
tcp6 0 0 ::1:25 :::* LISTEN 814/master
tcp6 0 0 ::1:587 :::* LISTEN 814/master
|
Here, an SMTP client is speaking before it's been spoken to:
Jun 21 07:57:10 mail postfix/postscreen[10463]: CONNECT from [185.234.218.188]:64778 to [208.146.44.129]:25
Jun 21 07:57:10 mail postfix/postscreen[10463]: PREGREET 11 after 0.16 from [185.234.218.188]:64778: EHLO User\r\n
Jun 21 07:57:10 mail postfix/postscreen[10463]: DISCONNECT [185.234.218.188]:64778
This is in violation of the protocol and so the connection is dropped. And possibly even blacklisted for a short while.
Your client should really be talking - with authentication - on 587, not on 25.
| Dovecot Immediate Connection Closed [closed] |
1,605,590,299,000 |
I need to update exim on one of my servers to at least version 4.86 to use it with rspamd. But the latest version provided by the OS is 4.82.
Is there any comfortable way to get the latest version, besides of building it from sources?
Cheers
|
This is a somewhat generic answer on installing newer software on an older version of a Debian derivative.
The first thing is to make sure that you actually want a newer version. Contrary to a popular misconception, newer isn't always better. The newer version usually has bug fixes but it also has new bugs. Distributions apply fixes for major bugs and especially for security issues, so if all you care about is bug fixes in general, you should stick with your distribution's package. In your case, you need a new feature, so this warning does not apply to you.
The easiest way to get a newer version is if someone has already done the work for you. Check whether a backport package is available for your distribution. For Ubuntu, backports are listed on the package page on the website. For exim4, there is no backport.
Also check if the application developer has packages available. This doesn't seem to be the case for Exim.
Lacking an official package, check if there's an unofficial package. With an unofficial package, there's more of a risk that the maintainer of that package won't make timely updates to fix security issues and major bugs, so evaluate the source and decide whether you want to take the risk. For Ubuntu, and sometimes for other Debian derivatives, check whether a PPA is available. For exim with rspamd support, you're half in luck. There's an exim-rspamd PPA but it doesn't seem to be actively maintained so it probably has security holes by now.
A radically different approach is to install a more recent distribution in a chroot environment, and run the program from this more recent distribution. This consumes a lot of disk space and bandwidth compared to just installing one application, but those are cheap compared with human labor, and this method is very light on labor, especially for Debian derivatives thanks to schroot. See my guide on using schroot on Debian derivatives. This is a good method for “end user” applications, but for a system service like exim4, it might not be so easy.
For server-side software, you may be able to find a chroot-like package in the form of a Docker container. Many Docker images with exim are available. I have no idea about their quality, reliability and trustworthiness.
For open source software, installing from source is always a possibility. It may be more or less painful depending on what other software (typically libraries) the program depends on. For GUI programs that require a couple dozen libraries and keep updating their minimum requirements, it can be very difficult to keep up. For a program like exim that has very few dependencies, it should be pretty easy. The main constraint is that you have to watch for, and apply, security updates as they come out. This can introduce risk if the application developer only provides security updates for the latest version (which may introduce bugs that affect you). Check if a long-term-support version is available (there isn't one for Exim).
In your case, I'd either go for a Docker container if there's a reliable one, or build your own deb package starting from the work that was done for the exim-rspamd PPA.
| Need exim >=4.86 on Ubuntu 14.04 LTS |
1,510,869,739,000 |
I have a server that I use for playing around with. I want to set up an email account that is @.com, but the way that SquirrelMail and the mail server is set up, the home folder for the username has to be stored in var/www/squirrelmail, instead of /home. Can I have two users named with different UID's, permissions, groups, etc? I assume that Ubuntu Server will let me, but I'm worried that there could be some side effects/ security flaws. Are there?
|
That is probably not going to work because the system (the glibc) would resolve the name always to the same entry (probably the first). So it would not make a difference whether the second entry is there or not.
| Can I have two users with the same name but different UID's? |
1,510,869,739,000 |
I have Postfix configured to deliver to Maildir-format mailboxes:
$ cat /etc/postfix/main.cf
home_mailbox=Maildir/
mail_location = maildir:~/Maildir
I have Dovecot configured the same:
$ cat /etc/dovecot/conf.d/10-mail.conf
mail_location = maildir:~/Maildir
But the mail command seems unable to read my Maildir mailboxes, and seems to be telling me that mail is not being delivered how I think.
Every time that mail is sent to [email protected], it can be read by the command:
mail -f /var/mail/user
indicating that it is being delivered there instead of into ~user/Maildir. Moreover, mail fails to read that mail directory when invoked as:
mail -f /home/user/Maildir/new
Why is this? How do I configure Postfix et al. to deliver to mail directories? And how do I get the mail command to show the mail that is in them?
|
The mail utility usually can't handle Maildir mailboxes.
Use another mail client, such as mutt for example, that can.
mutt -f /home/user/Maildir
| Why email can't be read from Maildir? [closed] |
1,510,869,739,000 |
"Issue"... The command is doing what is actually instructed to.
Given this mbox format file:
From: [email protected] #identifies the beginning of the first mail
...
Subject: crcheck.sh #identifies the beginning of the mail body
...
MYVARIABLE="123"
...
From: [email protected] #identifies the beginning of the next mail
...
Subject: crcheck.sh #identifies the beginning of the mail body
...
From: [email protected] #identifies the beginning of next mail
...
Subject: crcheck.sh #identifies the beginning of the mail body
EVILVARIABLE="0.00" #just to mention a value that would cause division by zero errors and crash my main script.
...
From: [email protected] #identifies the beginning of the next mail
...
I need to select all lines between a valid Subject: and the next From:, but the From: preceiding the Subject line should be the $GOODSENDER one.
The code I'm running:
GOODSUBJECT="crcheck.sh"
GOODSENDER="[email protected]"
cat $MBOX |awk "/Subject\: $GOODSUBJECT$/{a=1}/From\:\ $GOODSENDER /{print;a=0}a"|grep $i\=\"
Outputs:
MYVARIABLE="123"
EVILVARIABLE="0.00"
Expected output:
MYVARIABLE="123"
The command is doing what it's instructed to, as those lines are acutally between two of the lines I set as patterns for awk.
But how can I adjust it to have this desidered behaviour?
|
Try:
$ awk "/Subject:/{a=0} /From:/{a=0; b=0} a && b && /MYVARIABLE=/{print} /Subject: crcheck.sh$/{a=1} /From: [email protected]/{b=1}" mbox
MYVARIABLE="123"
How it works
/Subject:/{a=0} /From:/{a=0; b=0}
When we reach a subject or from line, turn all flags false.
a && b && /MYVARIABLE=/{print}
If both flags are true and the line includes the string MYVARIABLE=, then print the line.
/Subject: crcheck.sh$/{a=1}
If the subject line is good, set flag a to true.
/From: [email protected]/{b=1}
If the from line is good, set flag b to true.
Notes
It is poor practice to use all caps for shell variables. The system use all caps for its variables and you don't want to accidentally overwrite one of them.
cat is unneeded. Awk takes file names as arguments.
In regexes, : and space are not special. They don't need to be escaped.
In email headers, Subject: and From: are both supposed to start at the beginning of the line. A better regex for each might be /^Subject:/ and /^From:/ where ^ is the regex symbol for start-of-line.
Passing a variable to awk
$ var=MYVARIABLE
$ awk -v x="$var" '/Subject:/{a=0} /From:/{a=0; b=0} a && b && $0 ~ (x"="){print} /Subject: crcheck.sh$/{a=1} /From: [email protected]/{b=1}' mbox
MYVARIABLE="123"
Sample Input
The output above was generated using this as the input file:
$ cat mbox
From: [email protected]
...
Subject: crcheck.sh
...
MYVARIABLE="123"
...
From: [email protected]
...
Subject: crcheck.sh
...
From: [email protected]
...
Subject: crcheck.sh
EVILVARIABLE="0.00"
...
From: [email protected]
...
This is the same as in the question except that, to restore it to mbox format, the added comments have been removed.
| awk issue selecting lines between two patterns |
1,510,869,739,000 |
I'd like to encrypt my home folder in CentOS. I notice Dovecot has created directories and files under ~/mail. If I encrypt, will my email stop working (remote access over imap and smtp)?
|
Your unencrypted directory is available only when you are logged in, it's a fake filesystem provided by the decryption program. When you're logged out, the fake (decrypted) filesystem does not exist. dovecot, at, cron cannot see it.
Reconfigure dovecot to only use files/dirs that exist while you're logged out.
| Encrypted home folder and email |
1,510,869,739,000 |
I am installing new crontab job which will execute a shell script and then send the printed errors on the console to email.
I know all of the required steps to do, which will be as following:
0 10,22 * * * . /X.sh 2>&1 >/dev/null | mail -s "subject" "email"
Mu question is: when will it send the email?
it will send an email each 12 hours even if shell script finished before the next round (I mean the next new cron job).
it will send an email after finish executing from shell script even the duration of the current cron is still active.
|
The email will be sent every time X.sh finishes running, whenever that is.
cron itself will send a job's output by email by default, to the relevant crontab owner or whatever MAILTO is set to; you could use that instead of manually calling mail.
| crontab each 12 hour - when will it send an email? |
1,510,869,739,000 |
Currently the server I have has blocked emails from being sent from it due to spam issues. So I am currently looking for a way to send e-mail through the command line or shell script through an external SMTP server like gmail.
Please note that if I require other software to aid in this issue, I do not have root access on the server thus I cannot install software that requires root but I can install them locally provided that I build from source with ./configure --prefix=$HOME. The server comes with mail and that is really all that is related to email.
|
msmtp is a command line application that can send email over smtp. You can pipe your email into it. Keep in mind that it is not an mail user agent so you have to pipe in the whole email not just the body.
| Sending mail through external smtp server via command line/shell script |
1,510,869,739,000 |
When using thread view in Thunderbird, pressing Enter on collapsed thread does not un-collapse the thread as would be logical, but instead opens all emails in that thread in separate windows.
Is there a way to change this unfortunate behavior, and instead un-collapse the thread when I press Enter?
I am using Thunderbird (Icedove) 24.8.1 on Debian.
|
You may press Right instead of Enter to uncollapse the thread.
You may set "operate_on_msgs_in_collapsed_threads" to false in config editor (as indicated in your Mozilla support issue.) so that only the current mail opens on Enter.
You may install Dorando Keyconfig extension and setup up a command to archive whole conversation (as not indicated in your Mozilla support issue). Just assign these two commands to a key of your choice.
goDoCommand('cmd_selectThread');
goDoCommand('cmd_archive');
That way, while reading a single mail, you may get rid of the whole thread at once, not delete 70 e-mails individually.
(Me, personally, I am very happy with this solution. It allows me not to use the Thunderbird conversation extension that brings some GMail like funcionality to Thunderbird, but brings many integration issues.)
| Thunderbird: disable ENTER opening all messages in thread |
1,510,869,739,000 |
I've got a mail folder which contains a unique e-mail containing several attachment. I'd like to script the resending of the email as verbatim as possible.
If I write
cat tosend | mailx [email protected]
Then the e-mail is forwarded as a text content, the attachment being unreadable for the mailer. Is there a way to resent the using a command-line script, while keeping it's attachment structure or should I extract all the attachment and rebuild the email from them ?
|
Using sendmail(1) and formail(1) (from the procmail package), rather than mailx(1):
formail -s sendmail -oem -oi [email protected] <mail-folder
The point of formail(1) is just to split the folder into individual messages, you can omit it if you have a single message to bounce.
| Resend (bounce) a message with attachment in mailx (or any other tools) |
1,510,869,739,000 |
This seems like a basic question and there are variations of it. I have a ONE-COLUMN html file (let us call it status.html).
I would like to send this file which has a few images as the BODY of an email. I would like to do this using the Linux command line, but I am unsure of how to proceed. I do not know how the images will get gobbled up and formatted accordingly (i.e. are the base64 or attachments).
The key part is that I want the images in the HTML file to be in the body of the email ...
Is the a way or a Linux tool that does just this?
<<<
|
"-a" Attach a file to your message using MIME. When attaching single or multiple files, separating filenames and recipient addresses with "--" is mandatory, e.g.
mutt -a image.jpg -- addr1 or mutt -a img.jpg *.png -- addr1 addr2.
The -a option must be placed at the end of command line options. –
| Sending a HTML file (with images) as email body using command line |
1,510,869,739,000 |
I have successfully set up Davmail on Ubuntu 14 and am able to read, receive and send mail on my Exchange account in Thunderbird. This page was a big help!:
http://nknu.net/ubuntu-14-04-exchange-configuration-thunderbird-pidgin/
I set the account up as IMAP, so I can also browse folders. One thing I can't seem to do is subscribe to or otherwise access the "Online Archive" - a copy of my Inbox and subfolders for all mail more than a year old (my IT department's policy). Davmail release notes say that this is possible but I can't find any guides on how to view this archive folder in Thunderbird, or any other mail clients. Can anyone suggest what to do or what to read?
Cheers,
Ryan
|
The posters in this thread claim success although the explanation of what options need to be changed lacks detail.
http://sourceforge.net/p/davmail/support-requests/134/
I have the URLs but I need more specific instructions in how to change the settings of Davmail and my email clients. Can anyone help?
| Can I view my Microsoft Exchange Online Archive via Davmail in Thunderbird |
1,510,869,739,000 |
I'm syncing my gmail account ('All Mail' and 'Sent' folder) with offlineimap to my harddrive. But it appears to me some emails are not downloaded. I disabled the conversation view in gmail and it shows me 4728 mails in 'All Mail'. Offlineimap creates 4703 files, shouldn't these two numbers match?
~/.offlineimaprc
[Repository gmail-Local]
type = Maildir
localfolders = ~/mail/gmail
[Repository gmail-Remote]
type = Gmail
remoteuser = [email protected]
remotepass = passw
readonly = True
createfolders = False
ssl = yes
sslcacertfile = /etc/ssl/certs/ca-certificates.crt
nametrans = lambda folder: re.sub(' ', '_', folder)
folderfilter = lambda foldername: foldername in ['[Gmail]/All Mail', '[Google Mail]/All Mail', '[Google Mail]/Sent Mail', '[Gmail]/Sent Mail']
When I do:
~/mail/gmail/[Google_Mail].All_Mail]$ find . -type f | wc -l
4703
offlineimap --version
6.5.4
|
On closer look those missing 25 mails most likely are chat conversations which show up in Gmail within 'All Mail'.
To sync them, you need to ensure the Chats label is visible in IMAP:
Click the Gear icon > Settings > Labels > Check the checkbox "Show in IMAP" for chats.
| Offlineimap mail count does not match Gmail's |
1,510,869,739,000 |
I would like my server to send a mail to me when someone connects remotely over ssh to my server.
who only gives me back the Username, TerminalID and Date. I cannot use only that, I need to check for the IP someone uses to connect to me.
So the triggering part would be an external IP.
How can I achieve that?
EDIT: who -h gives back the IP adresses of the ssh sessions. Thanks to Archemar
|
You can add some shell scripting to /etc/bashrc or /etc/bash.bashrc maybe bepending on your linux distribution. Those are executed when user logs in remotely via SSH. Just test if there is $SSH_CLENT variable to distinguish the ssh login.
There will be other usefull variables for your needs, like:
SSH_ASKPASS=/usr/lib/ssh/x11-ssh-askpass
SSH_CLIENT='127.0.0.1 57353 2217' ← ip address
SSH_CONNECTION='127.0.0.1 57353 127.0.0.1 2217'
USER=username
EDIT:
Of course, if the user is using GNU/bash. Other shells uses other files.
Check them in related manuals.
HTH, Cheers
| How to send a mail when someone remote connects to my server |
1,510,869,739,000 |
Normally, I can send email from commandline, such as
echo hello | mail -s "subject" [email protected]
I have noticed that even when Postfix is not running on my machine, I can still "send" emails. Actually they are being queued in /var/spool/postfix/maildrop. But once Postfix is started again, these emails will be sent out.
Can somebody please explain how this works? Who copies the emails into /var/spool/postfix/maildrop, is it the email client (heirloom in my case) ?
Does it mean, I have a guarantee all emails will be always delivered, regardless whether Postfix is running or not?
|
Can somebody please explain how this works? Who copies the emails into
/var/spool/postfix/maildrop, is it the email client (heirloom in my
case) ?
Local mail submissions, are received with the Postfix sendmail compatibility command, are queued in maildrop queue by postdrop program.
The postdrop command is designed to run with set-group ID privileges, so that it
can write to the maildrop queue directory and connect to Postfix daemon processes.
Does it mean, I have a guarantee all emails will be always delivered,
regardless whether Postfix is running or not?
Yes, postfix never drops mails even when its mail system is down. Other helper daemons like cron will check if the Postfix daemons
are down for whatever reason, so postfix mails should not be lost, either.
Note
How Postfix receives mail
postdrop - Postfix mail posting utility
sendmail - Postfix to Sendmail compatibility interface
| sending emails with heirloom, even when Postfix is not running locally |
1,510,869,739,000 |
I'm looking into creating my first email server on CentOS Linux. I know it can be a challenge when it comes to managing one, but I'm up for the challenge. If I have my domain name pointed directly to my email servers IP address, would I still have to add MX Records to my DNS? As far as i know, the email server should work with Apple mail that is built in to my computer that should connect with IMAP on the SMTP server port. I'm considering using IRedMail for my email server since it looks like it could make setup a lot easier for me. Any suggestions on what I should first know before creating my own email server would be appreciated!
|
if i have my domain name pointed directly to my email servers IP Address would i still have to add MX Records to my DNS?
an MX record tells the internet what servers are responsible for handling incoming mail. so without an MX record, an email sent to your domain, would bounce back, as the remote email server would not know where to send it. if you want to receive mail, you need an MX record. (you also would want to implement SPF and domain keys to verify your domain email server as well). just google this and read up on it.
the email server should work with Apple mail that is built in to my computer that should connect with IMAP on the SMTP server port.
IMAP and SMTP, in this instance, is about your email client. IMAP is used by the client to retrieve mail from the server, and SMTP in this case is used by the client to send mail. so dont confuse this with an IMAP service on the server, nor SMTP as used by the email server to forward on email, based on MX records (and SPF/DKIM for domain verification.
in short, you need to google these things and understand the difference, before deploying your email server.
| Creating an email server on CentOS 6 |
1,510,869,739,000 |
I've successfully configured fetchmail and I'm able to download messages from the mail server but I'm not sure how to get the date on which a particular email was received. I need this date for reporting purposes.
|
That date is found inside the email headers. They look a bit like this:
Received: from mail-pd0-f170.google.com (mail-pd0-f170.google.com [209.85.192.170])
by mailserver.example.com (Postfix) with ESMTP id DCFEE3983D
for <[email protected]>; Tue, 23 Jul 2013 20:32:34 +0200 (CEST)
Received: by mail-pd0-f170.google.com with SMTP id x11so8452192pdj.29
Every mail server that the email passes by will add its own received-line on top of the preceding ones. Look for the one containing the host name of your mailserver and get the date from there.
| Unix Fetchmail Utility: date on which email was received |
1,510,869,739,000 |
I'm writing a script to run certain processing activities (mainly moving some data files to another machine where they can backed up), but I only know when to trigger the copy when a mail is delivered to a specific folder in an IMAP mailserver (which is outside my network).
So I'm looking for something that can only perform a mail check and in case of new mail trigger the script. I do not want to download the contents of the IMAP folder unless there is no other choice.
Can fetchmail, getmail or offlineimap do this, or is there anything else?
|
Check imapfilter, which this you can check remote imap server - https://github.com/lefcha/imapfilter
| Checking mail and running a script without downloading |
1,510,869,739,000 |
Note: I use tcsh.
I am trying make an alias that will use the mutt command to send an email with a pre-written body and subject line but that will take the alias argument and attach it to the email. The best I currently have is:
alias emailattach 'echo "Message Body" | mutt -a \!:1 -s "Subject" [email protected]'
This alias sets just fine, without any whining, but when I try to run it I get the following message:
Can't stat [email protected]: No such file or directory
[email protected]: unable to attach file.
When I remove -a \!:1
I no longer get the error message, so I believe the problem could be focused on this portion of the alias. The files I've told emailattach to attach are real, attachable files (a PDF specifically), so that's not the issue.
I also tried the same alias but without the single quotes and I only got this error:
[email protected]: unable to attach file.
To see if the pipeline was the crux of the problem I tried the following:
alias emailattach mutt -a \!:1 -s "Subject" [email protected]
and then tried just running:
echo "Message Body" | emailattach /path/to/attachment
which gave the same error message as I first listed(can't stat...unable to attach file.). However, when I just ran:
echo "Message Body" | emailattach
I got this error:
Bad ! arg selector.
Which I assume is just an error saying that I forgot to put in the required argument.
What have I written wrong in my alias that makes it not work?
|
Try changing your alias around so that the attachment is last in your call to mutt like so:
$ alias emailattach 'echo "Message Body" | mutt -s "Subject" [email protected] -a \!:1'
Doing it this way worked for me.
| Problem Aliasing a Command With a Pipeline and an Argument |
1,510,869,739,000 |
E.g. if I want to send a bunch of emails along the lines of "What does it feel like to X?" to [email protected] (Quora allows and even somewhat encourages me to ask highly similar questions there).
And then give a dictionary of words that I want to substitute for X?
I know that the mailx readme has a small section on how to send mail with scripts
|
If you mean doing this via shell, then yes this is possible. We may have a different result in mind but the operation is similar to this structure I have written previously to deliver the message via shell.
See: http://www.akamay.net/PUBLIC/massmail.tar
The script uses three (3) files.
Credential File - The actual configuration file. Put it in /tmp
HEAD_FROM="BSDUSER" # Mail from:
HEAD_TO="${FIELD1[$a]}" # Rcpt to:
HEAD_REPLY-TO="[email protected]" # Reply to :)
HEAD_BCC-TO="[email protected]" # BCC to
HEAD_SUBJECT="NOTICE - Personalize mass mail for ${FIELD3[$a]}"
HEAD_PRIORITY="High" # Low / Medium / High
HEAD_IMPORTANCE="3" # Importance
HEAD_MIME-VERSION="1.1" # MIME Version
HEAD_CONTENT-TYPE="text/plain" # Plain or HTML
TEAM_CONTACT="[email protected]" # Signature @ EOF
INTERVAL="2" # Sleep sec. per send
Owner File - The file containing your FIELD'ed values separated by a ":".
john:Tuesday:john:[email protected]
sally:Wednesday:sally:[email protected]
lisa:Friday:lisa:[email protected]
The actual massmail script. The script is simple. What it does is to parse the configuration file using a for loop with the value of the given fields: field1,2,3 etc. What I did is to substitute this values from the CSV file, store it in an executable text with the correct format and pipe everything to sendmail.
F1=`cat $2 | cut -d: -f1 | perl -ne 'chomp;print" $_"' | sed 's/^[ \t]*//;s/[ \t]*$//'`
F2=`cat $2 | cut -d: -f2 | perl -ne 'chomp;print" $_"' | sed 's/^[ \t]*//;s/[ \t]*$//'`
F3=`cat $2 | cut -d: -f3 | perl -ne 'chomp;print" $_"' | sed 's/^[ \t]*//;s/[ \t]*$//'`
F4=`cat $2 | cut -d: -f4 | perl -ne 'chomp;print" $_"' | sed 's/^[ \t]*//;s/[ \t]*$//'`
F5=`cat $2 | cut -d: -f5 | perl -ne 'chomp;print" $_"' | sed 's/^[ \t]*//;s/[ \t]*$//'`
echo -e "#!/bin/bash" > $TMP/notify_exec
echo -e "FIELD1=($F1)\nFIELD2=($F2)\nFIELD3=($F3)\nFIELD4=($F4)\nFIELD5=($F5)\n" >> $TMP/notify_exec
echo -e "for ((a=0;a<\${#FIELD1[*]};a++))\ndo" >> $TMP/notify_exec
echo -e "echo \"From:$C_F" >> $TMP/notify_exec
echo -e "To:$C_T\nReply-to:$C_RT\nBcc-to:$C_BT\nSubject:$C_S\nPriority:$C_P" >> $TMP/notify_exec
echo -e "X-Mail-Priority:$C_I\nMime-Version:$C_M\nContent-Type:$C_C\n$C_MSG\n\n\n" >> $TMP/notify_exec
echo -e "Generated using: $0 - Got questions? E-Mail us at: $C_TM" >> $TMP/notify_exec
echo -e "\" | /bin/sendmail -t -oi" >> $TMP/notify_exec
echo -e "sleep $C_SL" >> $TMP/notify_exec
echo -e "done\nexit 0" >> $TMP/notify_exec
chmod +x $TMP/notify_exec
I ran into some issues with using mailx regarding the custom reply so I switched with sendmail to deliver the message and it works fine.
| How would I automate sending highly similar emails with one word changed? |
1,510,869,739,000 |
I need to add rules to my mail server. I need to bcc an email address on outgoing and incoming emails for certain email accounts.
The first thing I need to do is to find out what mail server software I'm using! I have ssh access to our dedicated server, but everything was set up by the hosting company. Is there a way I can easily find out what mail server software I have running?
Then I need to configure it to add the rules. I guess that this will be different for all mail servers? Or is there a simple way to do it using ssh that is the de facto standard way of doing it?
Thank you.
In answer to sachin divecar:
tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN 5145/tcpserver
In answer to steve (commenter):
Connected to mail.mysite.com.
Escape character is '^]'.
220 myhost.com ESMTP
Steve, I don't know what you've let yourself in for! :p
1 ? 00:00:01 init
2 ? 00:00:00 kthreadd
3 ? 00:00:00 migration/0
4 ? 00:00:03 ksoftirqd/0
5 ? 00:00:00 watchdog/0
6 ? 00:00:00 migration/1
7 ? 00:00:06 ksoftirqd/1
8 ? 00:00:00 watchdog/1
9 ? 00:00:00 migration/2
10 ? 00:00:03 ksoftirqd/2
11 ? 00:00:00 watchdog/2
12 ? 00:00:00 migration/3
13 ? 00:00:04 ksoftirqd/3
14 ? 00:00:00 watchdog/3
15 ? 00:00:09 events/0
16 ? 00:00:05 events/1
17 ? 00:00:05 events/2
18 ? 00:00:05 events/3
19 ? 00:00:00 khelper
54 ? 00:00:00 kblockd/0
55 ? 00:00:00 kblockd/1
56 ? 00:00:00 kblockd/2
57 ? 00:00:00 kblockd/3
60 ? 00:00:00 kacpid
61 ? 00:00:00 kacpi_notify
136 ? 00:00:00 kseriod
193 ? 00:00:00 pdflush
194 ? 00:00:27 pdflush
195 ? 00:00:08 kswapd0
238 ? 00:00:00 aio/0
239 ? 00:00:00 aio/1
240 ? 00:00:00 aio/2
241 ? 00:00:00 aio/3
884 ? 00:00:00 couriertls
1441 ? 00:00:00 ksuspend_usbd
1443 ? 00:00:00 khubd
1458 ? 00:00:00 ata/0
1459 ? 00:00:00 ata/1
1460 ? 00:00:00 ata/2
1461 ? 00:00:00 ata/3
1462 ? 00:00:00 ata_aux
1762 ? 00:00:00 scsi_eh_0
1763 ? 00:00:00 scsi_eh_1
2860 ? 00:00:00 scsi_eh_2
3103 ? 00:00:39 kjournald
3275 ? 00:00:00 udevd
3685 ? 00:00:00 kpsmoused
4775 ? 00:00:00 ntpd
4776 ? 00:00:00 ntpd
4990 tty4 00:00:00 getty
4991 tty5 00:00:00 getty
4993 tty2 00:00:00 getty
4995 tty3 00:00:00 getty
4997 ? 00:00:00 svscanboot
4998 tty6 00:00:00 getty
5110 ? 00:00:03 svscan
5111 ? 00:00:00 readproctitle
5112 ? 00:00:00 supervise
5113 ? 00:00:00 supervise
5114 ? 00:00:00 supervise
5115 ? 00:00:00 supervise
5116 ? 00:00:00 supervise
5117 ? 00:00:00 supervise
5118 ? 00:00:00 tcpserver
5119 ? 00:00:02 tinydns
5120 ? 00:00:00 multilog
5121 ? 00:00:00 multilog
5122 ? 00:00:00 supervise
5123 ? 00:00:00 tcpserver
5124 ? 00:00:00 multilog
5125 ? 00:00:00 tcpserver
5127 ? 00:00:00 supervise
5128 ? 00:00:00 supervise
5129 ? 00:00:00 supervise
5131 ? 00:00:00 multilog
5132 ? 00:00:08 qmail-send
5133 ? 00:00:00 supervise
5134 ? 00:00:00 run
5135 ? 00:00:02 multilog
5136 ? 00:00:00 supervise
5137 ? 00:00:00 run
5143 ? 00:00:00 supervise
5145 ? 00:00:00 tcpserver
5146 ? 00:00:00 supervise
5148 ? 00:00:00 multilog
5176 ? 00:00:02 qmail-lspawn
5177 ? 00:00:00 qmail-rspawn
5178 ? 00:00:02 qmail-clean
5233 ? 00:00:00 acpid
5240 ? 00:00:00 fghack
5241 ? 00:00:00 fghack
5242 ? 00:00:00 ald <defunct>
5243 ? 00:00:00 ald <defunct>
5244 ? 00:00:13 ald
5262 ? 00:00:00 ald
5309 ? 00:00:00 dd
5311 ? 00:00:00 klogd
5331 ? 00:00:00 sshd
5388 ? 00:00:00 mysqld_safe
5416 ? 00:07:06 mysqld
5417 ? 00:00:00 logger
5710 ? 00:01:47 clamd
5811 ? 00:00:40 freshclam
5826 ? 00:00:00 courierlogger
5827 ? 00:00:00 authdaemond
5842 ? 00:00:00 courierlogger
5843 ? 00:00:00 couriertcpd
5846 ? 00:00:03 authdaemond
5847 ? 00:00:03 authdaemond
5864 ? 00:00:00 courierlogger
5865 ? 00:00:00 couriertcpd
5878 ? 00:00:00 courierlogger
5879 ? 00:00:00 couriertcpd
5898 ? 00:00:00 courierlogger
5899 ? 00:00:00 couriertcpd
5977 ? 00:00:00 xinetd
5999 ? 00:00:00 atd
6010 ? 00:00:01 cron
6093 ? 00:00:22 apache2
6268 tty1 00:00:00 getty
6356 ? 00:00:00 dd
6361 ? 00:00:00 cron
6395 ? 00:00:02 syslogd
6398 ? 00:00:01 sshd
6426 ? 00:00:00 mysqld_safe
6468 ? 00:30:46 mysqld
6469 ? 00:00:00 logger
6471 ? 00:00:45 apache2
8092 ? 00:00:00 apache2
8435 ? 00:00:00 apache2
8438 ? 00:00:00 apache2
8492 ? 00:00:00 pure-ftpd-mysql
9017 ? 00:00:00 imapd
9019 ? 00:00:00 gam_server
9234 ? 00:00:00 apache2
9741 ? 00:00:00 pure-ftpd-mysql
9742 ? 00:00:00 pure-ftpd-mysql
9792 ? 00:00:00 sshd
9794 pts/0 00:00:00 bash
9805 pts/0 00:00:00 ps
16916 ? 00:00:00 apache2
16917 ? 00:00:00 mapssl
16987 ? 00:00:00 syslogd
17527 ? 00:01:52 python
|
Answer to your first question.
netstat -lntp | fgrep ':25'
You can get the process running as smtp server in the last column of the output of the above command. Post this output, then we can discuss further.
As it is tcpserver, most probably you are using qmail. I have never used Qmail but I can give you some instruction after googling for sometime.
Qmail provides the ability to make a copy of each email that flows through the system. This is done using the QUEUE_EXTRA code. See Qmail FAQ.
You may need to install qmail patch named tap which adds this additional functionality to qmail to create control rules to make automatic cc/bcc of mails.
| Adding rules to my mail server |
1,510,869,739,000 |
When I try to send email from alpine I get the following error:
Error sending: connection failed to gmail-smtp...
(The message disappear before I have the time to copy it).
I suspect this is a firewall issue (I'm in a university campus). How can I fix this (or at least confirm)?
Edit:
I tried to telnet:
yotam@sumsum:$> telnet smtp.gmail.com 587
Trying 209.85.229.109... telnet:
Unable to connect to remote host: Connection timed out
|
Try connecting directly to the SMTP port on the server via telnet? See the Wikipedia page for an illustrative example. Start with the following (for a SMTP connection at port to smtp.gmail.com at port 25). Replace with the server and port you are using. In the following, EHLO and HELP are typed at the client prompt, as part of the SMTP negotiation. Note that the server response TO HELP is to point you to a copy of the Simple Mail Transfer Protocol (SMTP).
$ telnet smtp.gmail.com 25
Trying 74.125.53.109...
Connected to gmail-smtp-msa.l.google.com.
Escape character is '^]'.
220 mx.google.com ESMTP k9sm2692779pbc.22
EHLO
250-mx.google.com at your service, [59.183.41.125]
250-SIZE 35882577
250-8BITMIME
250-STARTTLS
250 ENHANCEDSTATUSCODES
HELP
214 2.0.0 http://www.google.com/search?btnI&q=RFC+2821 k9sm2692779pbc.22
If you can get this far, I suspect you don't have connection issues. Just one question to clarify. Is Alpine trying to deliver your mail directly, or are you handing off the mail delivery to a local mail server eg. Exim or Postfix? I have all my mail handed off to Exim, and then Exim sends it to a smarthost, which seems the preferred thing to do for hosts that don't have a static IP address at least. One advantage of the latter approach is that you can look at your mail server logs and/or queue to see what is happening with your mail.
| alpine failed to connect to smtp.gmail.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.