date int64 1,220B 1,719B | question_description stringlengths 28 29.9k | accepted_answer stringlengths 12 26.4k | question_title stringlengths 14 159 |
|---|---|---|---|
1,510,869,739,000 |
I am currently working on a program converting mailbox files from an old, tenex based mail format to mbox. The tenex mailbox format has separator lines like the mbox format (the latter is called the From_ line),
tenex:
7-Feb-86 21:41:21-EST,1925;000000000000
mbox:
From [email protected] Fri Feb 07 14:20:00 1986
but due to a lack of documentation, the origin of the datetime stamp in the separator line of a "tenex formatted" file is obscure.
Hence, when transforming a message from the tenex to mbox format, I used the datetime stamp from date-header field for constructing the From_ line for the mbox formatted message, not the one in the separator line of the tenex formatted file.
But RFC4155, an attempt to describe "the" mbox format (there are actually several different formats) and supply a kind of standard for this file format, states:
Each message begins with a separator line that identifies the message
sender, and also identifies the date and time at which the message was
received by the final recipient (either the last-hop system in the
transfer path, or the system which serves as the recipient's
mailstore).
Hence, I am in doubt that my approach using the datetime stamp from the date header field is correct.
But, without having the transport envelope, from where can I get the actual datetime stamp of the final recipient receiving the message? Is this the datetime stamp in the last entry of the of Received header field(s)?
|
The "From_" line is written by the mail.local program (originally called mail in the 7th Edition Unix) with the timestamp being the actual time when the message is written to the mailbox.
I.e. "the date and time at which the message was received by the final recipient" is actually the time the message was written into the recipient's mailbox file, which is exactly when the final recipient "receives" the message.
The code for writing the initial separator line in an "mbox" file, prior to the message content, is quite literally:
time(&tval);
fprintf(fp, "From %s %s", from, ctime(&tval));
So, if the timestamp in the separator line in TENEX mailboxes is also the "received" time (which is what the Pine Technical Notes say about it: The time in the header is the time that message was written to the folder.), so then you just need to reformat it. These timestamps have exactly the same meaning.
| email: Where does the datetime stamp in the From_ line of an mbox mail message stem from? |
1,510,869,739,000 |
Let's say I have:
40 outbound emails to send
main domain - main_domain.com
4 separate domains-workers with Postfix - mail.my_postfix1.com...mail.my_postfix4.com
Goal: send 10 emails via each of 4 worker-Postfix domains, on behalf of main_domain.com. In other words, let the main domain use 4 domains with Postfix to send outbound emails, equally so.
Question: How? What is it what should be set up in terms of DNS records?
Since MX records are required to receive the email, that is, for inbound emails, what is it that's required to send, outbound, emails?
|
You will have to specify a SPF record for your domain handled by your servers (https://en.wikipedia.org/wiki/Sender_Policy_Framework).
All of your MTAs needs to appear in this records.
Additionally, it would help to add a DKIM record also, so that the big providers won't reject your outbound mails (https://en.wikipedia.org/wiki/DomainKeys_Identified_Mail).
| What's required to let a domain send outbound emails from multiple domains? |
1,510,869,739,000 |
I have installed a Raspberry device on my home network from which I want to receive periodic e-mails for a certain manner.
I wish to use the mailutils in order to send them via my scripts but I didn't quite manage to set up postfix successfully in order to do that.
Specifically, when is it possible to do this by linking one gmail account that I have? If so, how can this be achieved? While configuring the postfix i am asked to provide my hostname but...that's a localhost machine running on my home network.
Which steps should I follow here?
|
I would not use postfix, sendmail or Exim for this purpose. Far easier to configure and less resource hungry is any lightweight, send-only MTA like:
https://wiki.debian.org/msmtp, or
https://wiki.debian.org/sSMTP
I used ssmtp and it is dead simple and effective. msmtp is a newer replacement, a bit more flexible one.
Once you have msmtp installed use GMail smtp server only. If you do not know how to do it switch on pop/smtp access on GMail and have for example Thunderbird configured for GMail. You can than use the same settings in msmtp as described in the Debian wiki.
| Setting up a local machine to only send e-mails |
1,510,869,739,000 |
I'm attempting to setup a postfix relay system for my LAN. A lot of my services are blocked from WAN access and I want to be able to get notifications from them.
As it stands it currently "works" but each e-mail is accompanied by a "Mailer Deamon Undeliverable" e-mail because it's sending correctly but always trying to BCC: [email protected] which doesn't resolve. I only use @domain.com for e-mail.
Here is my config for a "guest" VM (sends via the relayhost), I've tried a bunch but am out of ideas any help is appreciated.
I wonder If I can fix this somehow in the relayhost vs the guests?
/etc/postfix/main.cf
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no
append_dot_mydomain = no
readme_directory = no
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = domain.com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = domain.com
mydestination = domain.com, localhost
relayhost = smtp.domain.com
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = loopback-only
inet_protocols = all
masquerade_domains = domain.com
#THINGS I HAVE TRIED...##
#smtp_header_checks = regexp:/etc/postfix/header_checks
#transport_maps = hash:/etc/postfix/transport
#smtpd_recipient_restrictions = check_recipient_access hash:/etc/postfix/bad_recipients, permit_mynetworks, reject_unauth_destination, permit
#transport_maps = pcre:/etc/postfix/transport_maps
#smtp_generic_maps = hash:/etc/postfix/generic
/etc/aliases
postmaster: root
root: [email protected]
trash: /tmp/mail.trash
|
I had an issue with mydestination. I should not have had domain.com in that field. I removed it and set it to mydestination = hostname hostname.domain.com localhost and now it works as expected.
| Postfix always BCC [email protected] |
1,561,651,785,000 |
Is there a quick and easy method to send an email (I already have automatic emails coming from the server for other events - I just need to be able to send one for this specific event) if a USB port restarts and, by extension, an external drive goes offline?
I installed a new CCTV system in my father in law's house last year, and as an added bonus, I bought him a Raspberry PI, set it up as a VPN and file server, and set the cameras to directly record on motion to some NFS shares I've set up on an external drive on the PI so that there were two copies of anything important if someone had the brains to steal the NVR.
But the cameras kept losing the storage and required a reboot to bring the storage back online.
I assumed this was a POE issue, as the cameras themselves were also sometimes rebooting when powered directly from the NVR, but after installing a POE switch and changing the network config a bit, that has ceased.
I checked today though and found the cameras had again lost their secondary storage. Investigating further, I narrowed down the time, and checked the syslog on the PI. I found that it had suffered a USB issue.
usb 1-1.1-port2: disabled by hub (EMI?), re-enabling...
This was followed by thousands of messages regarding the drives going offline, coming online, and the cameras attempting to access the NFS shares.
What I want is for the system to ping me an email if this event is logged to the syslog file, or simply when one of the filesystems goes offline, so I can ring him to see if he's doing anything specific.
It may be something as simply as a dodgy USB lead or drive enclosure (we got a self powered enclosure to save the PI from having to spin a 3.5" HDD) so it may even be the PSU, but I'd like to try to identify anything happening while the failures are occurring before getting a new HDD enclosure that may not solve the issue.
The PI itself is powered by the official Pi 3 psu. The casing of the PI is aluminium (I can't remember the specific one I bought but it's all metal to act as a heat sink) but it's fairly hidden away in behind the monitor in his study so it's unlikely to be getting shifted about much and shorting against anything.
Edit at request of K7AAY
The Pi is running Raspbian 9
I will be modifying the following script if the solution involves a method that can run a script.
#bin/sh
IPADDRESS=$(curl https://wtfismyip.com/text)
if [ "$IPADDRESS" != "$(cat /home/will/scripts/.current_ip)" ]
then
dt=$(date)
echo "Your new IP address as of ${dt} is ${IPADDRESS} \r \r FTB" | mail -s "IvanPI IP address change" **********@gmail.com
echo "$IPADDRESS" >| /home/will/scripts/.current_ip
echo "$dt $IPADDRESS" >> /home/will/scripts/.iphistory
fi
the only command I need to issue if the above event occurs will be
echo "External HDD offline/USB restarted at ${dt} \r \r FTB" | mail -s "IvanPI HDD Offline" *************@gmail.com
I just need to know how to trigger that command to occur if the HDD goes offline/Filesystem goes offline/USB port restarts.
Any of these events would be suitable to generate the trigger for the email, since they're all essentially the same thing.
|
Trafikito and monit are reasonably lightweight services which can monitor your drive, and if it fails, go check the USB port status. Then, either can mail out a message. Suggest you review their feature sets and see which you prefer.
| Method to automatically email if a drive goes offline (or a USB port is restarted) |
1,561,651,785,000 |
I have a number of Drupal websites running under several different domains. These websites must be able to send emails to users. Furthermore, I have a Zimbra mail server running. In Drupal I can either choose to send emails via SMTP or sendmail.
Actually, I'd rather use the SMTP option so that I utilize my mail server's DKIM setup. But I can't really make it work. I just got my mail server up and running today, so I'm not yet familiar with it.
But what is the best way to handle outgoing emails from multiple domains? Is it using Zimbras MTA or should I rather try to configure sendmail?
It is of course a requirement that DKIM support must be provided so that my emails are not sorted out as spam.
|
For me it is better to let Zimbra manage domains. One important point is to have proper DNS record for each domains. Also if you have idea to use SSL/TLS to have certificate and key for this domain (as well as CA intermediate certificates)
For more details you can check official Zimbra wiki
| How to send emails from multiple domains |
1,561,651,785,000 |
I am migrating a mailserver running sendmail 8.14.3 to a postfix server. The MDA on the new server is Dovecot. In order to ensure a seamless transition, it would be best if incoming mails are delivered to both servers simultaneously.
I've heard about the SMART_HOST and nullcient options in sendmail, but I'm not sure if this works in the way I need it to. What I need is all incoming mails also delivered to the new server, leaving the existing configuration untouched, as they should be delivered to the mailboxes on the old server as well.
Mails are sent to an address like [email protected] and should be delivered to mx1.mydomain.com (old) and mx2.mydomain.com (new). So mx1 should forward a copy to mx2.
Dual MX Records are not enough as the one server would only be contacted when the other one isn't reachable - while both should be receiving the mail.
Maybe another option would be to configure sendmail to deliver directly to Dovecot on the new server via lmtp? Or maybe just rsync the mailboxes on the two servers. But I'm not sure if that's compatible.
UPDATE: It's not the same format: on the old server, there are just plain old files for each mailbox, while Dovecot creates a cur, new tmp structure in each user's mail directory. However, in the end, files with a similar format reside in those directories. The speration string is different though. Maybe it's possible to translate the old format and copy it to the new server periodically? Would that somehow interfere with Dovecot? And where could I place the copies on the new server so that Dovecot won't be affected while still recognising them?
I hope there is some kind of workaround for that.
System Indormation
Number of mailboxes: ~100-200
Old Server:
OS: Debian GNU/Linux 6.0
sendmail 8.14.3
mails are delivered to "real"/"passwd" users
Other Serives: apache2, mysql, other miscellaneous
New Server:
OS: Debian GNU/Linux 9
postfix
dovecot
mails are delivered to virtual users/SQL
Other services: apache2, mysql, other miscellaneous
Current MX entry for reference:
mydomain.com. IN MX 0 mx1.mydomain.com.
mydomain.com. IN MX 1 mx2.mydomain.com.
|
I can't test this right now but I'm fairly sure sendmail understands entries in /etc/aliases of the form
fred: fred, fred@otherserver
(If it goes into a mad loop, prefix the second fred with a backslash \.)
Then it's a straightforward extract from /etc/passwd into the aliases file. And remember to run newaliases (?) to update the internal sendmail database.
Here is an example snippet to generate the lines that would be appended. It considers only users whose UID is in the range { 1000 ≤ uid < 65000 }.
[ ! -f /etc/aliases.save ] && cp -p /etc/aliases /etc/aliases.save
(
cat /etc/aliases.save
echo
getent passwd |
awk -F: '$3>=1000 && $3<65000 {printf "%s: %s, %[email protected]\n", $1, $1, $1}'
) >/etc/aliases
newaliases
| Sendmail migration: Replicating all incoming mails to another mailserver |
1,561,651,785,000 |
Some server send email without Date header, and Thunderbird doesn't recognize the date.So, I want to use following settings and add Date header.
local_header_rewrite_clients = permit_inet_interfaces, ermit_sasl_authenticated
always_add_missing_headers = yes
But postfix.org says this may break DKIM signatures.
Is there a way to add Date headers withoud break DKIM signatures ?
(My mail server using DKIM.)
Example of no Date header mail :
Return-Path: <[email protected]>
X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on example.net
X-Spam-Level: ***
X-Spam-Status: No, score=3.7 required=8.0 tests=CONTENT_TYPE_PRESENT,
FROM_MISSP_EH_MATCH,IP_LINK_PLUS,ISO2022JP_BODY,ISO2022JP_CHARSET,
MISSING_DATE,MISSING_MID,NORMAL_HTTP_TO_IP,ONEGAI,QENCPTR1,RCVD_IN_DNSWL_NONE,
RCVD_IN_MSPIKE_H2,RENRAKU,SPF_HELO_PASS,SPF_SOFTFAIL,TO_NO_BRKTS_FROM_MSSP
autolearn=no autolearn_force=no version=3.4.0
X-Original-To: [email protected]
Delivered-To: [email protected]
Received: from xxxxx.example.org (xxxxx.example.org [xxx.xxx.xxx.xxx])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by example.net (Postfix) with ESMTPS id D53991D45
for <[email protected]>; Wed, 5 Sep 2018 20:44:48 +0900 (JST)
DKIM-Filter: OpenDKIM Filter v2.11.0 example.net D53991D45
Received: from xxxxx.example.org (xxxxx.example.org [xxx.xxx.xxx.xxx])
by xxxxx.example.org (Postfix) with ESMTP id 77EFF8DC01
for <[email protected]>; Wed, 5 Sep 2018 20:44:48 +0900 (JST)
Received: (qmail 23991 invoked by uid 101); 5 Sep 2018 20:44:43 +0900
Received: from unknown (HELO xxxxx.example.org) (xxx.xxx.xxx.xxx)
by 0 with SMTP; 5 Sep 2018 20:44:43 +0900
Subject: ---email subject---
From: ---email subject---
To: ---email subject---
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-2022-JP
Content-Transfer-Encoding: 7bit
X-Mailer: Bap Version1
---email body---
|
It doesn't really matter that your server uses DKIM. A DKIM signature is something added by the sender, and making one requires the sender's private key.
As a part of DKIM signing, the sender's mail server takes some headers, typically including the Date header, concatenates these, and cryptographically signs the result. If you change any of those headers, or add one that wasn't there, you change the concatenated string and the signature will be invalid.
The mail you show is not DKIM signed.
The short version is: You can't do what you ask about.
| How to add Date: header to received emails without break DKIM signatures |
1,561,651,785,000 |
I have been receiving since a long time following mails:
From: Cron Daemon <[email protected]>
Subject: Cron <root@cloud-vps> test -x /usr/sbin/anacron || ( cd / &&
run-parts --report /etc/cron.daily )
To: [email protected]
/etc/cron.daily/clamscan_daily:
Starting a daily scan of / directory.
Amount of data to be scanned is 4.4G.
LibClamAV Warning: cli_scanxz: decompress file size exceeds limits -
only scanning 27262976 bytes
LibClamAV Warning: cli_scanxz: decompress file size exceeds limits -
only scanning 27262976 bytes
LibClamAV Warning: fmap_readpage: pread fail: asked for 4094 bytes @
offset 2, got 0
LibClamAV Warning: fmap_readpage: pread fail: asked for 4072 bytes @
offset 24, got 0
LibClamAV Warning: fmap_readpage: pread fail: asked for 4094 bytes @
offset 2, got 0
LibClamAV Warning: fmap_readpage: pread fail: asked for 4051 bytes @
offset 45, got 0
LibClamAV Warning: fmap_readpage: pread fail: asked for 4094 bytes @
offset 2, got 0
LibClamAV Warning: fmap_readpage: pread fail: asked for 4073 bytes @
offset 23, got 0
LibClamAV Warning: fmap_readpage: pread fail: asked for 4067 bytes @
offset 29, got 0
LibClamAV Warning: fmap_readpage: pread fail: asked for 4090 bytes @
offset 6, got 0
LibClamAV Warning: fmap_readpage: pread fail: asked for 4091 bytes @
offset 5, got 0
LibClamAV Warning: fmap_readpage: pread fail: asked for 4091 bytes @
offset 5, got 0
LibClamAV Warning: fmap_readpage: pread fail: asked for 4092 bytes @
offset 4, got 0
LibClamAV Warning: fmap_readpage: pread fail: asked for 4094 bytes @
offset 2, got 0
LibClamAV Warning: fmap_readpage: pread fail: asked for 4090 bytes @
offset 6, got 0
LibClamAV Warning: fmap_readpage: pread fail: asked for 4093 bytes @
offset 3, got 0
LibClamAV Warning: fmap_readpage: pread fail: asked for 4094 bytes @
offset 2, got 0
LibClamAV Warning: fmap_readpage: pread fail: asked for 4094 bytes @
offset 2, got 0
LibClamAV Warning: fmap_readpage: pread fail: asked for 4094 bytes @
offset 2, got 0
LibClamAV Warning: fmap_readpage: pread fail: asked for 4092 bytes @
offset 4, got 0
LibClamAV Warning: fmap_readpage: pread fail: asked for 4094 bytes @
offset 2, got 0
LibClamAV Warning: fmap_readpage: pread fail: asked for 4094 bytes @
offset 2, got 0
[...]
WARNING: Can't open file /sys/module/jbd2/uevent: Permission denied
/etc/cron.daily/logrotate:
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: NO)'
error: error running shared postrotate script for
'/var/log/mysql/mysql.log /var/log/mysql/mysql-slow.log
/var/log/mysql/mariadb-slow.log /var/log/mysql/error.log '
run-parts: /etc/cron.daily/logrotate exited with return code 1
Can you tell me how to fix these errors? I have Apparmor disabled.
|
You need to resolve the password issue at the bottom of that email. The script is unable to access your MySQL server.
WARNING: Can't open file /sys/module/jbd2/uevent: Permission denied
/etc/cron.daily/logrotate:
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: NO)'
error: error running shared postrotate script for
'/var/log/mysql/mysql.log /var/log/mysql/mysql-slow.log
/var/log/mysql/mariadb-slow.log /var/log/mysql/error.log '
run-parts: /etc/cron.daily/logrotate exited with return code 1
Specifically this:
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: NO)'
Try logging into your MySQL DB that's locally on this server and verify the username/password work as expected. Then make sure that you can use mysqladmin to do the same as this CRON is attempting to do.
| Cron Daemon - LibClamAV errors |
1,561,651,785,000 |
Dear Unix and Linux Community,
I would like to use my hotmail account through alpine. I am using the POP3 protocol, and I am able to access the email from my Inbox.
However, I am unable to send any email directly through alpine. Upon trying to send an email, I obtain the following message:
[Sending mail | 100% |]
[Mail not sent. Sending error: 250 2.0.0 Resetting]
I am currently accessing the following SMTP server:
smtp-mail.outlook.com:587/pop3/[email protected]
I have also tried port 25 to no avail. Occasionally it gets stuck, displaying the following:
[Sending mail | 0% |]
Using the TLS encryption explicitly gives the same error message:
smtp-mail.outlook.com:587/[email protected]/tls
since TLS is implemented by default.
Any suggestions?
|
change the customized headers field or it won't work.
quoting from Alpine Faq:
From Alpine's [M]AIN MENU, choose [S]etup, then [C]onfig. Move down to
the Customized Headers option. Press "A Add Value". Use the format:
From: "My Real Name" <[email protected]>
although i used the key C ( means change values ) to change the value and W ( where is ) to find customized headers faster.
| Alpine with hotmail | SMTP | cannot send email |
1,561,651,785,000 |
Trying to setup a simple automation system has proved exceedingly complicated for me. Using scripts, I want to use email to perform remote tasks. The script outline:
Send an empty body email with the header as "Pattern1 (number)"
Read the last 50 email headers.
Find latest header matching "Pattern2 (number)".
Save (echo) the number from that header into a file.
Wait 5 minutes
Loop to 1.
I'm trying to using as few programs as possible. Currently, have Mutt for email sending and retrieval. And grepmail (with grepm script) for searching emails.
Am I way off on using Mutt and grepmail? I'm confused as a non-sysadmin. Mutt isn't great for scripting. What's the simplest way to set this up?
|
It can all be done with only curl.
Send email
MSG="From: [email protected]
To: Receiver
Subject: Test"
echo "$MSG" | curl --url 'smtps://smtp.gmail.com:465' --ssl-reqd \
--mail-from "[email protected]" --mail-rcpt "[email protected]" \
--upload-file - --user "[email protected]:password" --insecure
To read mail, first you have to know how many emails are in the INBOX.
EXISTS="$(curl --insecure \
--user "[email protected]:password" \
--url 'imaps://imap.gmail.com:993/' \
--request "EXAMINE INBOX" | grep "EXISTS" | grep -oP '\d*' | head -n1 )"
echo "$EXISTS"
The newest email has the highest number. Print the subject of the last 5 emails, newest first.
for ((i=$EXISTS;i!=$EXISTS-5;i--)); do
SUBJECT="$(curl --insecure -u "[email protected]:password" \
--url "imaps://imap.gmail.com:993/INBOX;UID=$i" | \
grep "Subject: " | head -n1 )"
echo "$SUBJECT"
done
Notice: To enable smtp/imap access like this, you must go into gmail settings disable secure settings.
| Setup simple Automation system using Email |
1,561,651,785,000 |
I have an email server with public dns entry that sends and receives fine.
I am trying to add it to outlook as imap account but it keeps failing. Server error shows
Oct 30 15:29:04 mail.example.local dovecot[17250]: imap-login: Disconnected (auth failed, 1 attempts in 4 secs): user=<[email protected]>, method=PLAIN, rip=12.123.456.789, lip=123.4.56.7, session=<yjdfyjfkugih>
Oct 30 15:29:08 mail.example.local auth[17491]: pam_unix(dovecot:auth): check pass; user unknown
cat /etc/pam.d/dovecot
#%PAM-1.0
auth required pam_nologin.so
auth include password-auth
account include password-auth
session include password-auth
auth required pam_unix.so nullok
account required pam_unix.so
cat auth-system.conf.ext
PAM authentication. Preferred nowadays by most systems.
PAM is typically used with either userdb passwd or userdb static.
REMEMBER: You'll need /etc/pam.d/dovecot file created for PAM
authentication to actually work. <doc/wiki/PasswordDatabase.PAM.txt>
passdb {
driver = pam
# [session=yes] [setcred=yes] [failure_show_msg=yes] [max_requests=<n>]
# [cache_key=<key>] [<service name>]
#args = dovecot
}
|
I have solved the issue, after following this guide http://xmodulo.com/enable-user-authentication-postfix-smtp-server-sasl.html
It still didn't work, but turns out it was because my password had a '£' in which was causing the issue.
| imap-login: Disconnected |
1,561,651,785,000 |
I have a postfix + dovecot mail server, today while checking my logs I see login attempts from unknown users / ip adresses, I guess this has to be a brute force attack.
How could I stop and eventually prevent this?
Help would be much appreciated!
log:
Aug 24 15:36:34 mail dovecot: auth: passwd-file(zamudio,201.222.55.26): unknown user (SHA1 of given password: f72ac0)
Aug 24 15:36:36 mail postfix/smtpd[12568]: warning: unknown[201.222.55.26]: SASL LOGIN authentication failed: UGFzc3dvcmQ6
Aug 24 15:36:36 mail postfix/smtpd[12568]: disconnect from unknown[201.222.55.26] helo=1 auth=0/1 quit=1 commands=2/3
Aug 24 15:38:38 mail postfix/anvil[12413]: statistics: max connection rate 1/60s for (smtp:200.124.242.82) at Aug 24 15:30:49
Aug 24 15:38:38 mail postfix/anvil[12413]: statistics: max connection count 1 for (smtp:200.124.242.82) at Aug 24 15:30:49
Aug 24 15:38:38 mail postfix/anvil[12413]: statistics: max cache size 1 at Aug 24 15:30:49
Aug 24 15:39:34 mail postfix/smtpd[12571]: connect from unknown[190.117.185.251]
Aug 24 15:39:35 mail dovecot: auth: passwd-file(helene,190.117.185.251): unknown user (SHA1 of given password: cb4a0f)
Aug 24 15:39:37 mail postfix/smtpd[12571]: warning: unknown[190.117.185.251]: SASL LOGIN authentication failed: UGFzc3dvcmQ6
Aug 24 15:39:37 mail postfix/smtpd[12571]: disconnect from unknown[190.117.185.251] helo=1 auth=0/1 quit=1 commands=2/3
Aug 24 15:42:17 mail postfix/smtpd[12574]: connect from unknown[175.140.139.233]
Aug 24 15:42:18 mail dovecot: auth: passwd-file(payroll,175.140.139.233): unknown user (SHA1 of given password: 4de472)
Aug 24 15:42:20 mail postfix/smtpd[12574]: warning: unknown[175.140.139.233]: SASL LOGIN authentication failed: UGFzc3dvcmQ6
Aug 24 15:42:20 mail postfix/smtpd[12574]: disconnect from unknown[175.140.139.233] helo=1 auth=0/1 quit=1 commands=2/3
|
Your server is trying to use as open relay. You need define smtpd_relay_restrictions option. By default it use rules:
smtpd_relay_restrictions = permit_mynetworks,
permit_sasl_authenticated,
defer_unauth_destination
Which means that open relay is closed.
As your server is public, you need to humility with the constant attempts from internet bots to send mail through your server.
Use complex passwords
take care about Postfix security (Postfix SASL, Postfix TLS Support)
Or you can block other ips and allow only trusted ips/networks if your server works only as testing environment
| My Postfix mail server receives login attempts from unknown users (brute force attempt) - what to do? |
1,561,651,785,000 |
I didn't have mail installed before, so I've did it using:
apt-get install mailutils
After that I've tried to send a mail with this command:
mail -s "Ssubjects" [email protected]
But I see just this error message:
cannot send message: Process exited with a non-zero status
anyway I can't understand what is the problem. Should I configure something?
Thanks
|
Possible duplicate: mail: cannot send message: process exited with a non-zero status
Try:
sudo dpkg-reconfigure postfix
as proposed in the answer.
| 'mail' use problem from command line |
1,561,651,785,000 |
My corporate email is hosted by Office365. I think KMail is far more productive an email client than the Outlook Web Application (OWA), so I use IMAP to receive email and SMTP to send email.
I can receive email fine, but on certain networks I cannot send mail. For example, GoGo Inflight Internet (gogoair) or some of the corporate networks of my clients. On these networks, I get the following error from KMail:
Failed to transport message. smtp.office365.com: Socket operation timed out
Sending email to Gmail via SMTP through the same port (587) works fine.
I have configured KMail to send email as follows:
Outgoing mail server: smtp.office365.com
Port: 587
Encryption: TLS
I have tried:
Lengthening the socket timeout
Disabling IPV6
Disabling TCP Timestamps
but I see no change in behavior.
I don't see anything relevant in the journal, akonadi logs, or .xsession-errors
Anyone have a suggestion on what else I can try?
|
You can verify connectivity to STARTTLS enabled services using
the apps that ship with OpenSSL:
$ openssl s_client -starttls smtp -connect smtp.office365.com:587
If this succeeds, it will dump extensive information about the
servers’s SSL configuration and the handshake to the terminal.
You should then be able to talk to the server using ordinary SMTP
(send it an EHLO for example).
Otherwise you get either a connection error or a timeout.
In case of smtp.office365.com the handshake is successful
from here.
For more protocols supported with the -starttls parameter see
the OpenSSL documentation:
https://www.openssl.org/docs/man1.0.2/apps/s_client.html
| Kmail cannot send to smtp.office365.com |
1,561,651,785,000 |
I'm trying to sync my emails from an old server "server2" with a new one "server1"
imapsync \
--host1 imap.server1.com --user1 [email protected] --password1 fdsfdsfsfd \
--host2 imap.server2.com --user2 [email protected] --password2 fdsfdsfds \
--debugimap1 --debugimap2 \
--tls1 --tls2 --debugssl 4
Nothing happens at all. It gets frozen. In thunderbird I use SSL/TLS and the port 993 and Normal Password. However, there're no such options in imapsync.
When I remove "--tls1 --tls2" it produces no output at all and finished in a couple of seconds.
Where is an issue?
|
Replace --tls1 --tls2
by --ssl1 --ssl2
| Unable to sync email using imapsync |
1,561,651,785,000 |
Not so long ago I have found that exim is sending mail4root emails and logs them into /var/mail/mail. Example from exim log:
2016-07-19 09:39:02 1bPOgI-000370-1Q <= [email protected] U=root P=local S=78459
2016-07-19 09:39:02 1bPOgI-000370-1Q => /var/mail/mail <[email protected]> R=mail4root T=address_file
2016-07-19 09:39:02 1bPOgI-000370-1Q Completed
2016-07-19 09:40:18 Start queue run: pid=12117
2016-07-19 09:40:18 End queue run: pid=12117
2016-07-19 10:09:02 1bPP9K-00042T-LK <= [email protected] U=root P=local S=78459
2016-07-19 10:09:02 1bPP9K-00042T-LK => /var/mail/mail <[email protected]> R=mail4root T=address_file
2016-07-19 10:09:02 1bPP9K-00042T-LK Completed
2016-07-19 10:10:18 Start queue run: pid=15678
2016-07-19 10:10:18 End queue run: pid=15678
Can someone explain what causes it?
|
As a security measure Exim will not deliver email to root. The mail4root router is a last ditch handler to deliver mail for root to the mailbox for mail.
Normally, an alias for root would be configured in /etc/aliases to deliver to the system administrator's personal mailbox. There are a number of aliases that redirect to root as they should be handled by the system administrator (root). They also get redirected if the alias exists.
| Exim4 sends strange emails on root |
1,561,651,785,000 |
Im am trying to send mail using Postfix, but I get the following error for all emails:
May 13 12:44:46 myhost postfix/qmgr[12169]: A6D9644526: from=<[email protected]>, size=317, nrcpt=1 (queue active)
May 13 12:44:46 myhost postfix/smtp[12178]: A6D9644526: to=<[email protected]>, relay=none, delay=0.03, delays=0.02/0/0/0, dsn=4.4.3, status=deferred (Host or domain name not found. Name service error for name=gmail.com type=MX: Host not found, try again)
Reading the linked questions, I have already checked /etc/resolv.conf and /var/spool/postfix/etc/resolv.conf they both are same. my resolv.conf looks like :
nameserver 2001:4b98:dc0:49::225
nameserver 217.70.184.225
nameserver 217.70.184.226
options timeout:1 attempts:3 rotate
dig mx gmail.com works:
; <<>> DiG 9.9.5-3ubuntu0.8-Ubuntu <<>> mx gmail.com ;; global
options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status:
NOERROR, id: 64383 ;; flags: qr rd ra; QUERY: 1, ANSWER: 5, AUTHORITY:
4, ADDITIONAL: 15
Here is the content of /etc/postfix/main.cf:
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no
append_dot_mydomain = no
readme_directory = no
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = myhost
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = ipv4
Any idea why the mail host is not found?
|
It seems the error was due to the ipv6 address in /etc/resolv.conf.
I removed it and it now works.
| postfix MX host not found |
1,561,651,785,000 |
I want to download my emails via IMAP from email account and upload them to another. I want to do that manually in Python. I know how to retrieve my emails via IMAP, but how can I actually "upload" them to my another email account? Is there a standard way or does that depend on my 2nd email server?
|
You can upload with python as well:
import imaplib
# an alternative for IMAP4_SSL is IMAP4 if you're doing this locally
imap = imaplib.IMAP4_SSL(your_2nd_server, its_imap_portnumber)
imap.login(user_name, password)
and then for each message you downloaded:
imap.append(mailbox, [], delivery_time, message)
You have to get the delivery time out of the message header for this.
| How to upload my emails to another email server I've downloaded via IMAP from my 1st one? |
1,561,651,785,000 |
I'm in the process of transferring a clients mail service from cPanel to Virtualmin. This person has multiple email addresses on different domains. Everything is working fine except today I am transferring the last of his email accounts which is [email protected] but Virtualmin is giving me the following error:
Failed to save mailbox : The username domains is reserved for use by Virtualmin
I've tried asking the client if he would just switch this email address to something different (such as domain without the "s") but the problem is that the [email protected]email address is used as the registration email for all of his business contacts regarding domains and DNS such as registrars.
The main issue is that this is the domain he uses in all SOA records for more then 1000 separate domains. He is very adamant to keep the "domains" email address and for sure would not like to have to edit over 1000 zonefiles to update the SOA email.
Is there any way to get Virtualmin to release the lock on this email address? It is my understanding that Virtualmin reserves the logs@, virtualmin-backup@, and domains@ addresses.
Im open to any sort of work around even hard coded edits to get this working.
|
You would have to use a email alias in this case.
The reason is that domains, Logs, and virtualmin-backup are the names of sub-directories that Virtualmin creates under each domain's home, so allowing a username with the same name would cause them to clash.
A work-around for this is to create an email alias for [email protected] (on Mail Aliases page) that forwards to the actual mailbox with a different name.
However there is currently a bug in Virtualmin that still won't allow you to use these names as mail aliases - This is a bug as it should be possible to have an alias named domains (or the other reserved names).
Failed to save alias : Missing or invalid alias name (no @ should be included)
This should be fixed in an upcoming release.
Source - https://www.virtualmin.com/node/40377
| Virtualmin - How to use reserved email names? ([email protected]) |
1,561,651,785,000 |
THe issue i am having is that i am trying to create a email server but my emails are rejected due to invalid ptr record.
$TTL 600
@ IN SOA ns1.first-ns.de. postmaster.robot.first-ns.de. (
2016012407 ; serial
14400 ; refresh
1800 ; retry
604800 ; expire
600 ) ; minimum
@ IN NS robotns3.second-ns.com.
@ IN NS robotns2.second-ns.de.
@ IN NS ns1.first-ns.de.
@ IN A 136.243.6.76
dns1 IN A 136.243.6.76
dns2 IN A 136.243.6.76
localhost IN A 127.0.0.1
mail IN A 136.243.6.76
mx1 IN A 136.243.6.76
mx1.littlefeather.net IN A 136.243.6.76
www IN A 136.243.6.76
76.6.243.136.in-addr.arpa 3600 IN PTR mx1.littlefeather.net
the above zone file is from the master dns from hetzner. I copied this to my dns server as well. the reverse for my ip is
mx1.littlefeather.net
and my email server hostname is
mx1.littlefeather.net.
What is wrong with my dns zone file?
|
You must have your reverse and forward zones separate from each other at all times.
Example forward zone, zone "angelsofclockwork.net"
$ORIGIN angelsofclockwork.net.
$TTL 86400
@ IN SOA angelsofclockwork.net. palaceredirect.angelsofclockwork.net. (
410
3H
15M
1W
1D )
IN NS palaceredirect.angelsofclockwork.net.
palaceredirect IN A 10.100.0.1
IN AAAA 2001:470:1f19:138::1
myan IN A 10.100.0.103
IN AAAA 2001:470:1f19:138::4
Example reverse zone(s). First one is IPv4, zone "0.100.10.IN-ADDR.ARPA".
$TTL 86400
@ IN SOA @ root (
70 ; serial (d. adams)
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum
IN NS palaceredirect.angelsofclockwork.net.
1 IN PTR palaceredirect.angelsofclockwork.net.
103 IN PTR myan.angelsofclockwork.net.
This next one is IPv6, zone "8.3.1.0.9.1.f.1.0.7.4.0.1.0.0.2.IP6.ARPA".
$TTL 86400
@ IN SOA @ ns1.angelsofclockwork.net (
411 ; serial (d. adams)
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum
IN NS ns1.angelsofclockwork.net.
IN NS ns2.angelsofclockwork.net.
IN NS palaceredirect.angelsofclockwork.net.
1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0 IN PTR palaceredirect.angelsofclockwork.net.
4.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0 IN PTR myan.angelsofclockwork.net.
| Bind dns zone will not work |
1,561,651,785,000 |
I am running a Debian Jessie 8.1 server with a functioning postfix, dovecot, and suirrelmail/rainloop. I have multiple domains on the server. The main server domain is set via example.com.vhost because it is configured with ispconfig3. However, each additional domain is configured through /etc/apache2/sites-available/another.com.conf
I have configured the main domain to serve as a catch-all by editing /etc/postfix/virtual with:
@example.com myuser
[email protected] info
Then I update postifx with:
nano /etc/postfix/main.cf
virtual_alias_maps = hash:/etc/postfix/virtual
postmap /etc/postfix/virtual
service postfix reload
Question is, as I have said, there are other virtual domains on the server. How can I make them all catch-all to their respective [email protected] or at least to the main [email protected] email?
I did try adding to /etc/postfix/virtual something like @another.com info but it did not help. Any other suggestions?
|
There are two ways to fix this:
Add mappings for all virtual domains to /etc/postfix/virtual. Postfix will accept a message if any entry in that file matches.
Setting virtual_alias_domains to the list of other domains you want to receive mail for. You can then use a regexp table virtual_alias_maps = pcre:/etc/postfix/virtual.pcre where the latter contains something like /.*/ info.
Beware: This is untested.
| Serve mail for multiple domains on a single server? |
1,561,651,785,000 |
I installed exim4 on a Debian server configured it to use Dovecot LMTP delivery and everything works nice. But I'm having problems with a bit of a spam attack right now. I installed fail2ban but it's a bit slow to catch up. Also I was looking at the actions for the exim4 jail and I saw that there can be error messages with 535, Sender verify failed and unknown users and I think all of those sound like better ban reason than the current relay not permitted:
2015-11-23 09:03:25 H=118-160-211-95.dynamic.hinet.net (xxx.xxx.xxx.xxx) [118.160.211.95] F=<[email protected]> rejected RCPT <[email protected]>: relay not permitted
So I wanted to ask if there is a way to force authentication based on the fact that this is not even an mail server that I am responsible for (163.com and I'm responsible for example.com only) and to give different error message (like not auth)?
Also as a side note would this mean that I somehow forgot to add some configuration somewhere like the lack of auth in some ACL? (Every actual person from example.com needs to enter the real password before he sends an email and if wrong it comes up with an error message saying wrong password).
|
You can't force a remote client to attempt to authenticate, because you don't know until the RCPT TO: whether the client is attempting to deliver an email to your server (which doesn't require authentication unless you have a very unusual configuration like only accepting mail from known mail servers) or it is trying to relay through your mail server without authorisation.
The RCPT TO stage of an SMTP session comes well after any AUTH negotiation (if any).
| How to force valid authentication in exim before sending at all? |
1,561,651,785,000 |
How can I configure fetchmail to fetch a folder to a specific target folder? Or at least not fetch to inbox? If it would fetch from sent to sent (or any folder to the same folder name) I'd be happy with it.
Fetching sent and putting them in my inbox and marking them as "new mail" would be crazy, now wouldn't it?
|
You might want to have a look at a filtering solution such as procmail.
You can have fetchmail collect the mail from your IMAP or POP (or whatever) server and then specify in your ~/.fetchmailrc configuration that it should deliver with procmail (see the mda setting in the manual). You would then set up procmail to filter the incoming mail into one or several mail boxes.
I'm just mentioning procmail because that's what I've been using for decades. I'm sure there are other mail filtering software out there.
Example fetchmail configuration:
poll mail.example.com
protocol imap
user "me.there" password "password" is "me.here"
mda "/opt/local/bin/procmail -m $HOME/.procmailrc"
Snippet from my ~/.procmailrc (incomplete):
MAILDIR="$HOME/Dropbox/Mail"
DEFAULT="inbox/"
LOGFILE="$HOME/.procmail.log"
# [cut several lines]
:0
* ^List-Id:.*macports-changes.lists.macosforge.org
macports-changes/
:0
* ^List-Id:.*macports-users.lists.macosforge.org
macports-users/
# [etc.]
In your case, you would add a delivery receipt for mail that you've sent yourself. These would go into a separate folder.
| fetchmail: fetch sent mail to sent folder, or fetch to a target folder |
1,561,651,785,000 |
How can I setup alpine to use more than one mail address? That SMTP Server parameter in config looks like an global. Can someone help me?
NOTE: At least for both e-mails on the same server. Thanks.
|
In Setup > collectionLists add a new entry like below:
(at the main menu just press S L A):
here an example if you have a gmail account:
Nickname : gmail-test
Server : imap.gmail.com/ssl/[email protected]
Path :
View :
The corresponding entry (gmail-test in this example) will be created and will be accessible at Folder List.
Then create a role something like below (by pressing S R R A at the main menu). At the moment you compose a new message, Alpine ask you to select your created smtp's. You can several roles and you can use several smtp's.
Nickname = gmail-test
Comment = <No Value Set>
==================================== CURRENT FOLDER CONDITIONS BEGIN HERE ==============
=======================
Current Folder Type = Set Choose One
--- --------------------
( ) Any
( ) News
(*) Email
( ) Specific (Enter Incoming Nicknames or use ^T)
Folder List = {imap.gmail.com/ssl/[email protected]}INBOX
==================================== CURRENT MESSAGE CONDITIONS BEGIN HERE =============
=======================
To pattern = [email protected]
From pattern = <No Value Set>
Sender pattern = <No Value Set>
Cc pattern = <No Value Set>
News pattern = <No Value Set>
Subject pattern = <No Value Set>
Recip pattern = <No Value Set>
Partic pattern = <No Value Set>
Add Extra Headers
AllText pattern = <No Value Set>
BdyText pattern = <No Value Set>
Age interval = <No Value Set>
Size interval = <No Value Set>
Score interval = <No Value Set>
Keyword pattern = <No Value Set>
Charset pattern = <No Value Set>
Message is Important? = Set Choose One
--- --------------------
(*) Don't care, always matches
( ) Yes
( ) No
Message is New (Unseen)? = Set Choose One
--- --------------------
(*) Don't care, always matches
( ) Yes
( ) No
Message is Recent? = Set Choose One
--- --------------------
(*) Don't care, always matches
( ) Yes
( ) No
Message is Deleted? = Set Choose One
--- --------------------
(*) Don't care, always matches
( ) Yes
( ) No
Message is Answered? = Set Choose One
--- --------------------
(*) Don't care, always matches
( ) Yes
( ) No
Subject contains raw 8-bit? = Set Choose One
--- --------------------
(*) Don't care, always matches
( ) Yes
( ) No
Beginning of Month? = Set Choose One
--- --------------------
(*) Don't care, always matches
( ) Yes
( ) No
Beginning of Year? = Set Choose One
--- --------------------
(*) Don't care, always matches
( ) Yes
( ) No
Address in address book? = Set Choose One
--- --------------------
(*) Don't care, always matches
( ) Yes, in any address book
( ) No, not in any address book
( ) Yes, in specific address books
( ) No, not in any of specific address books
Abook List = <No Value Set>
Types of addresses to check for in address book = Set Address types
--- --------------------
[X] From
[X] Reply-To
[ ] Sender
[ ] To
[ ] Cc
External Categorizer Commands = Command = <No Value Set>
Exit Status Interval = <No Value Set>
Character Limit = <No Value Set: using "-1">
============================================= ACTIONS BEGIN HERE =======================
=======================
Initialize settings using role : <No Value Set>
Set From = [email protected]
Set Reply-To = <No Value Set>
Set Fcc = {imap.gmail.com/ssl/[email protected]}sent
Set LiteralSig = <No Value Set>
Set Signature = <Ignored: using LiteralSig instead>
Set Template = <No Value Set>
Set Other Hdrs = <No Value Set>
Use SMTP Server = smtp.gmail.com/ssl/[email protected]
Use NNTP Server = <No Value Set>
============================================= OPTIONS BEGIN HERE =======================
=======================
Features = Set Feature Name
--- --------------------
[ ] use-date-header-for-age
=============================================== USES BEGIN HERE ========================
=======================
Reply Use = Set Choose One
--- --------------------
( ) Never
( ) With confirmation
(*) Without confirmation
Forward Use = Set Choose One
--- --------------------
( ) Never
(*) With confirmation
( ) Without confirmation
Compose Use = Set Choose One
--- --------------------
( ) Never
(*) With confirmation
( ) Without confirmation
| Alpine: work with some e-mails |
1,561,651,785,000 |
I'm running Ubuntu 14.10 installed postfix dovecot vimbadmin and roundcube.
Everything works except dovecot.
When I restart dovecot I get this:
stop: Unknown instance:
dovecot start/running, proccess 6580
In my var/log/dovecot.log file I get this:
Fatal: service(auth) Group doesn't exist: postifx (See service auth { unix_listener /var/run/dovecot/auth-userdb { group } } setting)
So i probably have some problems with the settings, i will post those two if its necessary, but i'm hoping maybe someone all ready had this problem and its a quick fix.
|
You presumably have a typo, postifx should be postfix. Search the dovecot config files for postifx and fix those.
| Dovecot (imap) not starting |
1,561,651,785,000 |
I have CentOS running mutt. When mails are sent from mutt (via a shell script), it takes the current user name as sender address causing it to go into the spam.
I receive mail as
From: tech
What I need is:
From: [email protected]
All I need is a single place change that reflects everwhere. i.e. if I send from the root user, the from address should be [email protected].
|
Do you have a system-wide mutt RC file? Perhaps it is here: /etc/mutt/Muttrc?
Within the file, set the hostname with set hostname=myserver.com.
| Configure sender address for all users in mutt |
1,561,651,785,000 |
I'm using offlineimap + mutt + msmtp to handle my email. I would like to have an unorthodox configuration, where all of my current mail (received, sent, and drafts) reside in the INBOX (or at least a single primary folder) and all the rest to be in the archive. This way I can push emails that I no longer need anymore to the archive and have all my current tasks and things that I need to keep track of easily accessible. Any thoughts on how to do this? Would mutt be the place to do this sort of sorting, or would I want to set up some sort of post-sync hook in offlineimap to take care of shuffling things around?
|
In your .muttrc:
set mbox=imap://imapsrvr/INBOX
set record=imap://imapsrvr/INBOX
set spoolfile=imap://imapsrvr/INBOX
set postponed=imap://imapsrvr/INBOX
though I've never seen what mutt would make of the inbox being your drafts folder. I assume it will treat all emails in your inbox as drafts (untested).
| Mutt - sent and drafts in the INBOX |
1,381,087,722,000 |
Further to my posting here: Why does my CMS run extremely slow in my workstation (Ubuntu) I now ask "Do I need Nullmailer-Send" running? The reason I ask, is that earlier this year (2013) I had issues regarding large .log files being created in /var/log which result in some .logs being some 1GB and I had to manually delete them. My machine (a Ubuntu 12.10 and very nice it is too!) is only a home office 'desktop' work-station and used for the normal daily things (inc LAMP WebDev) but mainly Office, Web-browsing, FTP and I don't use it as a server, as my email is collected either by Evolution Client or via GoogleMail.com.
I would like to reduce any system 'bloat' and hence my OP here about Nullmailer.
|
You should have a way to send mail on any unix machine in such a way that users can read it. A common sender of mail is cron: if any cron job produces output, it will be mailed to the local user (or to the alternate address specified in the crontab). Other services may want to send mail to the system administrator, for example Smart when it detects disk defects. I don't know if Drupal might send mail, but I would expect at least some plugins to offer the option.
Nullmailer is a simple tool to send mail only. It doesn't do any local mail delivery, it can only establish an outgoing SMTP connection to send mail to another machine. This is a good idea if you never want to receive or deliver mail locally, only forward it to some other service inside or outside your network.
Nullmailer isn't a daemon. It doesn't need to be since it isn't listening to any network event. It is invoked by local applications under the name /usr/sbin/sendmail to send mail.
Sending mail is an essential service. Essential services are not bloat.
| Do I Need Nullmailer-send running? |
1,381,087,722,000 |
I have a mail server that should receive all mails, even if no user exists.
My big problem is the: Postfix Address Verification like mentioned here: http://www.postfix.org/ADDRESS_VERIFICATION_README.html
Servers that use that kind of recipient verification won't send me mails if there is no user to receive these mails.
As mentioned in the Postfix Readme, to verify a recipient, the server is sending a probe message to my server, to check if a user exists.
My goal is to find a way to always reply to those probe messages with the right answer to tell all servers that the user they are looking for exists.
Is there anything special in the settings I can use for this?
|
If your mail server needs to accept and deliver mail for all addresses in your domain(s) whether they "exist" or not, then it needs to be configured to do so. As soon as it is, then it will immediately start providing the right responses to any remote servers doing recipient verification.
Exactly how to do this depends on many factors, but the two most common cases are delivering to local domains (i.e. domains listed in mydestination) and delivering to virtual domains (e.g. listed in a virtual_alias_maps database).
To accept all mail for any address at any domain listed in mydestination, you need to set the luser_relay in your /etc/postfix/main.cf to tell postfix where mail for unknown recipients should be delivered. e.g. if you have a local account called 'catchall' then set luser_relay = catchall+$local. The mail will be delivered to catchall's mailbox.
To accept all mail for a virtual domain, then you need a catchall alias in the virtualtable. e.g. to deliver all mail for all unknown users "@virtual.example.com" to "[email protected]":
[email protected] [email protected]
[email protected] [email protected]
@virtual.example.com [email protected]
Mail for "fred" and "joe" will be delivered as specified, while mail for all other addresses "@virtual.example.com" will be delivered to "[email protected]".
| postfix configuration to verify all recipients |
1,381,087,722,000 |
I wrote a little script to send multiple mails from a list with differents subjects.
#!/bin/bash
while read -a line
do
mailadd=${line[0]}
subject=${line[1]}
mutt -s `echo $subject` `echo $mailadd` < /home/emanuele/testomail.txt
done < prova.txt
The scripts works fine and sends the mails, but mutt tell me that he needs a -s option.
mutt: option requires an argument -- 's'
Mutt 1.5.21 (2010-09-15)
I don't understand why the script works fine but mutt exit with an error. How can I fix it?
|
First, `echo $subject` is a convoluted way of writing $subject (except that it mangles the value a bit more if it contains whitespace or \[*?, because $subject outside quotes is treated as a whitespace-separated list of wildcard patterns, and then the result of the whole command substitution is again treated as a whitespace-separated list of wildcard patterns).
The only way for your command to result in this error is if `echo $subject` `echo $mailadd` is empty. This happens only when both `echo $subject` and `echo $mailadd` consist only of whitespace, which in turns happens only if both variables subject and mailadd are empty (plus a few oddball cases, such as subject being the character ? and the current directory containing a file whose name is a single space). So most likely you have some blank lines in your input file.
You should always put double quotes around variable substitutions and command substitutions ("$somevar", "$(somecommand)") unless you really mean the values of the variables to be interpreted as whitespace-separated lists of file wildcard patterns.
mutt -s "$subject" "$mailaddr" <~/testeomail.txt
If there's a blank line in the input file, skip it.
while read -a line; do
mailadd=${line[0]}
subject=${line[1]}
if [ -z "$subject" ]; then continue; fi
mutt -s "$subject" "$mailadd" < /home/emanuele/testomail.txt
done < prova.txt
| mutt weird action |
1,381,087,722,000 |
I have been struggling to get this to work for a little while now so I have come in the hope of getting a wee bit of help.
I am running redhat 6.3, and using the machine as a webserver. My question is the following:
Say my domain name is domain.com. How do I get an email sent to "[email protected]" to "[email protected]".
I am comfortable with web-programming, unfortunately not so much with Linux setups. I have managed to get internal mails sent to my email using the file "/etc/aliases", but this does not seem to deal with external emails coming to the server.
Many thanks for any and all help offered.
Ronan
p.s: My apologies if (and I am pretty sure it has been) this question has already been asked; I simply cannot for the life of me find an answer to this issue...
# Global Postfix configuration file. This file lists only a subset
# of all parameters. For the syntax, and for a complete parameter
# list, see the postconf(5) manual page (command: "man 5 postconf").
#
# For common configuration examples, see BASIC_CONFIGURATION_README
# and STANDARD_CONFIGURATION_README. To find these documents, use
# the command "postconf html_directory readme_directory", or go to
# http://www.postfix.org/.
#
# For best results, change no more than 2-3 parameters at a time,
# and test if Postfix still works after every change.
# SOFT BOUNCE
#
# The soft_bounce parameter provides a limited safety net for
# testing. When soft_bounce is enabled, mail will remain queued that
# would otherwise bounce. This parameter disables locally-generated
# bounces, and prevents the SMTP server from rejecting mail permanently
# (by changing 5xx replies into 4xx replies). However, soft_bounce
# is no cure for address rewriting mistakes or mail routing mistakes.
#
#soft_bounce = no
# LOCAL PATHNAME INFORMATION
#
# The queue_directory specifies the location of the Postfix queue.
# This is also the root directory of Postfix daemons that run chrooted.
# See the files in examples/chroot-setup for setting up Postfix chroot
# environments on different UNIX systems.
#
queue_directory = /var/spool/postfix
# The command_directory parameter specifies the location of all
# postXXX commands.
#
command_directory = /usr/sbin
# The daemon_directory parameter specifies the location of all Postfix
# daemon programs (i.e. programs listed in the master.cf file). This
# directory must be owned by root.
#
daemon_directory = /usr/libexec/postfix
# The data_directory parameter specifies the location of Postfix-writable
# data files (caches, random numbers). This directory must be owned
# by the mail_owner account (see below).
#
data_directory = /var/lib/postfix
# QUEUE AND PROCESS OWNERSHIP
#
# The mail_owner parameter specifies the owner of the Postfix queue
# and of most Postfix daemon processes. Specify the name of a user
# account THAT DOES NOT SHARE ITS USER OR GROUP ID WITH OTHER ACCOUNTS
# AND THAT OWNS NO OTHER FILES OR PROCESSES ON THE SYSTEM. In
# particular, don't specify nobody or daemon. PLEASE USE A DEDICATED
# USER.
#
mail_owner = postfix
# The default_privs parameter specifies the default rights used by
# the local delivery agent for delivery to external file or command.
# These rights are used in the absence of a recipient user context.
# DO NOT SPECIFY A PRIVILEGED USER OR THE POSTFIX OWNER.
#
#default_privs = nobody
# INTERNET HOST AND DOMAIN NAMES
#
# The myhostname parameter specifies the internet hostname of this
# mail system. The default is to use the fully-qualified domain name
# from gethostname(). $myhostname is used as a default value for many
# other configuration parameters.
#
#myhostname = host.domain.tld
#myhostname = virtual.domain.tld
# The mydomain parameter specifies the local internet domain name.
# The default is to use $myhostname minus the first component.
# $mydomain is used as a default value for many other configuration
# parameters.
#
#mydomain = domain.tld
# SENDING MAIL
#
# The myorigin parameter specifies the domain that locally-posted
# mail appears to come from. The default is to append $myhostname,
# which is fine for small sites. If you run a domain with multiple
# machines, you should (1) change this to $mydomain and (2) set up
# a domain-wide alias database that aliases each user to
# [email protected].
#
# For the sake of consistency between sender and recipient addresses,
# myorigin also specifies the default domain name that is appended
# to recipient addresses that have no @domain part.
#
#myorigin = $myhostname
#myorigin = $mydomain
# RECEIVING MAIL
# The inet_interfaces parameter specifies the network interface
# addresses that this mail system receives mail on. By default,
# the software claims all active interfaces on the machine. The
# parameter also controls delivery of mail to user@[ip.address].
#
# See also the proxy_interfaces parameter, for network addresses that
# are forwarded to us via a proxy or network address translator.
#
# Note: you need to stop/start Postfix when this parameter changes.
#
#inet_interfaces = all
#inet_interfaces = $myhostname
#inet_interfaces = $myhostname, localhost
inet_interfaces = localhost
# Enable IPv4, and IPv6 if supported
inet_protocols = all
# The proxy_interfaces parameter specifies the network interface
# addresses that this mail system receives mail on by way of a
# proxy or network address translation unit. This setting extends
# the address list specified with the inet_interfaces parameter.
#
# You must specify your proxy/NAT addresses when your system is a
# backup MX host for other domains, otherwise mail delivery loops
# will happen when the primary MX host is down.
#
#proxy_interfaces =
#proxy_interfaces = 1.2.3.4
# The mydestination parameter specifies the list of domains that this
# machine considers itself the final destination for.
#
# These domains are routed to the delivery agent specified with the
# local_transport parameter setting. By default, that is the UNIX
# compatible delivery agent that lookups all recipients in /etc/passwd
# and /etc/aliases or their equivalent.
#
# The default is $myhostname + localhost.$mydomain. On a mail domain
# gateway, you should also include $mydomain.
#
# Do not specify the names of virtual domains - those domains are
# specified elsewhere (see VIRTUAL_README).
#
# Do not specify the names of domains that this machine is backup MX
# host for. Specify those names via the relay_domains settings for
# the SMTP server, or use permit_mx_backup if you are lazy (see
# STANDARD_CONFIGURATION_README).
#
# The local machine is always the final destination for mail addressed
# to user@[the.net.work.address] of an interface that the mail system
# receives mail on (see the inet_interfaces parameter).
#
# Specify a list of host or domain names, /file/name or type:table
# patterns, separated by commas and/or whitespace. A /file/name
# pattern is replaced by its contents; a type:table is matched when
# a name matches a lookup key (the right-hand side is ignored).
# Continue long lines by starting the next line with whitespace.
#
# See also below, section "REJECTING MAIL FOR UNKNOWN LOCAL USERS".
#
mydestination = $myhostname, localhost.$mydomain, localhost
#mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
#mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain,
# mail.$mydomain, www.$mydomain, ftp.$mydomain
# REJECTING MAIL FOR UNKNOWN LOCAL USERS
#
# The local_recipient_maps parameter specifies optional lookup tables
# with all names or addresses of users that are local with respect
# to $mydestination, $inet_interfaces or $proxy_interfaces.
#
# If this parameter is defined, then the SMTP server will reject
# mail for unknown local users. This parameter is defined by default.
#
# To turn off local recipient checking in the SMTP server, specify
# local_recipient_maps = (i.e. empty).
#
# The default setting assumes that you use the default Postfix local
# delivery agent for local delivery. You need to update the
# local_recipient_maps setting if:
#
# - You define $mydestination domain recipients in files other than
# /etc/passwd, /etc/aliases, or the $virtual_alias_maps files.
# For example, you define $mydestination domain recipients in
# the $virtual_mailbox_maps files.
#
# - You redefine the local delivery agent in master.cf.
#
# - You redefine the "local_transport" setting in main.cf.
#
# - You use the "luser_relay", "mailbox_transport", or "fallback_transport"
# feature of the Postfix local delivery agent (see local(8)).
#
# Details are described in the LOCAL_RECIPIENT_README file.
#
# Beware: if the Postfix SMTP server runs chrooted, you probably have
# to access the passwd file via the proxymap service, in order to
# overcome chroot restrictions. The alternative, having a copy of
# the system passwd file in the chroot jail is just not practical.
#
# The right-hand side of the lookup tables is conveniently ignored.
# In the left-hand side, specify a bare username, an @domain.tld
# wild-card, or specify a [email protected] address.
#
#local_recipient_maps = unix:passwd.byname $alias_maps
#local_recipient_maps = proxy:unix:passwd.byname $alias_maps
#local_recipient_maps =
# The unknown_local_recipient_reject_code specifies the SMTP server
# response code when a recipient domain matches $mydestination or
# ${proxy,inet}_interfaces, while $local_recipient_maps is non-empty
# and the recipient address or address local-part is not found.
#
# The default setting is 550 (reject mail) but it is safer to start
# with 450 (try again later) until you are certain that your
# local_recipient_maps settings are OK.
#
unknown_local_recipient_reject_code = 550
# TRUST AND RELAY CONTROL
# The mynetworks parameter specifies the list of "trusted" SMTP
# clients that have more privileges than "strangers".
#
# In particular, "trusted" SMTP clients are allowed to relay mail
# through Postfix. See the smtpd_recipient_restrictions parameter
# in postconf(5).
#
# You can specify the list of "trusted" network addresses by hand
# or you can let Postfix do it for you (which is the default).
#
# By default (mynetworks_style = subnet), Postfix "trusts" SMTP
# clients in the same IP subnetworks as the local machine.
# On Linux, this does works correctly only with interfaces specified
# with the "ifconfig" command.
#
# Specify "mynetworks_style = class" when Postfix should "trust" SMTP
# clients in the same IP class A/B/C networks as the local machine.
# Don't do this with a dialup site - it would cause Postfix to "trust"
# your entire provider's network. Instead, specify an explicit
# mynetworks list by hand, as described below.
#
# Specify "mynetworks_style = host" when Postfix should "trust"
# only the local machine.
#
#mynetworks_style = class
#mynetworks_style = subnet
#mynetworks_style = host
# Alternatively, you can specify the mynetworks list by hand, in
# which case Postfix ignores the mynetworks_style setting.
#
# Specify an explicit list of network/netmask patterns, where the
# mask specifies the number of bits in the network part of a host
# address.
#
# You can also specify the absolute pathname of a pattern file instead
# of listing the patterns here. Specify type:table for table-based lookups
# (the value on the table right-hand side is not used).
#
#mynetworks = 168.100.189.0/28, 127.0.0.0/8
#mynetworks = $config_directory/mynetworks
#mynetworks = hash:/etc/postfix/network_table
# The relay_domains parameter restricts what destinations this system will
# relay mail to. See the smtpd_recipient_restrictions description in
# postconf(5) for detailed information.
#
# By default, Postfix relays mail
# - from "trusted" clients (IP address matches $mynetworks) to any destination,
# - from "untrusted" clients to destinations that match $relay_domains or
# subdomains thereof, except addresses with sender-specified routing.
# The default relay_domains value is $mydestination.
#
# In addition to the above, the Postfix SMTP server by default accepts mail
# that Postfix is final destination for:
# - destinations that match $inet_interfaces or $proxy_interfaces,
# - destinations that match $mydestination
# - destinations that match $virtual_alias_domains,
# - destinations that match $virtual_mailbox_domains.
# These destinations do not need to be listed in $relay_domains.
#
# Specify a list of hosts or domains, /file/name patterns or type:name
# lookup tables, separated by commas and/or whitespace. Continue
# long lines by starting the next line with whitespace. A file name
# is replaced by its contents; a type:name table is matched when a
# (parent) domain appears as lookup key.
#
# NOTE: Postfix will not automatically forward mail for domains that
# list this system as their primary or backup MX host. See the
# permit_mx_backup restriction description in postconf(5).
#
#relay_domains = $mydestination
# INTERNET OR INTRANET
# The relayhost parameter specifies the default host to send mail to
# when no entry is matched in the optional transport(5) table. When
# no relayhost is given, mail is routed directly to the destination.
#
# On an intranet, specify the organizational domain name. If your
# internal DNS uses no MX records, specify the name of the intranet
# gateway host instead.
#
# In the case of SMTP, specify a domain, host, host:port, [host]:port,
# [address] or [address]:port; the form [host] turns off MX lookups.
#
# If you're connected via UUCP, see also the default_transport parameter.
#
#relayhost = $mydomain
#relayhost = [gateway.my.domain]
#relayhost = [mailserver.isp.tld]
#relayhost = uucphost
#relayhost = [an.ip.add.ress]
# REJECTING UNKNOWN RELAY USERS
#
# The relay_recipient_maps parameter specifies optional lookup tables
# with all addresses in the domains that match $relay_domains.
#
# If this parameter is defined, then the SMTP server will reject
# mail for unknown relay users. This feature is off by default.
#
# The right-hand side of the lookup tables is conveniently ignored.
# In the left-hand side, specify an @domain.tld wild-card, or specify
# a [email protected] address.
#
#relay_recipient_maps = hash:/etc/postfix/relay_recipients
# INPUT RATE CONTROL
#
# The in_flow_delay configuration parameter implements mail input
# flow control. This feature is turned on by default, although it
# still needs further development (it's disabled on SCO UNIX due
# to an SCO bug).
#
# A Postfix process will pause for $in_flow_delay seconds before
# accepting a new message, when the message arrival rate exceeds the
# message delivery rate. With the default 100 SMTP server process
# limit, this limits the mail inflow to 100 messages a second more
# than the number of messages delivered per second.
#
# Specify 0 to disable the feature. Valid delays are 0..10.
#
#in_flow_delay = 1s
# ADDRESS REWRITING
#
# The ADDRESS_REWRITING_README document gives information about
# address masquerading or other forms of address rewriting including
# username->Firstname.Lastname mapping.
# ADDRESS REDIRECTION (VIRTUAL DOMAIN)
#
# The VIRTUAL_README document gives information about the many forms
# of domain hosting that Postfix supports.
# "USER HAS MOVED" BOUNCE MESSAGES
#
# See the discussion in the ADDRESS_REWRITING_README document.
# TRANSPORT MAP
#
# See the discussion in the ADDRESS_REWRITING_README document.
# ALIAS DATABASE
#
# The alias_maps parameter specifies the list of alias databases used
# by the local delivery agent. The default list is system dependent.
#
# On systems with NIS, the default is to search the local alias
# database, then the NIS alias database. See aliases(5) for syntax
# details.
#
# If you change the alias database, run "postalias /etc/aliases" (or
# wherever your system stores the mail alias file), or simply run
# "newaliases" to build the necessary DBM or DB file.
#
# It will take a minute or so before changes become visible. Use
# "postfix reload" to eliminate the delay.
#
#alias_maps = dbm:/etc/aliases
alias_maps = hash:/etc/aliases
#alias_maps = hash:/etc/aliases, nis:mail.aliases
#alias_maps = netinfo:/aliases
# The alias_database parameter specifies the alias database(s) that
# are built with "newaliases" or "sendmail -bi". This is a separate
# configuration parameter, because alias_maps (see above) may specify
# tables that are not necessarily all under control by Postfix.
#
#alias_database = dbm:/etc/aliases
#alias_database = dbm:/etc/mail/aliases
alias_database = hash:/etc/aliases
#alias_database = hash:/etc/aliases, hash:/opt/majordomo/aliases
# ADDRESS EXTENSIONS (e.g., user+foo)
#
# The recipient_delimiter parameter specifies the separator between
# user names and address extensions (user+foo). See canonical(5),
# local(8), relocated(5) and virtual(5) for the effects this has on
# aliases, canonical, virtual, relocated and .forward file lookups.
# Basically, the software tries user+foo and .forward+foo before
# trying user and .forward.
#
#recipient_delimiter = +
# DELIVERY TO MAILBOX
#
# The home_mailbox parameter specifies the optional pathname of a
# mailbox file relative to a user's home directory. The default
# mailbox file is /var/spool/mail/user or /var/mail/user. Specify
# "Maildir/" for qmail-style delivery (the / is required).
#
#home_mailbox = Mailbox
#home_mailbox = Maildir/
# The mail_spool_directory parameter specifies the directory where
# UNIX-style mailboxes are kept. The default setting depends on the
# system type.
#
#mail_spool_directory = /var/mail
#mail_spool_directory = /var/spool/mail
# The mailbox_command parameter specifies the optional external
# command to use instead of mailbox delivery. The command is run as
# the recipient with proper HOME, SHELL and LOGNAME environment settings.
# Exception: delivery for root is done as $default_user.
#
# Other environment variables of interest: USER (recipient username),
# EXTENSION (address extension), DOMAIN (domain part of address),
# and LOCAL (the address localpart).
#
# Unlike other Postfix configuration parameters, the mailbox_command
# parameter is not subjected to $parameter substitutions. This is to
# make it easier to specify shell syntax (see example below).
#
# Avoid shell meta characters because they will force Postfix to run
# an expensive shell process. Procmail alone is expensive enough.
#
# IF YOU USE THIS TO DELIVER MAIL SYSTEM-WIDE, YOU MUST SET UP AN
# ALIAS THAT FORWARDS MAIL FOR ROOT TO A REAL USER.
#
#mailbox_command = /some/where/procmail
#mailbox_command = /some/where/procmail -a "$EXTENSION"
# The mailbox_transport specifies the optional transport in master.cf
# to use after processing aliases and .forward files. This parameter
# has precedence over the mailbox_command, fallback_transport and
# luser_relay parameters.
#
# Specify a string of the form transport:nexthop, where transport is
# the name of a mail delivery transport defined in master.cf. The
# :nexthop part is optional. For more details see the sample transport
# configuration file.
#
# NOTE: if you use this feature for accounts not in the UNIX password
# file, then you must update the "local_recipient_maps" setting in
# the main.cf file, otherwise the SMTP server will reject mail for
# non-UNIX accounts with "User unknown in local recipient table".
#
#mailbox_transport = lmtp:unix:/var/lib/imap/socket/lmtp
# If using the cyrus-imapd IMAP server deliver local mail to the IMAP
# server using LMTP (Local Mail Transport Protocol), this is prefered
# over the older cyrus deliver program by setting the
# mailbox_transport as below:
#
# mailbox_transport = lmtp:unix:/var/lib/imap/socket/lmtp
#
# The efficiency of LMTP delivery for cyrus-imapd can be enhanced via
# these settings.
#
# local_destination_recipient_limit = 300
# local_destination_concurrency_limit = 5
#
# Of course you should adjust these settings as appropriate for the
# capacity of the hardware you are using. The recipient limit setting
# can be used to take advantage of the single instance message store
# capability of Cyrus. The concurrency limit can be used to control
# how many simultaneous LMTP sessions will be permitted to the Cyrus
# message store.
#
# To use the old cyrus deliver program you have to set:
#mailbox_transport = cyrus
# The fallback_transport specifies the optional transport in master.cf
# to use for recipients that are not found in the UNIX passwd database.
# This parameter has precedence over the luser_relay parameter.
#
# Specify a string of the form transport:nexthop, where transport is
# the name of a mail delivery transport defined in master.cf. The
# :nexthop part is optional. For more details see the sample transport
# configuration file.
#
# NOTE: if you use this feature for accounts not in the UNIX password
# file, then you must update the "local_recipient_maps" setting in
# the main.cf file, otherwise the SMTP server will reject mail for
# non-UNIX accounts with "User unknown in local recipient table".
#
#fallback_transport = lmtp:unix:/var/lib/imap/socket/lmtp
#fallback_transport =
# The luser_relay parameter specifies an optional destination address
# for unknown recipients. By default, mail for unknown@$mydestination,
# unknown@[$inet_interfaces] or unknown@[$proxy_interfaces] is returned
# as undeliverable.
#
# The following expansions are done on luser_relay: $user (recipient
# username), $shell (recipient shell), $home (recipient home directory),
# $recipient (full recipient address), $extension (recipient address
# extension), $domain (recipient domain), $local (entire recipient
# localpart), $recipient_delimiter. Specify ${name?value} or
# ${name:value} to expand value only when $name does (does not) exist.
#
# luser_relay works only for the default Postfix local delivery agent.
#
# NOTE: if you use this feature for accounts not in the UNIX password
# file, then you must specify "local_recipient_maps =" (i.e. empty) in
# the main.cf file, otherwise the SMTP server will reject mail for
# non-UNIX accounts with "User unknown in local recipient table".
#
#luser_relay = [email protected]
#luser_relay = [email protected]
#luser_relay = admin+$local
# JUNK MAIL CONTROLS
#
# The controls listed here are only a very small subset. The file
# SMTPD_ACCESS_README provides an overview.
# The header_checks parameter specifies an optional table with patterns
# that each logical message header is matched against, including
# headers that span multiple physical lines.
#
# By default, these patterns also apply to MIME headers and to the
# headers of attached messages. With older Postfix versions, MIME and
# attached message headers were treated as body text.
#
# For details, see "man header_checks".
#
#header_checks = regexp:/etc/postfix/header_checks
# FAST ETRN SERVICE
#
# Postfix maintains per-destination logfiles with information about
# deferred mail, so that mail can be flushed quickly with the SMTP
# "ETRN domain.tld" command, or by executing "sendmail -qRdomain.tld".
# See the ETRN_README document for a detailed description.
#
# The fast_flush_domains parameter controls what destinations are
# eligible for this service. By default, they are all domains that
# this server is willing to relay mail to.
#
#fast_flush_domains = $relay_domains
# SHOW SOFTWARE VERSION OR NOT
#
# The smtpd_banner parameter specifies the text that follows the 220
# code in the SMTP server's greeting banner. Some people like to see
# the mail version advertised. By default, Postfix shows no version.
#
# You MUST specify $myhostname at the start of the text. That is an
# RFC requirement. Postfix itself does not care.
#
#smtpd_banner = $myhostname ESMTP $mail_name
#smtpd_banner = $myhostname ESMTP $mail_name ($mail_version)
# PARALLEL DELIVERY TO THE SAME DESTINATION
#
# How many parallel deliveries to the same user or domain? With local
# delivery, it does not make sense to do massively parallel delivery
# to the same user, because mailbox updates must happen sequentially,
# and expensive pipelines in .forward files can cause disasters when
# too many are run at the same time. With SMTP deliveries, 10
# simultaneous connections to the same domain could be sufficient to
# raise eyebrows.
#
# Each message delivery transport has its XXX_destination_concurrency_limit
# parameter. The default is $default_destination_concurrency_limit for
# most delivery transports. For the local delivery agent the default is 2.
#local_destination_concurrency_limit = 2
#default_destination_concurrency_limit = 20
# DEBUGGING CONTROL
#
# The debug_peer_level parameter specifies the increment in verbose
# logging level when an SMTP client or server host name or address
# matches a pattern in the debug_peer_list parameter.
#
debug_peer_level = 2
# The debug_peer_list parameter specifies an optional list of domain
# or network patterns, /file/name patterns or type:name tables. When
# an SMTP client or server host name or address matches a pattern,
# increase the verbose logging level by the amount specified in the
# debug_peer_level parameter.
#
#debug_peer_list = 127.0.0.1
#debug_peer_list = some.domain
# The debugger_command specifies the external command that is executed
# when a Postfix daemon program is run with the -D option.
#
# Use "command .. & sleep 5" so that the debugger can attach before
# the process marches on. If you use an X-based debugger, be sure to
# set up your XAUTHORITY environment variable before starting Postfix.
#
debugger_command =
PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
ddd $daemon_directory/$process_name $process_id & sleep 5
# If you can't use X, use this to capture the call stack when a
# daemon crashes. The result is in a file in the configuration
# directory, and is named after the process name and the process ID.
#
# debugger_command =
# PATH=/bin:/usr/bin:/usr/local/bin; export PATH; (echo cont;
# echo where) | gdb $daemon_directory/$process_name $process_id 2>&1
# >$config_directory/$process_name.$process_id.log & sleep 5
#
# Another possibility is to run gdb under a detached screen session.
# To attach to the screen sesssion, su root and run "screen -r
# " where uniquely matches one of the detached
# sessions (from "screen -list").
#
# debugger_command =
# PATH=/bin:/usr/bin:/sbin:/usr/sbin; export PATH; screen
# -dmS $process_name gdb $daemon_directory/$process_name
# $process_id & sleep 1
# INSTALL-TIME CONFIGURATION INFORMATION
#
# The following parameters are used when installing a new Postfix version.
#
# sendmail_path: The full pathname of the Postfix sendmail command.
# This is the Sendmail-compatible mail posting interface.
#
sendmail_path = /usr/sbin/sendmail.postfix
# newaliases_path: The full pathname of the Postfix newaliases command.
# This is the Sendmail-compatible command to build alias databases.
#
newaliases_path = /usr/bin/newaliases.postfix
# mailq_path: The full pathname of the Postfix mailq command. This
# is the Sendmail-compatible mail queue listing command.
#
mailq_path = /usr/bin/mailq.postfix
# setgid_group: The group for mail submission and queue management
# commands. This must be a group name with a numerical group ID that
# is not shared with other accounts, not even with the Postfix account.
#
setgid_group = postdrop
# html_directory: The location of the Postfix HTML documentation.
#
html_directory = no
# manpage_directory: The location of the Postfix on-line manual pages.
#
manpage_directory = /usr/share/man
# sample_directory: The location of the Postfix sample configuration files.
# This parameter is obsolete as of Postfix 2.1.
#
sample_directory = /usr/share/doc/postfix-2.6.6/samples
# readme_directory: The location of the Postfix README files.
#
readme_directory = /usr/share/doc/postfix-2.6.6/README_FILES
message_size_limit = 300000000
mailbox_size_limit = 300000000
|
It depends on the email package you are using and how it is setup.
With /etc/aliases, all you need is add the following line
webmaster: [email protected]
You may or may not need to do the following (it is required if running postfix)
cd /etc
postalias aliases
Then restart your email service.
PS: If the above don't work, post more information about your email server setup.
Backup your /etc/postfix/main.cf, replace with the following one, then restart your postfix.
queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
mail_owner = postfix
## Commented Following. The following line was used to protect an un-configure postfix setup
## We are using the default (=all)
#inet_interfaces = localhost
inet_protocols = all
unknown_local_recipient_reject_code = 550
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
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
sendmail_path = /usr/sbin/sendmail.postfix
newaliases_path = /usr/bin/newaliases.postfix
mailq_path = /usr/bin/mailq.postfix
setgid_group = postdrop
html_directory = no
manpage_directory = /usr/share/man
sample_directory = /usr/share/doc/postfix-2.6.6/samples
readme_directory = /usr/share/doc/postfix-2.6.6/README_FILES
message_size_limit = 300000000
mailbox_size_limit = 300000000
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
smtpd_recipient_restrictions =
permit_mynetworks,
permit_sasl_authenticated,
reject_invalid_hostname,
reject_non_fqdn_hostname,
reject_non_fqdn_sender,
reject_non_fqdn_recipient,
reject_unknown_recipient_domain,
reject_unlisted_recipient,
reject_unauth_destination,
reject_rbl_client cbl.abuseat.org,
reject_rbl_client bl.spamcop.net,
reject_rbl_client relays.mail-abuse.org,
reject_rbl_client dnsbl.proxybl.org,
reject_rbl_client truncate.gbudb.net,
reject_rbl_client dnsbl.njabl.org,
permit
## Change following
mydestination = $myhostname, localhost.$mydomain, localhost, <example.com>
myhostname = <host.example.com>
| Server inbound email forwarding |
1,381,087,722,000 |
I try to do this:
$ mail -s "Hello world" [email protected]
This is a test from my server
EOT
…and get this:
/usr/sbin/ssmtp: No such file or directory
$ "/home/user//dead.letter" 9/248
. . . message not sent.
Which makes sense, because I uninstalled SSMTP in favor of Postfix. How do I change it so mail uses the right MTA?
|
Oh man, that’ll teach me to RTFM—I had everything set up correctly; all I had to do was start the postfix daemon. (After that, a backlog of undelivered e-mail from a month ago arrived in my inbox!) I guess I forgot to add it to my rc.conf after I installed it, so it didn’t start back up again after one of my infrequent reboots.
| Arch Linux Using the Wrong MTA |
1,381,087,722,000 |
I am running a small server on a LAN and do not expect more than a couple dozen emails an hour or so. A user on the LAN accidentally set off a few thousand emails at once. Is there a tool or setting (using exim4, but any popular open source MTA available on Ubuntu will do) that could temporarily block such episodes or at least send a notification so that the excitement can be contained?
Nothing came up in a quick search, so even useful search terms would be helpful as an answer.
|
For exim4, you're looking for ACL ratelimit settings (although some mailers put it under 'policy')
| How to limit the number of messages sent through a mail server? |
1,381,087,722,000 |
I'm in the middle of writing a Python program which simply sends the same HTML message with an attachment to a large list of email addresses (BCC). Is there a utility I could use to do this rather than writing something from scratch? The actual email message doesn't vary at all, I simply need to send the same HTML and same attachment to all emails.
Does a Unix utility exist to provide this functionality?
|
You can use a command-line program such as or mutt.
See http://www.mutt.org/.
Edit: have you looked at http://docs.python.org/library/email-examples.html?
| Utility for sending HTML mail with attachments to a long list of emails? |
1,381,087,722,000 |
I have installed roundcube mail and when it tried to use installer which uses php mail it is loading for 5 to 10 minutes and then telling me 'ok' but no mail comes to me. smtp_port is 25 host is localhost in my php.ini file
|
The problem is configure set sendmail -t under unix line to /usr/sbin/sendmail -t and then configure postfix
| php mail not working in rhel server? |
1,381,087,722,000 |
Mailman, mlmmj and probably other Mailinglist-Software support the feature 'no mail delivery subscription'.
Meaning that you can subscribe and then disable mail delivery.
This useful for times you are at vacation or when you want to read that list via gmane.org or a similar service.
I can't find anything about majordomo, regarding this feature.
Thus my question: Does majordomo support 'no mail delivery subscription'?
|
No, it does not. Majardomo seems to be pretty much end of development, and via internet search one find just rumours that a future development majordomo version would support such a feature ... perhaps.
Anyway, most mailing-lists seem to have switched from majordomo - currently, one famous exception is the Postfix mailing list.
| Does majordomo support 'no mail delivery subscription'? |
1,381,087,722,000 |
I'm sending email from a script using mailx. The script is run daily by systemd, using .service and .timer files. For testing purposes I'm sending from the command line.
The mail is sent with the command
echo "Test message - you know the drill" | mailx -r "[email protected]" -s "Test Message" [email protected]
(personal data replaced for privacy)
This works. It's relayed by postfix to my gateway server (also postfix) which signs the outgoing message. This is then delivered to GMail which verifies the SPF data and DKIM signature, and the message is delivered to my inbox.
This is good, except it's displayed as Ubuntu <[email protected]>
I have other servers sending mail by the same method, and they all display similarly.
I'd like to change the display name to something more useful, per server. For example, Web Server <[email protected]> but something I'm doing is messing up the From address as it travels to the gateway server.
I've tried
echo "Test message - you know the drill" | mailx -r "Web Server [email protected]" -s "Test Message" [email protected]
and
echo "Test message - you know the drill" | mailx -r "Web Server <[email protected]>" -s "Test Message" [email protected]
But in both cases the From address is somehow lost by the local PostFix, and the message sent to the gateway server has a from address of [email protected] where smtp.private.example.uk is the FQDN of the gateway server. This is sent to GMail, but fails the SPF and DKIM tests and is unceremoniously dumped in spam as a result. (I don't know how the local postfix is getting the name of the gateway server)
So, how can I add the display name to the parameters I pass to mailx such that it survives the journey from server to server and is displayed correctly by GMail?
Mailx version 3.14 (GNU Mailutils)
Ubuntu 22.04
I've made only one change to main.cf for PostFix: added a relay-host address for the gateway server.
|
Since you want to use pre-installed programs and because you have postfix installed, we can use a postfix mode to give you greater control of what you send and how it looks.
This is done via sendmail -t. In this mode we use postfix as a mail submission agent (MSA), which is what mailx does anyway, and you can specify the whole header and body, and postfix will send it "as is"
A simple method is to use echo.
e.g.
echo "From: My name <me@myaddress>
To: You <you@youraddress>
Subject: You'll never guess what...
This is a test!" | /usr/sbin/sendmail -t
This lets you set any header to any value you like.
Now this doesn't change the envelope sender so the original name is visible in other lines, so it's not perfect (but you'd get that with mailx if the From address doesn't match the account's address), but it avoids any complications mailx or other mail user agents (MUAs) may bring in.
| How to include a display name when sending mail with mailx |
1,381,087,722,000 |
I am using mail from GNU Mailutils to read the contents of a Maildir. For emails that have already been marked as read, is there a way to mark them as unread in mail?
|
Update:
As of GNU Mailutils version 3.14 (released on 2022-01-02), GNU Mailutils implements the "unread" command. An email can be marked as unread by pressing U.
Old answer:
This feature is not mentioned in POSIX mailx, and is not implemented by GNU Mailutils' mailx. S-nail and the BSDs' mailx support an unread command to mark emails as unread. However, BSD implementations of mailx do not support the Maildir format, so the solution is to use S-nail, which supports the Maildir format. Alternatively, one could move away from mailx and switch to using a simple email client such as Mutt.
| mail: How do I mark an email as unread? |
1,381,087,722,000 |
I've got a mail server set up using postfix, dovecot, opendkim, and spamassassin. After a bit of hassle, I managed to get incoming mail working--I even set this account up using that server.
However, I've got a problem with outgoing mail. My ISP, fat as it is, blocks communications through port 25... meaning that, obviously, sending messages doesn't work. Here's logs after attempting to send to my old Protonmail account (from Neomutt on an external machine):
postfix/qmgr[653083]: 7E2BD9006AB: from=<[email protected]>, size=479, nrcpt=1 (queue active)
// disconnect from external client
postfix/smtp[653086]: connect to mail.protonmail.ch[185.70.41.101]:25: Connection timed out
postfix/smtp[653093]: connect to mail.protonmail.ch[185.70.41.101]:25: Connection timed out
postfix/smtp[653086]: connect to mailsec.protonmail.ch[185.70.40.102]:25: Connection timed out
postfix/smtp[653086]: 44DED90068A: to=<[email protected]>, relay=none, delay=115, delays=55/0.05/60/0, dsn=4.4.1, status=deferred (connect to mailsec.protonmail.ch[185.70.40.102]:25: Connection timed out)
So, yeah... ISP blocks port 25 (outgoing), so I need a way to bypass this. One way I saw a lot about was configuring to use an external smtpd. I'd either have to use my ISP's (not ideal) or, set up postfix on my friend's VPS (not exactly ideal either but if all else fails I'll ask him). TECHNICALLY I could ask my ISP to unblock port 25, but that, well, might not work.
However, I'd instead like to route all outgoing mail to port 465 or 587 of external servers, not 25, using only my local postfix setup. I couldn't find anything about this online, and changing the outgoing smtp port to an alternate port in master.cf still sends stuff through 25. So, how should I go about doing this? Keep in mind, if there's literally nothing I can do then I can just ask my friend for his VPS
postconf -n:
alias_database = $alias_maps
alias_maps = hash:/etc/postfix/aliases
command_directory = /usr/bin
compatibility_level = 3.6
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
home_mailbox = Mail/Inbox/
html_directory = no
inet_protocols = ipv4
mail_owner = postfix
mailbox_command = /usr/lib/dovecot/deliver
mailq_path = /usr/bin/mailq
manpage_directory = /usr/share/man
meta_directory = /etc/postfix
milter_default_action = accept
milter_protocol = 6
mydestination = $myhostname $mydomain localhost localhost.localdomain
mydomain = doma.in
myhostname = mail.doma.in
mynetworks = 127.0.0.0/8 [::1]/128 MY.IP/32 192.168.86.1 192.168.86.0/24
newaliases_path = /usr/bin/newaliases
non_smtpd_milters = inet:127.0.0.1:12301
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix
relay_domains = $mydestination
sample_directory = /etc/postfix
sendmail_path = /usr/bin/sendmail
setgid_group = postdrop
shlib_directory = /usr/lib/postfix
smtp_tls_CAfile = /etc/letsencrypt/live/doma.in/cert.pem
smtp_tls_loglevel = 1
smtp_tls_mandatory_protocols = !SSLv2, !SSLv3, !TLSv1, !TLSv1.1
smtp_tls_protocols = !SSLv2, !SSLv3, !TLSv1, !TLSv1.1
smtp_tls_security_level = may
smtpd_milters = inet:127.0.0.1:12301
smtpd_recipient_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated reject_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_path = private/auth
smtpd_sasl_security_options = noanonymous
smtpd_sasl_tls_security_options = noanonymous
smtpd_sasl_type = dovecot
smtpd_tls_auth_only = yes
smtpd_tls_cert_file = /etc/letsencrypt/live/doma.in/fullchain.pem
smtpd_tls_exclude_ciphers = aNULL, LOW, EXP, MEDIUM, ADH, AECDH, MD5, DSS, ECDSA, CAMELLIA128, 3DES, CAMELLIA256, RSA+AES, eNULL
smtpd_tls_key_file = /etc/letsencrypt/live/doma.in/privkey.pem
smtpd_tls_mandatory_protocols = !SSLv2, !SSLv3, !TLSv1, !TLSv1.1
smtpd_tls_protocols = !SSLv2, !SSLv3, !TLSv1, !TLSv1.1
smtpd_tls_security_level = may
tls_preempt_cipherlist = yes
unknown_local_recipient_rject_code = 550
|
I asked my ISP to unblock port 25, and unfortunately, corporate higher-ups don't let users use that port at all, so it can't be unblocked.
So because of that, I just sucked it up and bought a VPS, and it worked perfectly. Turns out to be useful for quite a lot of things besides mail though, such as a VPN, a fast CPU for more demanding server tasks (such as a Matrix homeserver), etc.
Unfortunately I never managed to find out how to make postfix behave like this. If someone does know how, then by all means please answer.
For anyone whose ISP blocks port 25, please consider investing into a VPS or switching ISPs.
| Postfix: sending outgoing mail through port 465/587 locally |
1,381,087,722,000 |
I know you need to specify your email address, password, and SMTP server when sending emails using command line tools such as sendmail, sendEmail, etc. This is also true in other languages such as using the Python SMTP module, smtplib.
I'm wondering why I can just use the default mail command to send emails without specifying this information.
ex. If I run the following, it will go through.
ls | mail <email.address>
|
mail is a Mail User Agent (MUA). It is one of the tools responsible for providing an interface to the email subsystem to a user. For example you can use it to send and email and to read messages that have been delivered in the traditional way to your system. It is concerned with users, not with delivery. You can have many MUAs installed on a system
sendmail, exim, postfix, etc. are Mail Transport Agents (MTA). These tools don't care about user friendliness but are instead responsible for sending and receiving messages. Only one of these will be present on a system. It should be configured to know how to handle processing (antispam, DKIM, DMARC, etc.), transmission (for example, direct delivery, via a smarthost, etc.) and delivery (mailfile, maildir, separate program, etc.)
When you send a message with an MUA it hands it off to the MTA for delivery
| Why I don't need to specify SMTP server in mail? |
1,381,087,722,000 |
In order to (semi-)automate some of my workflows I would like to find a way to open an Evolution mail compose window with a file of my choosing already attached.
I have learned so far that:
Evolution accepts "mailto:" links at the command line, but unfortunately the "mailto:" URL scheme does not allow specifying an attachment.
the functionality for opening a compose window with a file already attached is exposed by Evolution in some fashion, since I can select "Send to..." from the context menu for a file in Nautilus and an Evolution mail compose window with that file attached will pop up.
My attempts to find out how I could achieve this myself were thwarted by either lack of documentation or my inability to come up with the right search terms. Anything from an out-of-the-box-solution from someone who already solved that problem before me to a pointer to the documentation to an API (dbus, most likely?) that allows me to achieve my goal are viable options for me, so any pointer short of "take a look at the nautilus code and see how they do it" (which is my Plan C) would be greatly appreciated.
Also, suggesting a different mail client that more readily exposes the desired functionality is unlikely to help me, unless said mail client supports Office 365 "modern authentication" which, to the best of my knowledge, only Evolution does.
|
Through a stroke of luck I stumbled across the answer myself, with evolution as the default mail application I can simply use
xdg-email --attach <filename>
and it will do precisely what I was trying to do.
It is part of xdg-utils and came preinstalled on Ubuntu 20.10 and seeing that it is a freedesktop package should be available for most distributions.
I then ended up going deeper into the rabbit hole just to learn that evolution in fact does support attachment for mailto: links like this
evolution mailto:\?attach=<filename>
Whether or not you need the backslash depends on your shell and calling context.
| How to open an evolution compose window with file attachment |
1,381,087,722,000 |
I use an email client called Alpine. Currently I start it in one of several different modes in order to specify the outgoing SMTP server based on what I'm doing, in particular the From address that I wish to use.
What would be much more convenient is if I could simply direct Alpine to use my own SMTP server (on my laptop), which in turn would choose a relay server based on the From address of each message I'm sending.
I am hoping someone is already doing this (it seems like it should be a common need given recent tightening of restrictions on accepting mail) and that it is not complicated.
(As a bonus, I'd also like to be able to start Alpine in a mode which uses a local server that waits until Monday morning to send out messages.)
Here is possibly the same question: Changing SMTP authentication in mutt based on From e-mail address, but it is old and so are references on esmtp – I'm not sure esmtp is up to date with modern security protocols, etc.
|
Answer for Alpine email client
Recent versions of Alpine are compiled for Ubuntu with many of the available patches, i.e., enhancements, and these include a feature called "smtp-rules". It's not perfectly well documented, but here is what the .pinerc section looks like for me. It handles email addresses from my employer, from my alma mater, and from two Gmail identities:
# Unfortunately, using gmail's SMTP servers require setting up 2-factor authorization,
# which then allows you to get an "app password" for each account, which can be used
# by Alpine. Instead of doing this, for now I'm using MIT's, which is changing but
# currently letting through my gmail identities
smtp-rules= _FROM_ == {[email protected]} => _SMTP_{smtp.office365.com:587/tls/[email protected]}
smtp-rules= _FROM_ == {[email protected]} => _SMTP_{outgoing-alum.mit.edu:465/ssl/user=me}
smtp-rules= _FROM_ == {[email protected]} => _SMTP_{outgoing-alum.mit.edu:465/ssl/user=me}
smtp-rules= _FROM_ == {[email protected]} => _SMTP_{outgoing-alum.mit.edu:465/ssl/user=me}
For other clients, or another way using Alpine
I haven't tested esmtp, since the above works nicely, but this seems to be an alternative:
Install esmtp
Set the smtp-server field to the executable, /usr/local/bin/esmtp
Put something like the following in your ~/.esmtprc file:
identity [email protected]
hostname mail.server.com:25
username "joe"
password "secret"
starttls enabled
default
identity [email protected]
hostname smtp.gmail.com:587
username "[email protected]"
password "secret2"
starttls required
Reference for the esmtp part: Send mail with eSMTP for a simple, single-user system - TechRepublic.
| outgoing smtp choose server based on From address |
1,381,087,722,000 |
I have written a shell scripting for monitoring the system CPU usage and memory usage. I need to know how to send notification to mail that my system reached particular threshold (example:- 90%).
My code:
#! /bin/bash
printf "Date\t\t\tMemory\t\tDisk\t\tCPU\n"
end=$((SECONDS+30))
while [ $SECONDS -lt $end ]; do
CURRENTDATE=`date +"%Y-%m-%d %T"`
MEMORY=$(free -m | awk 'NR==2{printf " \t%.2f%%\t\t", $3*100/$2 }')
DISK=$(df -h | awk '$NF=="/"{printf "%s\t\t", $5}')
CPU=$(top -bn1 | grep load | awk '{printf "%.2f%%\t\t\n", $(NF-2)}')
echo ${CURRENTDATE} "$MEMORY$DISK$CPU"
done
|
You probably should use some monitoring solution (Nagios, Zabbix FTW!). But if you really want to use your custom script you can just use mail program.
echo "Current CPU USAGE $CPU" | mail -s "This is subject like: CPU WARNING" [email protected]
You can also use ssmpt. I didn't tested it but there is simple article about it https://www.howtogeek.com/51819/how-to-setup-email-alerts-on-linux-using-gmail/.
| How to set alarm/alert if my system cpu usage reaches a particular threshold? |
1,581,871,797,000 |
I recently installed neomutt on my fresh Arch installation. I setup my .muttrc as follows:
# Receive mail
set imap_user = [email protected]
set folder = imap://imap.example.org/
set spoolfile = +INBOX
# Send mail
set realname = 'name'
set from = [email protected]
set use_from = yes
set smtp_url = smtp://$imap_user:[email protected]
set ssl_starttls = yes
set editor = nano
set record = +Sent
mailboxes =INBOX
# Store message headers locally to speed things up.
# If hcache is a folder, Mutt will create sub cache folders for each account which may speeds things up even more.
set header_cache = ~/.cache/mutt
# Allow Mutt to open a new IMAP connection automatically.
unset imap_passive
# Keep the IMAP connection alive by polling intermittently (time in seconds).
set imap_keepalive = 300
# How often to check for new mail (time in seconds).
set mail_check = 120
Note: according to neomutt's documentation, the rc file can be called .muttrc, so that's not an issue
I can receive emails without any issues. The problem comes when I try to send an email. I get the following error message:
Could not connect to smtp.example.org (No route to host).
When I do ping smtp.example.org I get:
PING example.org (11.111.111.111) 56(84) bytes of data.
64 bytes from vn.example.org (11.111.111.111): icmp_seq=1 ttl=52 time=92.7 ms
64 bytes from vn.example.org (11.111.111.111): icmp_seq=2 ttl=52 time=93.4 ms
64 bytes from vn.example.org (11.111.111.111): icmp_seq=3 ttl=52 time=94.6 ms
64 bytes from vn.example.org (11.111.111.111): icmp_seq=4 ttl=52 time=95.1 ms
64 bytes from vn.example.org (11.111.111.111): icmp_seq=5 ttl=52 time=92.9 ms
64 bytes from vn.example.org (11.111.111.111): icmp_seq=6 ttl=52 time=93.3 ms
64 bytes from vn.example.org (11.111.111.111): icmp_seq=7 ttl=52 time=91.8 ms
Which tells me this must be a problem on my side, not from the server. I have already tried to change my configuration, check for any invisible characters on the smtp url, reseting my PC and my router, but the problem persists.
Can someone tell me why is this happening and how can I fix it in order to send emails?
Thank you very much!
|
"Which tells me this must be a problem on my side, not from the
server."
Nope. That tells you that a machine named smtp.example.org exists, it has 11.111.111.111, and about 91ms average roundtrip latency. Nothing more than that.
Once you try to do something more complex than sending an icmp echo request, some security trigger on example.org firewall might tell your machine that smtp.example.org doesn't exist, hence the error message you get from mutt.
But it's more likely the syntax you've used is wrong
set smtp_url = smtp://$imap_user:[email protected]
From neomutt's manual:
NeoMutt can then attempt to encrypt communication with remote servers
if these protocols are suffixed with “s” for “secure communication”.
Try adding a "s" to the url. This will attempt a connection using ssl/tls.
set smtp_url = smtps://$imap_user:[email protected]
But first check if both smtp (optional feature!) and ssl support (optional feature!) are compiled in
neomutt -v
If it doesn't work you should be looking at your provider's info. Does it support SASL? If the auth is via SASL, you must configure the SASL part.
cheers
| mutt: Could not connect to <smtp_url> (No route to host) |
1,581,871,797,000 |
I have created a script to install Postfix and it works perfect with all my Ubuntu clients, but not on my Fedora client.
The Fedora client is able to send e-mail directly to [email protected], but when sent to root it should be redirected to [email protected] but is instead sent to [email protected]
I can't figure out for the life of me why... Here is the configs and logs if anybody can point out the issue that would be awesome.
#!/bin/bash
DOMAIN=domain.com
[email protected]
cat << 'EOL' >/etc/postfix/main.cf
#
#PostFixConfig
##Modify Below [HOSTNAME] & [DOMAIN]##
######################################
myhostname = [HOSTNAME]
mydomain = [DOMAIN]
relayhost = smtp.$mydomain
biff = no
append_dot_mydomain = no
readme_directory = no
smtpd_banner = $myhostname ESMTP $mail_name
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
smtp_header_checks = regexp:/etc/postfix/header_checks
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = $mydomain
mydestination = $myhostname $myhostname.$mydomain localhost
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = loopback-only
inet_protocols = all
EOL
cat << EOL >/etc/aliases
postmaster: root
root: $forwardemail
trash: /tmp/mail.trash
EOL
newaliases
cat << EOL >/etc/postfix/header_checks
/^From:[[:space:]]+(.*)/ REPLACE From: "$HOSTNAME" <$forwardemail >
EOL
postmap /etc/postfix/header_checks
chown root:root /etc/postfix/ -R && service postfix restart
echo "PostFix Setup For $HOSTNAME" | mail -s "PostFix has forwarded roots e-mail on $HOSTNAME to this e-mail" root
echo ""
echo "Main.CF"
cat /etc/postfix/main.cf
echo ""
echo "header_checks"
cat /etc/postfix/header_checks
echo ""
echo "Aliases"
cat /etc/aliases
echo ""
echo "MailName"
cat /etc/mailname
echo ""
echo "MailLog"
tail /var/log/maillog
tail /var/log/mail.log
Logs:
Jul 13 05:17:25 kvmatrix postfix/cleanup[16951]: F296FE104B: message-id=<20190713121725.F296FE104B@KVMatrix>
Jul 13 05:17:25 kvmatrix postfix/qmgr[16643]: F296FE104B: from=<[email protected]>, size=443, nrcpt=1 (queue active)
Jul 13 05:17:26 kvmatrix postfix/smtp[16953]: F296FE104B: replace: header From: [email protected] (root): From: "kvmatrix" <[email protected] >
Jul 13 05:17:26 kvmatrix postfix/smtp[16953]: F296FE104B: to=<[email protected]>, orig_to=<root>, relay=smtp.domain.com[192.168.1.255]:587, delay=0.06, delays=0.01/0.01/0.03/0.01, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as 17FACC247B)
Jul 13 05:17:26 kvmatrix postfix/qmgr[16643]: F296FE104B: removed
[root@kvmatrix ~]#
I notice the line to=<[email protected]>, orig_to=<root>, which almost looks like a "redirect/alias" to me except the address is wrong.
[root@kvmatrix ~]# cat /etc/aliases
mailer-daemon: postmaster
postmaster: root
root: [email protected]
trash: /tmp/mail.trash
Here is a log from a working server setup using the exact same script:
Jul 13 05:03:18 confluence postfix/master[4518]: daemon started -- version 3.1.0, configuration /etc/postfix
Jul 13 05:03:18 confluence postfix/pickup[4521]: B9029A2C44: uid=0 from=<[email protected]>
Jul 13 05:03:18 confluence postfix/cleanup[4525]: B9029A2C44: message-id=<20190713120318.B9029A2C44@confluence>
Jul 13 05:03:18 confluence postfix/qmgr[4522]: B9029A2C44: from=<[email protected]>, size=449, nrcpt=1 (queue active)
Jul 13 05:03:18 confluence postfix/cleanup[4525]: BA500A2C45: message-id=<20190713120318.B9029A2C44@confluence>
Jul 13 05:03:18 confluence postfix/qmgr[4522]: BA500A2C45: from=<[email protected]>, size=594, nrcpt=1 (queue active)
Jul 13 05:03:18 confluence postfix/local[4533]: B9029A2C44: to=<[email protected]>, relay=local, delay=0.01, delays=0.01/0/0/0, dsn=2.0.0, status=sent (forwarded as BA500A2C45)
Jul 13 05:03:18 confluence postfix/qmgr[4522]: B9029A2C44: removed
Jul 13 05:03:18 confluence postfix/smtp[4534]: BA500A2C45: replace: header From: [email protected] (root): From: "confluence" <[email protected] >
Jul 13 05:03:18 confluence postfix/smtp[4534]: BA500A2C45: to=<[email protected]>, orig_to=<[email protected]>, relay=smtp.domain.com[192.168.1.255]:587, delay=0.04, delays=0/0/0.03/0.01, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as C3BC8C247B)
Jul 13 05:03:18 confluence postfix/qmgr[4522]: BA500A2C45: removed
Jul 13 05:04:52 confluence postfix/pickup[4521]: 89B08A2C45: uid=0 from=<[email protected]>
Jul 13 05:04:52 confluence postfix/cleanup[4525]: 89B08A2C45: message-id=<20190713120452.89B08A2C45@confluence>
Jul 13 05:04:52 confluence postfix/qmgr[4522]: 89B08A2C45: from=<[email protected]>, size=385, nrcpt=1 (queue active)
Jul 13 05:04:52 confluence postfix/cleanup[4525]: 8A550A2C44: message-id=<20190713120452.89B08A2C45@confluence>
Jul 13 05:04:52 confluence postfix/qmgr[4522]: 8A550A2C44: from=<[email protected]>, size=530, nrcpt=1 (queue active)
Jul 13 05:04:52 confluence postfix/local[4533]: 89B08A2C45: to=<[email protected]>, relay=local, delay=0.01, delays=0/0/0/0, dsn=2.0.0, status=sent (forwarded as 8A550A2C44)
Jul 13 05:04:52 confluence postfix/qmgr[4522]: 89B08A2C45: removed
Jul 13 05:04:52 confluence postfix/smtp[4534]: 8A550A2C44: replace: header From: [email protected] (root): From: "confluence" <[email protected] >
Jul 13 05:04:52 confluence postfix/smtp[4534]: 8A550A2C44: to=<[email protected]>, orig_to=<[email protected]>, relay=smtp.domain.com[192.168.1.255]:587, delay=0.05, delays=0/0/0.04/0.01, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as 93953C247B)
Jul 13 05:04:52 confluence postfix/qmgr[4522]: 8A550A2C44: removed
|
Well I have used this in the past, but tried to trim down my configs while setting Postfix up this time around. I'm not sure why Ubuntu doesn't need it, but Fedora does, but this is how I fixed it.
/etc/postfix/main.cf:
canonical_maps = hash:/etc/postfix/canonical
/etc/postfix/canonical:
root [email protected]
Reload Postfix and test! --> postmap /etc/postfix/canonical && postfix reload
| Postfix on Fedora not following Aliases |
1,581,871,797,000 |
I've recently started using Notmuch. One thing I am missing is to setup afew to move messages between folders after tagging them with Notmuch. It all works fine with just one account under ~/Mail, however, I want to operate on 3 separate accounts which would be ~/Mail/Account1 ~/Mail/Account2 ~/Mail/Account3
How do I configure afew to move messages based on tags in specific accounts? afew just does not see anything in the subfolders/subaccounts.
Sample config:
[MailMover]
folders = Account1/INBOX Account2/INBOX Account3/INBOX
Account1/INBOX = 'tag:spam':spam
Account2/INBOX = 'tag:spam':spam
Account3/INBOX = 'tag:spam':spam
Obiviously Account1/INBOX is not a valid variable name. Perhaps afew cannot deal with multiple accounts?
|
I've talked about my issue with the creator of the application here.
Basically the idea is to use the FolderNameFilter with maildir_separator = / setting. This splits up your folders so that you can then reference your accounts like so:
account1/INBOX , account2/INBOX , account3/INBOX
| Multiple accounts with afew |
1,581,871,797,000 |
Picture a mail store for virtual users. Arriving mail is managed by Postfix (creating new files); access to mail is provided by Courier IMAP (moving files around, deleting files, creating sent mail); and periodically, off-site backups are taken (reading files without changing anything). Obviously this will all work if every process runs as root; equally obviously, they shouldn't all run as root.
The current setup has all the files owned by the postfix user and group. The Postfix and Courier processes all run as that uid/gid. But I would like to have the backup process run as a dedicated read-only user.
Is there a way to tell Postfix and Courier to create their files as user backup:postfix with permissions 0464/0575? I'm on Debian GNU/Linux if that makes any difference.
|
After further research, I've come to the conclusion that this isn't possible; it's a form of file giveaway (because the postfix user would need to create files owned by backup). Looks like the backup program will simply have to run with group access to the mailstore, and thus be depended on to not change anything.
| Postfix, Courier, and backups - appropriate file permissions? |
1,581,871,797,000 |
Is there any way to automatically click a link in an email from a specific recipient in Evolution, as the emails come in? Perhaps there is an extension that can be added, or possibly a macro? If not, is there any other way of doing this?
|
I don't think that you can directly "click" links, but Evolution have filters that can invoke different actions. One of the action is Pipe to Program.
Create filter by going to: Edit -> Message filters -> Add and set it to filter emails from the address that you want. In Then section select Pipe to Program and select script to process your mail.
I would reccomend simple Python script to process the mails - it has to allow input to be piped into it. Example below (based on this and this) should give you some idea how to achieve it. Obviously instead of logging urls to file you would have to open browser or just open it using urllib or similar.
#!/usr/bin/python
import fileinput
import re
f = open('a.out', 'a')
for line in fileinput.input():
urls = re.findall('http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*\(\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+', line)
for url in urls:
f.write(url+"\n")
f.close()
| Can hyperlink clicks be automated in Evolution and how |
1,581,871,797,000 |
If you like to decrypt messages in the Sylpheed email client the manual suggest to create a custom action to execute the following command:
*gpg2 --no-tty --batch --yes --command-fd 0 --passphrase-fd 0 --decrypt %f|
If I try to decrypt a email with this action the output from the terminal is written to the body of the email. But it writes only the last 1000 lines to the email file. I changed the scrollback property for the lxterminal under /home/ubuntu/.config/lxterminal/lxterminal.conf. But it seems it doesn't affect the output. I also tried to redirect the output to the email file at self
*gpg2 --no-tty --batch --yes --command-fd 0 --passphrase-fd 0 --output %f --decrypt %f
In this case I lost all the header information from the email.
|
I create a new action under Configuration / Actions... and assign the command */home/ubuntu/Documents/CustomScripts/decryptMail.sh %f ~/doc to this action.
The decryptMail.sh file contains the following commands:
gpg2 --no-tty --batch --yes --command-fd 0 --passphrase-fd 0 --output $2 --decrypt $1
decryptedString=$(cat $2);
escaped=$(printf '%s\n' "$decryptedString" | sed 's:[\/&]:\\&:g;$!s/$/\\/');
sed -i '/-BEGIN PGP MESSAGE-/,/-END PGP MESSAGE-/{//!d}' $1;
sed -i "/BEGIN PGP MESSAGE/a $escaped" $1;
During my research two questions came up which could enhance the script. First question is about the part, when I want to insert the decrypted text from the ~/doc file (represented by $2) into the email file (represented by $1). I read that could be done with the r-function but all my trails like sed '/-BEGIN PGP MESSAGE-/r$1' $2 didn't work. Any suggestions? The second question is; how to tell Sylpheed to reload the email file? Till now I have to click on some other email and then back to my decrypted email to see the changes the script has done to the email file.
| Create a action in Sylpheed to decrypt messages |
1,581,871,797,000 |
I am trying to write a bash script with a function which you use to send an email from the command line to an address and include a Cc address, a subject line, and an input file. For example, if the function is called "m," the typed command would look like:
m [email protected] [email protected] SubjectLine TextFile.txt
Below is what I have done so far in vi. I am sure I am declaring the variables wrong, and much more, probably. I am very new to this.
m()
{
mail -s="$1" -t="$2" -s="$3" #I am still unclear about positional parameters
}
|
#!/bin/bash
m() {
to_addr="$1"
cc_addr="$2"
subject="$3"
body="$4"
cat "$body" | mail -s "$subject" -c "$cc_addr" "$to_addr"
}
if [[ "$#" -eq 4 ]]; then
m "$1" "$2" "$3" "$4"
else
echo "Incorrect number of paramaters. Aborting."
echo "Example syntax: $0 [email protected] [email protected] "Message Subject" /path/to/messagebody.txt"
exit 1
fi
| Script to send mail using function |
1,462,867,651,000 |
I have several months of Google Alerts in my email and I would like to share them somewhere on the web (for instance on a MediaWiki wiki). Is there an easy way to export them?
The alerts contain HTML of this kind (seen from Thunderbird):
<div style="color:#fff;font-size:9px;letter-spacing:0.8px"> <div style="padding:3px 0px 4px 4px;background:rgb(255,255,255);background-color:rgba(0,0,0,0.5);width:96px">La Provincia di Biella</div> </div> <!--[if gte mso 9]></div><![endif]--> </td> </tr> </table> </a> <div> <span style="padding:0px 6px 0px 0px"> <a href="https://www.google.com/url?rct=j&sa=t&url=http://www.laprovinciadibiella.it/web/castelletto-cervo-nei-siti-cluniacensi-9458&ct=ga&cd=CAEYACoTMzc2NjcxMzA4NDYzNjc4NjUwMjIZZThjOGE1NjBlZjA5ZDRkMDppdDppdDpJVA&usg=AFQjCNEW4QKACEvE_AbGrMGOBJ2y4dFSIw" style="color:#427fed;display:inline;text-decoration:none;font-size:16px;line-height:20px">Castelletto Cervo nei siti cluniacensi</a> </span> <div> <div style="padding:2px 0px 8px 0px"> <div style="color:#737373;font-size:12px"> <a style="text-decoration:none;color:#737373">La Provincia di Biella</a> </div>
|
This worked for me:
download the alerts from your email in a Thunderbird directory;
install the ImportExportTools plugin and export the whole directory as HTML;
go to the export directory and run: find * -print0 | xargs -0 -I § bash -c 'NAME="§"; DATE="{{#time:j F Y| ${NAME:0:8} }}"; grep --text -Eo "ru=([^&]+)&" "§" | sed "s,ru=,;$DATE:,g" | sed "s,&,,g" ; ' | sort -ru
I used ;$DATE: as prefix for each URL because that's meaningful wikitext and parser functions allow to easily translate the "AAAAMMDD" format used by the export files. You can replace with anything.
A smarter version may send the URL to Zotero or Citoid to get a proper citation, or maybe parse the original HTML to extract more information. The HTML format seems to be different for alerts before 2014-01-18.
Tested with GNU findutils 4.5.12, bash 4.3.42.
TODO: download the "see more articles" links and parse those too. In busy days, the emails only contain a random selection of the "top" news.
| How to export Google Alerts citations? |
1,462,867,651,000 |
I'm currently trying to set up Postfix with Dovecot, but something does not seem to work the way it should be.
For some reason, mails I sent to my mail account appear in the logs, but do not become relocated into the respective mailbox. The logs are not displaying any error, so I am pretty much left without a clue where the problem might be. Additionally, I have not set up any of the servers at any point, so I can't really tell what I might be missing here.
Hope you guys can give me a hint.
Edit: I'm also using a frontend webinterface which lets me log in, but no mails can be displayed in its interface either.
tree -aps
root /var/customers/mail/webmail/mail.domain.net/server/Maildir # tree -aps
.
|-- [drwx------ 4096] .Drafts
| |-- [drwx------ 4096] cur
| |-- [-rw------- 51] dovecot-uidlist
| |-- [-rw------- 248] dovecot.index.log
| |-- [-rw------- 0] maildirfolder
| |-- [drwx------ 4096] new
| `-- [drwx------ 4096] tmp
|-- [drwx------ 4096] .Sent
| |-- [drwx------ 4096] cur
| |-- [-rw------- 51] dovecot-uidlist
| |-- [-rw------- 248] dovecot.index.log
| |-- [-rw------- 0] maildirfolder
| |-- [drwx------ 4096] new
| `-- [drwx------ 4096] tmp
|-- [drwx------ 4096] .Spam
| |-- [drwx------ 4096] cur
| |-- [-rw------- 51] dovecot-uidlist
| |-- [-rw------- 248] dovecot.index.log
| |-- [-rw------- 0] maildirfolder
| |-- [drwx------ 4096] new
| `-- [drwx------ 4096] tmp
|-- [drwx------ 4096] .Trash
| |-- [drwx------ 4096] cur
| |-- [-rw------- 51] dovecot-uidlist
| |-- [-rw------- 156] dovecot.index.log
| |-- [-rw------- 0] maildirfolder
| |-- [drwx------ 4096] new
| `-- [drwx------ 4096] tmp
|-- [drwx------ 4096] cur
|-- [-rw------- 51] dovecot-uidlist
|-- [-rw------- 8] dovecot-uidvalidity
|-- [-r--r--r-- 0] dovecot-uidvalidity.55020f8f
|-- [-rw------- 432] dovecot.index.log
|-- [-rw------- 96] dovecot.mailbox.log
|-- [drwx------ 4096] new
|-- [-rw------- 23] subscriptions
`-- [drwx------ 4096] tmp
19 directories, 18 files
mail.log
Mar 13 00:53:41 v220110897556081 postfix/pickup[12736]: 06AE0736F6C5: uid=0 from=<root>
Mar 13 00:53:41 v220110897556081 postfix/cleanup[15499]: 06AE0736F6C5: message-id=<[email protected]>
Mar 13 00:53:41 v220110897556081 postfix/qmgr[12737]: 06AE0736F6C5: from=<[email protected]>, size=443, nrcpt=1 (queue active)
Mar 13 00:53:41 v220110897556081 postfix/trivial-rewrite[15500]: warning: do not list domain mail.domain.net in BOTH mydestination and virtual_mailbox_domains
Mar 13 00:53:41 v220110897556081 postfix/local[15503]: warning: database /etc/aliases.db is older than source file /etc/aliases
Mar 13 00:53:41 v220110897556081 postfix/local[15503]: 06AE0736F6C5: to=<[email protected]>, relay=local, delay=0.03, delays=0.02/0.01/0/0, dsn=2.0.0, status=sent (delivered to mailbox)
Mar 13 00:53:41 v220110897556081 postfix/qmgr[12737]: 06AE0736F6C5: removed
postconf -Mf
smtp inet n - - - - smtpd
pickup fifo n - - 60 1 pickup
cleanup unix n - - - 0 cleanup
qmgr fifo n - n 300 1 qmgr
tlsmgr unix - - - 1000? 1 tlsmgr
rewrite unix - - - - - trivial-rewrite
bounce unix - - - - 0 bounce
defer unix - - - - 0 bounce
trace unix - - - - 0 bounce
verify unix - - - - 1 verify
flush unix n - - 1000? 0 flush
proxymap unix - - n - - proxymap
proxywrite unix - - n - 1 proxymap
smtp unix - - - - - smtp
relay unix - - - - - smtp
showq unix n - - - - showq
error unix - - - - - error
retry unix - - - - - error
discard unix - - - - - discard
local unix - n n - - local
virtual unix - n n - - virtual
lmtp unix - - - - - lmtp
anvil unix - - - - 1 anvil
scache unix - - - - 1 scache
maildrop unix - n n - - pipe
flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${recipient}
uucp unix - n n - - pipe
flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail
($recipient)
ifmail unix - n n - - pipe
flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)
bsmtp unix - n n - - pipe
flags=Fq. user=bsmtp argv=/usr/lib/bsmtp/bsmtp -t$nexthop -f$sender
$recipient
scalemail-backend unix - n n - 2 pipe
flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store
${nexthop} ${user} ${extension}
mailman unix - n n - - pipe
flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py
${nexthop} ${user}
dovecot unix - n n - - pipe
flags=DRhu user=vmail:vmail argv=/usr/lib/dovecot/deliver -d ${recipient}
|
You probably have the default local_transport = local as the log says delivered to mailbox.
You need to tell postfix to use dovecot as the transport for local deliveries. you can do this as follows:
Edit your main.cf file and modify it to have the following lines:
local_transport = virtual
virtual_transport = dovecot
Don't forget to reload postfix to activate the new config.
| Postfix / Dovecot Mail appears in logs, but not in its respective folder |
1,462,867,651,000 |
I host a handful of domains on a single box (Linux, Ubuntu 13.x) and am attempting to use Postfix 2.10.2-1 to route mail to them. (I used sendmail for the past 10 years, so this is new to me.) All my MX records are set up accordingly, so external mail is reaching the box just fine.
I followed the various online tutorials and have the following relevant lines in my configs:
main.cf
-------
myhostname = foo.a.com
myorigin = /etc/mailname # this just has 'a.com' inside it
mydestination = a.com localhost.localdomain localhost
virtual_alias_domains = b.com c.org
virtual_alias_maps = hash:/etc/postfix/virtual
At the moment I just want all mail addressed to postmaster at any of the domains to go to the postmaster account, and all mail addressed to anyone else at any of the domains to go to the associated account.
virtual
-------
[email protected] postmaster
@a.com userA
[email protected] postmaster
@b.com userB
[email protected] postmaster
@c.org userC
Unfortunately, all mail addressed to anyone at any of these domains is being routed to userA. Until I enabled verbose logging, I thought that the virtual domains were not being respected. After enabling verbose logging, however, I see this happening for every incoming mail:
mail.log
--------
...
postfix/cleanup: maps_find: virtual_alias_maps: hash:/etc/postfix/virtual(0.lock|fold_fix): @b.com = userB
postfix/cleanup: mail_addr_find: [email protected] -> userB
postfix/cleanup: send attr request = rewrite
postfix/cleanup: send attr rule = local
postfix/cleanup: send attr address = userB
But then trivial-rewrite runs again (for about the 80th time processing this particular piece of mail) and decides that userB is not the true final Unix account recipient, but that it instead represents a mail address at myorigin (or perhaps it's picking the first element in mydestination ... that would make more sense).
postfix/trivial-rewrite: master_notify: status 0
postfix/trivial-rewrite: rewrite socket: wanted attribute: request
postfix/trivial-rewrite: input attribute name: request
...
postfix/trivial-rewrite: 'local' 'userB' -> '[email protected]' # <-- d'oh!
postfix/trivial-rewrite: send attr flags = 0
postfix/trivial-rewrite: send attr address = [email protected]
postfix/trivial-rewrite: master_notify: status 1
Then postfix/cleanup takes over
postfix/cleanup: maps_find: virtual_alias_maps: hash:/etc/postfix/virtual(0.lock|fold_fix): @a.com = userA
postfix/cleanup: mail_addr_find: [email protected] -> userA
postfix/cleanup: send attr request = rewrite
postfix/cleanup: send attr rule = local
postfix/cleanup: send attr address = userA
and concludes that userA is the true intended Unix account recipient.
I know almost nothing about Postfix, but it seems from the logs that it only decides on the final recipient address after running it through rewrite twice and getting the same result twice in a row. How do I prevent it from interpreting the local account userB as a mail address userB@mydestination[0]? I want it to stop as soon as it finds the local userB and just deliver it to him.
Am I not allowed to list @mydestination[0] within /etc/postfix/virtual? While that could perhaps solve my current problem (because these users are real Unix users on the box, so the mail would get to the right place), Postfix would still wind up thinking that [email protected] is the final recipient. That seems wrong to me. It should just know that userB is a Unix account and stop there.
|
So I was able to solve my problem as I suggested at the end of my question, but I also concluded that avoiding virtual domains may be the correct way to go.
First, the initial proposed solution: remove references to a.com from the virtual file.
virtual
-------
#[email protected] postmaster
#@a.com userA
[email protected] postmaster
@b.com userB
[email protected] postmaster
@c.org userC
After I did that, the virtual translations for b.com and c.org generated [email protected] and [email protected] as expected, and since a.com is one of the mydestination entries, postfix/local dutifully delivered userB's mail to /var/mail/userB and userC's mail to /var/mail/userC.
Of course, as I feared in my initial question, it's still concluding that a.com is all of these users' final home domain, which feels weird to me. The obvious solution, then, is to not use virtual domains at all -- the whole point of virtual domains is to accept mail for addresses that are not actual Unix users on the system. But since all of my catch-all users are actual Unix users on the system, I should just be using local aliases:
/etc/aliases
------------
admin: postmaster
www: postmaster
@a.com: userA
@b.com: userB
@c.com: userC
I can still have catch-all addresses without using virtual domains at all.
| Postfix trivial-rewrite expands recipient incorrectly after virtual aliasing is done |
1,462,867,651,000 |
I have been trying to use the unix mail command to send emails, but haven't been having much success. I wasn't getting any errors though so I checked my var/mail file and found a lot of these messages:
Mailing to remote domains not supported
That makes sense, because I haven't given it an SMTP server, but how do I do this? I read through the man mail page and didn't see anything that would help, and googling took me to this page which left me feeling confused and rather unintelligent.
Is there a guide for setting up smtp settings which is not too much harder than it should be?
|
Like others have said, you'll need to set up a local mail server (sendmail, postfix, or whatever is your preference).
My assumption is that you're doing this from your home and you get an IP that changes every so often. If this is the case, then you'll find other problems with sending email. A lot of servers will simply deny you because of your IP address (see spamhaus or others).
To get around this, you'll need a relay (or ideally, a static IP* and DNS). Your ISP may provide you with an relay (you may need to ask) at which point you'll simply add the following directives
If you're using sendmail:
define(`SMART_HOST', `smtp.your.provider')dnl
If you're using postfix:
relayhost = smtp.your.provider
Where smtp.your.provider would be your relay host (this can be an IP as well).
Here are some guides for sendmail and postfix.
I use both; however, I think postfix is supposed to be easier and safer, but good practices it what really makes the difference. On Redhat-like systems (Fedora, CentOS, RHEL, Oracle, and so on) Sendmail seems to be default while others use Postfix.
*static IP isn't necessary, but makes life so much easier.
| How do I send email from a terminal? |
1,462,867,651,000 |
I can't find a guide for this (they are old and don't work) and I can't seem to manage to install it. I can't install Postfix because of its dependencies, so I'm going with Exim, which I installed through yum install exim and it was the latest version. However, I have no idea where to go from here. I know that I need to install Dovecot or Cyrus and I want to install Horde (not Squirrelmail). Not to mention that I also want to keep MariaDB 10, which I installed from its repository, as well as PHP 5.5. I don't know where to go from here.
|
Dovecot 2.2.10 is now in the updates repo and can be installed via yum install dovecot. Horde can be obtained from remi's PHP repository, which features not only an up-to-date version of PHP but also packages for Horde and various of its modules. After enabling remi's repo, a simple yum install php-horde-imp should be sufficient to give you a starter for a webmail installation based on Horde and IMP. You'll still have to configure it accordingly, though.
As for MariaDB: The MariaDB folks haven't set up a repo for CentOS 7 and 10.x, yet. You can still use the CentOS 6 repositories for 7, but I'd advise caution as the packages for 6 don't fit that well into 7. E.g. they do not come with unit files for systemd, which is forcing systemd to use the shipped init scripts. Even worse, MariaDB-server 10.x is clashing heavily with mariadb-libs, which in turn is being pulled in as a dependency by a lot of packages such as exim-mysql. CentOS base repo is currently shipping MariaDB 5.5.37, which is the most current of the 5.5 branch. If you're content with that, use 5.5 for now and upgrade to 10.x once a repository for CentOS 7 is available. The alternative would be to compile a dummy rpm deprecating the mariadb-libs package, which essentially amounts to a dirty hack I cannot really recommend.
If you decide to use 5.5 now and upgrade to 10.x later, be warned that this is everything but hassle-free in my experience. Safest way I found has been to create a complete database dump, clear /var/lib/mysql, upgrade to 10, feed the dump to the new version and run mysql_upgrade.
Update: Upon closer inspection, it appears I've been talking rubbish. The MariaDB-shared package is statisfying the dependencies on mariadb-libs just fine. Install it and you'll be good to go.
| How do I install Exim and Horde on Centos 7 with MariaDB 10? |
1,462,867,651,000 |
I have a CentOS box running my Apache website and Postfix, but whenever I try PHP's mail() function to my @aevidi email, it sends to my local mailbox in ~/mail, but is not visible in Zoho's webmail. When I send an email from my Gmail account to my @aevidi email, I see it in Zoho but not in my local mailbox (expected result). Here is my setup:
Zoho as my email host for my custom domain
CentOS box with my site and mail server (postfix)
I followed this tutorial for my Zoho/SES/Postfix high level setup (honestly not sure where SES comes into play)
I followed this tutorial to setup Postfix (and Dovecot before I realized what it did, but have removed it since).
/var/log/maillog after executing mail()
Aug 3 20:05:37 aevidi postfix/pickup[7702]: 31ADD40BDD: uid=48 from=<[email protected]>
Aug 3 20:05:37 aevidi postfix/cleanup[7707]: 31ADD40BDD: message-id=<20140804000537.31ADD40BDD@aevidi>
Aug 3 20:05:37 aevidi postfix/qmgr[7703]: 31ADD40BDD: from=<[email protected]>, size=344, nrcpt=1 (queue active)
Aug 3 20:05:37 aevidi postfix/local[7709]: 31ADD40BDD: to=<[email protected]>, relay=local, delay=0.03, delays=0.02/0.0
1/0/0, dsn=2.0.0, status=sent (delivered to maildir)
Aug 3 20:05:37 aevidi postfix/qmgr[7703]: 31ADD40BDD: removed
/etc/postfix/main.cf
myhostname = aevidi #This is my FQDN when I type 'hostname -f'
mydomain = aevidi.com
myorigin = $mydomain
home_mailbox = mail/
mynetworks = 127.0.0.0/8
inet_interfaces = all
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
smtpd_sasl_auth_enable = yes
smtpd_sasl_type = cyrus
smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients = yes
smtpd_sasl_authenticated_header = yes
smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination
smtpd_tls_auth_only = no
smtp_use_tls = yes
smtpd_use_tls = yes
smtp_tls_note_starttls_offer = yes
smtpd_tls_key_file = /etc/postfix/ssl/smtpd.key
smtpd_tls_cert_file = /etc/postfix/ssl/smtpd.crt
smtpd_tls_CAfile = /etc/postfix/ssl/cacert.pem
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
tls_random_source = dev:/dev/urandom
relayhost = email-smtp.us-east-1.amazonaws.com:25
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_tls_security_level = encrypt
smtp_tls_CAfile = /etc/ssl/certs/ca-bundle.crt
DNS configuration
Any help is appreciated!
|
If you want postfix to deliver mails for aevidi.com by doing an MX lookup (i.e to Zoho mail servers, in your case), then you should remove $domain i.e aevidi.com from mydestination.
| Postfix is sending and receiving mail locally, but not to external mailbox |
1,462,867,651,000 |
I tried to install modoboa follow this steps: http://modoboa.readthedocs.org/en/latest/getting_started/install.html
I installed modoboa with pip install modoboa:
Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 453, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 392, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 272, in fetch_command
klass = load_command_class(app_name, subcommand)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 77, in load_command_class
module = import_module('%s.management.commands.%s' % (app_name, name))
File "/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py", line 35, in import_module
__import__(name)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/commands/syncdb.py", line 8, in <module>
from django.core.management.sql import custom_sql_for_model, emit_post_sync_signal
File "/usr/local/lib/python2.7/dist-packages/django/core/management/sql.py", line 9, in <module>
from django.db import models
File "/usr/local/lib/python2.7/dist-packages/django/db/__init__.py", line 40, in <module>
backend = load_backend(connection.settings_dict['ENGINE'])
File "/usr/local/lib/python2.7/dist-packages/django/db/__init__.py", line 34, in __getattr__
return getattr(connections[DEFAULT_DB_ALIAS], item)
File "/usr/local/lib/python2.7/dist-packages/django/db/utils.py", line 93, in __getitem__
backend = load_backend(db['ENGINE'])
File "/usr/local/lib/python2.7/dist-packages/django/db/utils.py", line 27, in load_backend
return import_module('.base', backend_name)
File "/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py", line 35, in import_module
__import__(name)
File "/usr/local/lib/python2.7/dist-packages/django/db/backends/mysql/base.py", line 17, in <module>
raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e)
django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: No module named MySQLdb
python manage.py syncdb --noinput failed, check your configuration
Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 453, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 392, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 272, in fetch_command
klass = load_command_class(app_name, subcommand)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 77, in load_command_class
module = import_module('%s.management.commands.%s' % (app_name, name))
File "/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py", line 35, in import_module
__import__(name)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/commands/syncdb.py", line 8, in <module>
from django.core.management.sql import custom_sql_for_model, emit_post_sync_signal
File "/usr/local/lib/python2.7/dist-packages/django/core/management/sql.py", line 9, in <module>
from django.db import models
File "/usr/local/lib/python2.7/dist-packages/django/db/__init__.py", line 40, in <module>
backend = load_backend(connection.settings_dict['ENGINE'])
File "/usr/local/lib/python2.7/dist-packages/django/db/__init__.py", line 34, in __getattr__
return getattr(connections[DEFAULT_DB_ALIAS], item)
File "/usr/local/lib/python2.7/dist-packages/django/db/utils.py", line 93, in __getitem__
backend = load_backend(db['ENGINE'])
File "/usr/local/lib/python2.7/dist-packages/django/db/utils.py", line 27, in load_backend
return import_module('.base', backend_name)
File "/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py", line 35, in import_module
__import__(name)
File "/usr/local/lib/python2.7/dist-packages/django/db/backends/mysql/base.py", line 17, in <module>
raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e)
django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: No module named MySQLdb
python manage.py syncdb failed, check your configuration
Unknown command: 'migrate'
Type 'manage.py help' for usage.
python manage.py migrate --fake failed, check your configuration
Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 453, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 392, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 272, in fetch_command
klass = load_command_class(app_name, subcommand)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 77, in load_command_class
module = import_module('%s.management.commands.%s' % (app_name, name))
File "/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py", line 35, in import_module
__import__(name)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/commands/loaddata.py", line 11, in <module>
from django.core import serializers
File "/usr/local/lib/python2.7/dist-packages/django/core/serializers/__init__.py", line 22, in <module>
from django.core.serializers.base import SerializerDoesNotExist
File "/usr/local/lib/python2.7/dist-packages/django/core/serializers/base.py", line 5, in <module>
from django.db import models
File "/usr/local/lib/python2.7/dist-packages/django/db/__init__.py", line 40, in <module>
backend = load_backend(connection.settings_dict['ENGINE'])
File "/usr/local/lib/python2.7/dist-packages/django/db/__init__.py", line 34, in __getattr__
return getattr(connections[DEFAULT_DB_ALIAS], item)
File "/usr/local/lib/python2.7/dist-packages/django/db/utils.py", line 93, in __getitem__
backend = load_backend(db['ENGINE'])
File "/usr/local/lib/python2.7/dist-packages/django/db/utils.py", line 27, in load_backend
return import_module('.base', backend_name)
File "/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py", line 35, in import_module
__import__(name)
File "/usr/local/lib/python2.7/dist-packages/django/db/backends/mysql/base.py", line 17, in <module>
raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e)
django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: No module named MySQLdb
python manage.py loaddata initial_users.json failed, check your configuration
Unknown command: 'collectstatic'
Type 'manage.py help' for usage.
python manage.py collectstatic --noinput failed, check your configuration
I tried to install pip install MySQL-python but I received this error:
Downloading/unpacking MySQL-python
Downloading MySQL-python-1.2.5.zip (108kB): 108kB downloaded
Running setup.py egg_info for package MySQL-python
sh: mysql_config: orden no encontrada
Traceback (most recent call last):
File "<string>", line 16, in <module>
File "/tmp/pip_build_root/MySQL-python/setup.py", line 17, in <module>
metadata, options = get_config()
File "setup_posix.py", line 43, in get_config
libs = mysql_config("libs_r")
File "setup_posix.py", line 25, in mysql_config
raise EnvironmentError("%s not found" % (mysql_config.path,))
EnvironmentError: mysql_config not found
Complete output from command python setup.py egg_info:
sh: mysql_config: orden no encontrada
Traceback (most recent call last):
File "<string>", line 16, in <module>
File "/tmp/pip_build_root/MySQL-python/setup.py", line 17, in <module>
metadata, options = get_config()
File "setup_posix.py", line 43, in get_config
libs = mysql_config("libs_r")
File "setup_posix.py", line 25, in mysql_config
raise EnvironmentError("%s not found" % (mysql_config.path,))
EnvironmentError: mysql_config not found
----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /tmp/pip_build_root/MySQL-python
Storing complete log in /root/.pip/pip.log
Seems that error is caused by MySQL module but I don't know how to resolve it.
|
You should install the python mysqldb package provided with your distribution.
On a debian/ubuntu one:
$ apt-get install python-mysqldb
| Modoboa 1.1.1 Deployment Errors |
1,462,867,651,000 |
To quote from finger's man page
Mail status is shown as No Mail.'' if there is no mail at all,
Mail last read DDD MMM ## HH:MM YYYY (TZ)'' if the person has
looked at their mailbox since new mail arriving, or New mail
received ...'', Unread since ...'' if they have new mail.
I'd rather it didn't do that. In fact I'd like finger to only display no mail when asked.
Is there a way to ensure this behaviour? I have no admin rights to the machine or the network (and Google points me to nail-biting remedies for some reason). Emptying the mail folder is one solution but I'm looking for something more elegant, if possible.
|
Finger daemon implementations vary but I don't know of any that allows users to choose whether to reveal the time when they last checked their email.
If you want to keep this information private, arrange for your email to be delivered to a non-default mailbox. How to do that depends on the email setup. A lot of sites allow the use of procmail to filter incoming mail. The following minimalist ~/.procmailrc causes your mail to be delivered to a file in your home directory:
:0:
$HOME/inbox
Depending on your local configuration, you may need to explicitly invoke procmail from your .forward. Beware that using a non-default inbox may cause the occasional friction:
If there's a webmail or POP/IMAP service, you'll need to figure out how to make it read your inbox.
If your home directory is full or unmounted, email will be delivered to the default mailbox.
This won't work if your home directory isn't mounted on the machine that receives mail (a rare, but possible configuration).
If you have separate disk space quota for email and home directories, your email will now count against your home quota.
You cannot prevent the “last logged in” date from being revealed.
| Prevent `finger` from giving out mail info |
1,462,867,651,000 |
mail -f /home/debian9/Maildir
When new email coming,how to receive it in mailutils interface?
There are 1 email in my /home/debian9/Maildir.
Sent an email from admin to debian9 with command:
echo "This is the message body of new emial" | mail -s "This is the new subject " debian9
The new email can't be displayed .
? list
alias alternates Copy cd chdir copy decode delete discard dp dt echo edit else
endif envelope exit Followup file folder folders followup from group headers
help hold if ignore incorporate list mail mbox next nos nounfold Print pipe
preserve previous print quit Reply Respond reply respond retain Save save
sendheader set setq sen setenv shell size source struct summary Type tag top
touch type unalias undelete unfold unset untag variable version visual
warranty Write write xit z ? ! = # * + | -
Which command can receive new email?
|
You don't need a specific command to receive mail, mail is automatically delivered and stored on the machine's filesystem (usually on /var/spool/mail/username) by the appropriate Mail Delivery Agent.
Mailutils is a Mail User Agent. To read received mail, use one of these commands:
mail -p
mail --print
mail --read
Source: Mailutils documentation
| How to receive new email? |
1,391,814,340,000 |
Do any of the common Unix/Linux platforms provide a way to query the system administrator contact information from the command line. Obviously a system admin might not include this information when they set up the server, but is there a way to ask for it when it is there (e.g., name or email)?
|
Assuming there's no organizational procedure, you can't ask your coworkers, and you don't know the company who runs the server...
You could see if there's any contact information when you log in, e.g. in /etc/issue, /etc/motd
Or you could try emailing root@<this hostname>.
Or you could look at who is in the root or wheel group, and contact them. Either they are the system administrator, or they know who is. You can get their info with e.g. getent group 0, getent passwd <username>, and maybe finger.
| Get contact information of system administrator from the terminal |
1,391,814,340,000 |
I am looking for a simple procedure to extract email from my inbox into a file for further processing, using e.g. awk. With "extract" I mean use e.g. regex to get emails with a particular subject.
My Inbox is currently over 1Gb, so I use the tail command to get the last part. Here is an example of two messages:
From [email protected] Tue Nov 26 17:27:33 2013
Return-path: <[email protected]>
Envelope-to: [email protected]
Delivery-date: Tue, 26 Nov 2013 17:27:33 +0100
Received: from alfons.uib.no [2001:700:200:30::141]
by alfred.uib.no with esmtp (Exim 4.77)
id 1VlLU5-0003Gg-8R; Tue, 26 Nov 2013 17:27:33 +0100
Received: from thoralf.uib.no (smtp.uib.no) [2001:700:200:13:129:177:13:16]
by alfons.uib.no with esmtps (TLSv1:AES256-SHA:256) (Exim 4.77)
id 1VlLU5-0002Po-4p; Tue, 26 Nov 2013 17:27:33 +0100
Received: from cipr064089.klientdrift.uib.no [129.177.64.89]:35068
by smtp.uib.no with esmtpsa (Exim 4.69)
id 1VlLU5-0006dY-35; Tue, 26 Nov 2013 17:27:33 +0100
Message-ID: <[email protected]>
Date: Tue, 26 Nov 2013 17:27:38 +0100
From: bb b <[email protected]>
Organization: Uni Research AS
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.1.1
MIME-Version: 1.0
To: b b <[email protected]>
CC: Haakon Haegland <[email protected]>
Subject: Re: ddd
References: <[email protected]>
In-Reply-To: <[email protected]>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit
X-checked-clean: by exiscan on alfons.uib.no
X-Scanner: 2db488888a1c80ee768332c03a147d00 http://tjinfo.uib.no/virus.html
X-UiB-SpamFlag: NO UIB: -18 hits, 8.0 required
X-UiB-SpamReport: spamassassin found;
-15 From is listed in 'whitelist_SA'
-3.0 Message received from Norway
X-sender_host_address: 2001:700:200:13:129:177:13:16
X-sender_host_name: thoralf.uib.no
X-UID: 28258
Status: RO
On 11/26/2013 05:02 PM, b b wrote:
> ggg
> hhh
qqq
From [email protected] Tue Nov 26 17:33:10 2013
Return-path: <[email protected]>
Envelope-to: [email protected]
Delivery-date: Tue, 26 Nov 2013 17:33:10 +0100
Received: from alfons.uib.no [2001:700:200:30::141]
by alfred.uib.no with esmtp (Exim 4.77)
id 1VlLZW-0004jv-7u; Tue, 26 Nov 2013 17:33:10 +0100
Received: from thoralf.uib.no (smtp.uib.no) [2001:700:200:13:129:177:13:16]
by alfons.uib.no with esmtps (TLSv1:AES256-SHA:256) (Exim 4.77)
id 1VlLZW-0002wL-3T; Tue, 26 Nov 2013 17:33:10 +0100
Received: from cipr064186.klientdrift.uib.no [129.177.64.186]:57257
by smtp.uib.no with esmtpsa (Exim 4.69)
id 1VlLZW-0006iZ-29; Tue, 26 Nov 2013 17:33:10 +0100
Message-ID: <[email protected]>
Date: Tue, 26 Nov 2013 17:33:01 +0100
From: b b <[email protected]>
Organization: Uni CIPR
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20131028 Thunderbird/17.0.10
MIME-Version: 1.0
To: a a <[email protected]>
CC: Haakon Haegland <[email protected]>
Subject: Re: ddd
References: <[email protected]> <[email protected]>
In-Reply-To: <[email protected]>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit
X-checked-clean: by exiscan on alfons.uib.no
X-Scanner: 467bf36c80a8700bd89776b495ccd761 http://tjinfo.uib.no/virus.html
X-UiB-SpamFlag: NO UIB: -17.9 hits, 8.0 required
X-UiB-SpamReport: spamassassin found;
-15 From is listed in 'whitelist_SA'
-3.0 Message received from Norway
0.0 BODY: ReplaceTags: Contact
X-sender_host_address: 2001:700:200:13:129:177:13:16
X-sender_host_name: thoralf.uib.no
X-UID: 28259
Status: RO
txtxt
I guess the format of this email is SMTP http://en.wikipedia.org/wiki/SMTP_protocol ? (I have also seen the words MIME and RFC used, I don't know if these are related) Questions:
How do I know where a message ends and another starts?
How can I use a tool like awk to extract messages with a given subject field?
|
The format of the message is RFC 2282, the Internet Message Format. The file format sounds like you're describing the mbox format, which is RFC 4155.
According to RFC 4155, a new message in an mbox database begins with the From keyword, a single space then the address of the reported sender, a single space and the UTC date of when the message was received.
Thereafter header fields are separated by newline characters and begin with a letter. If the first character of the new line is whitespace (usually a tab I believe) then it is a continuation of the value of the previous header line. Header keys are separated from header values by : (colon space).
The header and body is separated by a blank line. Each message is also separated by a blank.
As for extracting the subject with awk, first extract the headers then pass it through this:
awk '/^Subject: .*/ {print substr($0,10)}'
This prints the line starting at position 10.
| Format of SMTP headers for scanning inbox email |
1,391,814,340,000 |
Is there a command line utility that checks if a specified mailserver is on some well-known blacklist?
I know amispammer but it is only available on Debian, it seems to be unmaintained and last time I checked it was very memory hungry.
|
Since I didn't find an amispammer substitute I created check-dnsbl.py, a small Python script that checks some well-known blacklists. It uses dnspython for all the necessary DNS requests.
Example:
$ ./check-dnsbl.py 117.246.201.146
2016-11-05 19:01:13 - ERROR - There is no reverse DNS record for 117.246.201.146
2016-11-05 19:01:13 - ERROR - OMG, 117.246.201.146 is listed in DNSBL zen.spamhaus.org: 127.0.0.11 ("https://www.spamhaus.org/query/ip/117.246.201.146")
2016-11-05 19:01:19 - ERROR - OMG, 117.246.201.146 is listed in DNSBL virbl.dnsbl.bit.nl: 127.0.0.2 ("See: http://virbl.bit.nl/lookup/index.php?ip=117.246.201.146")
2016-11-05 19:01:19 - ERROR - 117.246.201.146 is listed in 2 blacklists
The --debug switch increases the verbosity, e.g.:
2016-11-05 20:19:21 - DEBUG - Checking 26 DNS blacklists
(the set of blacklists can be changed via options - 2 of the default lists are aggregations)
It is also ok to just specify domain names:
$ ./check-dnsbl.py mailout1.example.org mailout2.example.org
| Mail server blacklist checker |
1,391,814,340,000 |
Is there any simple text-based mail client that I could use that could trigger a PHP script to parse mails received from the users?
I have a PHP application that sends email out to users and it would be nice if the application can parse the reply from users and store them into the database.
I'm using Centos 6 with Postfix and PHP sends email out using PHPMailer. No X Window System installed.
|
Your question is a bit confusing, as you refer to a text-based mail client and a PHP application and then specify that "the application" (i.e. your PHP application) to store email (or data extracted from that) in a database.
You can and probably should separate your sending application from your response processing application. The response processing can be done by calling any script from procmail, for that you need a .procmailrc file in the home directory of the receiving user that has the following:
:0
* ^Subject:.*[response-email]
| /path/to/your_script
You can leave out the Subject line if you want all mails to that email address processed, or use different selection criteria.
As for your_script I don't know of any commandline mail clients that directly put your material in a database. Since you probably should test the response anyway (if not to extract some extra database fields, at least to throw away spam) you might want to write your_script in PHP using PECL to parse its content and store it in your database.
(Of course you can use other languages you are familiar with for this purpose as well).
If you are using postfix to receive emails on the machine this script runs on, make sure to call procmail in /etc/postfix/main.cf:
mailbox_command = procmail -a "$EXTENSION"
| Linux mail client that can trigger a PHP script to parse email received |
1,391,814,340,000 |
I have many email archived in eml format. The problem is that I can't view them without installing an email client and importing eml files, which is tedious and not what i want.
Ideally, I would like to find something like a pdf viewer that opens when you click on the file.
I currently use munpack -t <file.eml> that extracts attachments and text in separate files. It kinda works but it's tedious.
As a reference, when I am on a Windows desktop, I use quicklook which opens the eml file like any other text or pdf file.
Any idea ?
|
Thunderbird opens .eml files, just like that, no need for importing them.
| How to visualise eml files? |
1,391,814,340,000 |
Using Procmail, I would like to add a rule that dictates:
If any email comes from this specific email address, in addition to delivering it locally, also forward it to this other email address.
My attempt at this rule is as follows:
:0 c:
* ^From:[email protected]
! [email protected]
... but this does not appear to work. In fact, it appears to not do anything.
|
You really should provide debugging details with an example of the message you are testing with; but we can speculate:
Maybe the regex doesn't match. Perhaps you actually mean
:0c
* ^From:(.*\<)?sender@example\.com
! [email protected]
Notice also the absence of a second colon after the c flag
(you cannot meaningfully use a lock file here, nor should you)
and the addition of a backslash before the .com
to only match a literal dot, not any character.
Maybe you are not calling Procmail at all.
Can you demonstrate that Procmail actually gets run when you receive mail? Perhaps see also https://www.iki.fi/era/mail/procmail-debug.html
| How can I set a simple forwarding procmail rule based on FROM? |
1,391,814,340,000 |
Apologies if this is not the right place to ask.
My email address is "[email protected]", but I subscribed (to several Debian mailing lists) with the email "[email protected]" (I'm 99% sure).
I think because of the "+ trick", the system fail to unsubscribe me. I've tried the unsubscription forms and the alternative methods but nothing worked. I didn't find an email contact to write to either. What should I do?
|
The “+ trick” is used by many subscribers to the Debian mailing lists, so it’s unlikely that that is what is causing problems for you, at least not on the mailing list side of things.
First, you need to change the “99% sure” to “100% sure”. To do so, look for an email you received from a Debian mailing list; in Gmail, in the drop-down menu, click on “Show original”, and look for “Return-path” — this will contain the email address that the email was sent to, encoded. For example, bounce-debian-infrastructure-announce=myname=gmail.com@lists.debian.org for an email sent from the Debian infrastructure announcements list to [email protected].
Once you have that, any of the available methods should allow you to unsubscribe.
If all else fails, the mailing lists page explains what to do, and provides a contact email address to write to.
| Help unsubscribing from Debian mailing lists [closed] |
1,391,814,340,000 |
I have a sample script here I want to bold the word BOLD in the text and send through email. Tried several ways but not seems to working.
BODY="Hello. I want to BOLD this"
{
echo "From: [email protected]"
echo "To: [email protected]"
echo "Subject: Texting"
echo "X-Mailer: htmlmail" $VERSION
echo "Mime-Version: 1.0"
echo "Content-Type: text/html; charset=US-ASCII"
print "<html><FONT COLOR=BLACK FACE="Geneva,Arial"SIZE=8><body>${BODY} </body>"
print "<html><FONT COLOR=BLACK FACE="Geneva,Arial"SIZE=10> ${BODY} </html>"
} | /usr/sbin/sendmail -t
|
you need a blank line between the email header and body.
you are trying to put double quotes in a double quoted string, incorrectly.
Try this:
/usr/sbin/sendmail -t <<END_EMAIL
From: [email protected]
To: [email protected]
Subject: Texting
X-Mailer: htmlmail $version
Mime-Version: 1.0
Content-Type: text/html; charset=US-ASCII
<html><body><p><b>${BODY}</b></p></body></html>
END_EMAIL
| Bold a text in Bash |
1,391,814,340,000 |
So I was playing a little with permissions in my system and then I noticed there is no permission specified for sending the file somewhere else.
I tried, as a simple user, the following command:
mail -a //etc/shadow [email protected]
I was satisfied to get a Permission Denied message, but it's still not clear what the permissions are required in order to send a file.
I mean, I use the mail command for mail protocol, but what about other commands or other protocols?
btw, the permissions for the shadow file were:
-rw-r----- 1 root shadow 1759 Oct 23 2017 shadow
|
There isn't one, because "sending" a file isn't really a filesystem-level operation. What the mail command does, is that it opens the file for reading, reads the data, and sends (writes) it over the network socket (probably encoded in the case of email, not that it matters). Similarly, an FTP client, scp, or any other would do the same, they'd read the file as usual.
You don't have read access to /etc/shadow, so mail running with your user id cannot open it for reading.
Linux does have the sendfile() system call, which directly copies data between two file descriptors, but that's basically the same as calling read() on the one and write() on the other fd, except that it happens within the kernel so there's less system call overhead. It, too, requires the source to be opened for reading.
| Which permissions do I need in order to send someone else / root files? |
1,391,814,340,000 |
TLDR: I need a utility that reads an email and looks at the To: and Cc: fields to find an email address from a list of knows addresses. If it finds one I want it to output the email with an extra deliver_to: <address> envelope line.
Background
My ISP delivers all company mail to a "domain mailbox"/"Catch all" mailbox but doesn't record the envelope recipient anywhere. We have an exchange server receive from that mailbox (using a so called "POP3 connector") and distribute them to users mailboxes. Bcc'ed mail and mail from mailing lists gets delivered to a default mailbox. I'm replacing exchange and this is the only piece left. I can retrieve mails with getmail using MultidropPOP3Retriever but then getmail expects to find an envelope line with the recipients email address (e.g. delivered_to: [email protected]) which my ISP doesn't provide. So I have to do my best and recover it from To:/CC:.
|
Turns out that my answer was in the extensive getmail documentation. I need to use what getmail calls MultiGuesser.
However since in my case my ISP was adding a line like this in the envelope headers:
for <[email protected]>
and since MultiGuesser is not perfect (e.g. it can't guess right if the recipient is bcc'ed) I finally implemented the original idea of adding delivered_to lines. I kept the MultiGuesser just in case my ISP stops adding this helpful line. The utility is a bash script that uses formail (suggested by dirkt in his answer). It isn't fast because it creates temp files for every mail it processes but it works fine.
#!/bin/bash
# Reads email from stdin and prints it to stdout with a twist:
# If it finds a line like " for <[email protected]>" in the envelope
# it will assume it refers to the receipient and will add a "Delivered-To"
# envelope line that will make getmail happy. -- Nick Demou 2018
# bash options for safety in case of errors
set -euf -o pipefail
# read stdin to temp file
cat - > /tmp/deliver.to.$$
logger -p mail.info "getmail, filtering via temp file /tmp/deliver.to.$$"
formail -X "" < /tmp/deliver.to.$$ > /tmp/deliver.to.$$.env
# logger -p mail.info "getmail, extracted envelope/headers to /tmp/deliver.to.$$.env"
ID=`grep 'SMTP id ' /tmp/deliver.to.$$.env 2>/dev/null| head -1|sed -e 's/^ *//'` || ID=UNKNOWN
# logger -p mail.info "getmail, extracted ID $ID"
ADDR=`grep '^ *for <.*@domain\.com>' /tmp/deliver.to.$$.env 2>/dev/null|head -1|sed -e 's/^.*<\([^>]*\)>.*$/\1/'` || ADDR=UNKNOWN
# logger -p mail.info "getmail, extracted delivery address $ADDR"
if echo $ADDR | grep -q '^[^@]*@domain.com *$' ; then
cat /tmp/deliver.to.$$ | formail -A "Delivered-To: $ADDR"
else
cat /tmp/deliver.to.$$
fi
logger -p mail.info "getmail filtered mail for $ADDR, $ID"
rm /tmp/deliver.to.$$
rm /tmp/deliver.to.$$.env
My getmailrc contains a filter like this which calls the above script:
[filter-1]
type = Filter_external
path = /opt/envelope-add-delivered-to.sh
| What utility can add a delivered_to line to an email based on To: and Cc:? |
1,391,814,340,000 |
Often times when there's an email address on a website, it is not just plaintext, but a link (hyperlink?). However, instead of containing an address such as https://unix.stackexchange.com it contains mailto:[email protected]
which - upon a click - opens a browser "page not found". This seems very useless, however a quick search on the Unix StackExchange suggested that the phrase MAILTO: has some function/meaning on Unix/Linux systems (and maybe on others).
Many questions also refer to "cron". While I understand the primary function of "cron" jobs (automatic actions being done at certain times/periods) I have trouble to connect it with the mailto: hyperlinks.
So what is the function of these hyperlinks and is it in any way connected to "cron" jobs - if so, how is it supposed to work?
|
They are a URI for an e-mail address that the browser can use to invoke an e-mail application in order to send e-mail to the given address. The browser should provide a configuration option to set the application used.
cron uses the unrelated MAILTO variable (i.e. MAILTO=...) in its configuration to know where to send e-mail with output from the commands it runs rather than sending it all to root.
| What is the function of "mailto:[email protected]" |
1,391,814,340,000 |
I have to email an HTML file in the body of an email from a UNIX machine. Let us call the HTML file as hello.html
I am using the following code in bash script,
(
echo "To: [email protected]"
echo "Subject: Report"
echo "Content-Type: text/html"
echo
cat hello.html
echo
) | /usr/sbin/sendmail -t
The above code works perfectly fine for me. Now I also want to attach a zip file to this email. Is there any way to do that?
I am limited to using only mail, mailx and /usr/sbin/sendmail.
|
I suggest you send yourself an actual email with zip file attachment and look at the raw contents.
What you'll find is that the email will be formatted per the MIME standard which specifies how to include various file formats in a textual email.
In your case the top-level Content-type will be something like multipart/alternative or multipart/mixed. Within that will be two or more parts or sections with their own Content-type. One will have type application/zip. The application/zip section will have a text encoding (e.g. Base 64) of the zip file.
Here's a sample:
From: John Doe <[email protected]>
MIME-Version: 1.0
Content-Type: multipart/mixed;
boundary="XXXXboundary text"
This is a multipart message in MIME format.
--XXXXboundary text
Content-Type: text/plain
this is the body text
--XXXXboundary text
Content-Type: text/html
<html>
...Body of email in HTML format...
</html>
--XXXXboundary text
Content-Type: application/zip;
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="test.zip"
BASE64 ENCODING TEXT HERE
--XXXXboundary text--
Some more information: Email File Attachments Using MIME
Back to the root of your question, how to do this? I'm not familiar with any standalone tools that help construct an email like this but I'd be surprised if you couldn't find something useful. Perhaps one of the email clients supports command-line/bulk operations. But if worse comes to worst, it's all just ASCII text so you can easily construct it manually along the lines of what you're doing with your HTML email. But I suggest you build the message in a temporary file before piping it to your mail agent. (Look into "here documents" for easy saving of large amounts of text.)
And as indicated, you will need to convert your zip file to Base 64. Just about every Linux installation should have the base64 utility or equivalent. Just pass your zip to it and append to your email file at the appropriate time...
base64 test.zip >> my-email-file.txt
| How to add an attachment to a HTML email in UNIX? |
1,391,814,340,000 |
I'm developing an email client and need a IMAP server without ssl to test with.
I have a bare Ubuntu 16.04 install with DigitalOceans I would like to setup as a simple imap server. It doesn't need to be able to accually send emails, I just need to be able to connect to it using the imap protocal.
What's the bare minimum configuration required?
|
dovecot should work more or less out of the box. You may need to enable plaintext auth on insecure connections. Uncomment the disable_plaintext_auth line and change yes to no
disable_plaintext_auth = no
Install the package with the command sudo apt-get install dovecot-imapd.
| Simplest IMAP configuration without SSL |
1,391,814,340,000 |
in my mail today ( I checked it today, the messages started 5 days ago)
I got messages from popcon the package popularity contest which says:
...
A message that you sent could not be delivered to one or more of its
recipients. This is a permanent error. The following address(es) failed:
[email protected]
Mailing to remote domains not supported
...
does anyone else get that? as in, is the email address not working?
is the popcon package borked?
I am in Debian Jessie, on my personal laptop where I installed Jessie before it was a stable release. In case any of that might be a factor.
|
The error is pretty much self-explanatory. You need to configure your mailserver to be able to send mail outside your local domain.
| popcon failed is the mailto address busted? |
1,391,814,340,000 |
Do we need to configure postfix to use Google Apps gmail account or adding the correct MX records is sufficient.
I'm trying to use Google Apps gmail account for my domain. Hosted on CentOS 6 VPS. I have 12 emails in total. One of which is for mailing list subscription using mailchimp (sending newletter).
Out of the remaining emails, one I wish to set for auto reply.
Remaining 10 are to be used with Google Apps gmail account.
So far, I was able to verify my domain with google. I've added MX records correctly as per Google's recommendations.
I am receiving bounce mail if I try to send email to that account stating that server gave a 550 5.1.1
Do I need to configure postfix for this? If yes, is there any guide or reference for this?
|
if you want all your emails to be handled by gmail, you should not need to configure an SMTP-server on your side (whether this is postfix, exim or whatever).
the SMTP-error you get (550) indicates that the gmail-mailservers do not recognize the recipient address as being one of theirs. so i would double check whether you really have "verifed my domain with google" (not clear what you mean by this).
finally, here's a suggested migration path that should minimize loss of email:
make sure all is working fine on your side (MX points to your smtp-server, and it accepts all the mails you want)
negotiate with googlemail that they accept your domain & email-addresses
test whether gmail actually accepts your email. personally i would manually do an SMTP connection to a gmail server, something like the simple telnet session at below
once gmail accepts emails for your domain, change the MX record to point to gmail. not before.
here is a telnet-session to verify an email address with google (it tries verifying [email protected] and fails).
$ dig mx gmail.com
> [...]
> gmail.com. 705 IN MX 10 alt1.gmail-smtp-in.l.google.com.
> [...]
$ telnet alt1.gmail-smtp-in.l.google.com 25
> [...]
> 220 mx.google.com ESMTP i8si336733lam.57 - gsmtp
HELO world
> 250 mx.google.com at your service
MAIL FROM: <>
> 250 2.1.0 OK i8si336733lam.57 - gsmtp
> RCPT TO: <[email protected]>
> 550-5.1.1 The email account that you tried to reach does not exist. Please try
QUIT
$
(lines starting with $ are what you have to type in the shell, lines starting with > are responses (either from some command like dig or from the remote server) and the other lines are commands you have to type in the SMTP-dialog.)
| Do we need to configure postfix for using Google Apps gmail? |
1,391,814,340,000 |
I am succeeding rewriting my subject line to have a [LIST] prepended to it:
:0fhw
* ^TO_[^<>@ ]+@example\.com\>
* ^Subject:\/.+
| /usr/local/bin/formail -I"Subject: [LIST]$MATCH"
This succeeds and turns:
Subject: here is the subject line
into
Subject: [LIST] here is the subject line
ButeI also want to insert the user portion of [email protected] into the subject line, like this:
Subject: [LIST] [email protected] here is the subject line
... and I don't understand how to do this when I only get one $MATCH variable!
How can I insert two different variables into the single formail line that rewrites the subject line?
|
Conceptually, the answer is simple: Copy $MATCH to another variable. The implementation will still be a bit scruffy because indeed you only get one MATCH per recipe. The workaround is to use nested recipes.
:0
* ^Subject:\/.+
{
subj=$MATCH
:0
* ^TO_\/[^<>@ ]+@example\.com\>
{
user=$MATCH
:0fhw
* user ?? ()\/.+@example\.com
| formail -I"Subject: [LIST] $MATCH $subj"
}
}
The innermost recipe is to trim off the \> match from the end of the captured user variable; if including it in the Subject: line is acceptable, this can obviously be simplified.
Probably take care to include /usr/local/bin in your PATH so you don't have to hardcode the full path to formail. Hardcoding it also makes it impossible to override it for debugging purposes.
| In procmail, how can I manipulate a subject line with two MATCH variables? |
1,391,814,340,000 |
Let me open by saying I have scoured the internet, even companies I purchased the software from and it's been 5 months!! So I am turning to the community as my eyes and brain are bleeding from reading and trying this long getting no where. In short, can this be done, YES. Apparently I am too stupid to do it, however at least I have a huge knowledge of iptables now :-)
My requirement: I use protonmail for my email. If you didn't know, it's so secure, that you have to run a "bridge software" running on each machine that needs to send/receive email. I simply want to send emails from myself, to myself, for my smart home, cameras, alerts, etc etc. As you can imagine I can not install this software on 20 devices let alone cameras!!! So I need a single linux server running this software to act as the email "hub"
My network is 192.168.10.0/24 no vlans, no complications (pfsense as my router/firewall)
I am using mxlinux / debian as my "email host" 192.168.10.106 IMAP is listening on port 1143 SMTP is listening on port 1025
All I wanted to do was make it so that ANY device on my network can use 192.168.10.106 to send emails using SMTP on port 1025. Thought this would be easy..but noooooooooooooooooooo simply because the damn software will ONLY listen on 127.0.0.1 !!! I can not change it to something like 0.0.0.0 etc.
First you should know I contacted protonmail directly as it's a paid email service they actually have techs that know what they are doing and talk with you. However, they feel it's a "security risk" to allow their service to listen on 0.0.0.0 so the code will not allow this to be changed. I did the below on the "email server / 192.168.10.106"
Edited /etc/sysctl.conf and uncommented the # in front of net.ipv4.ip_forward=1
Updated iptables
sudo iptables -t nat -A PREROUTING -i eth0 -p tcp -s 192.168.10.0/24 --dport 1025 -j DNAT --to-destination 127.0.0.1:1025
sudo iptables -t nat -A POSTROUTING -o lo -p tcp --dport 1025 -j SNAT --to-source 192.168.10.106
sudo iptables -A FORWARD -i eth0 -o lo -p tcp --dport 1025 -j ACCEPT
Make my entries save on reboot and it's going to ask me if I want to save my above tables, I need to say yes, so I will:
sudo apt install iptables-persistent
Go into MX "firewall configuration" and turn off "public, private and office", basically turn off the firewall
Reboot the computer
OK now listing out after a reboot it looks like this. I tried from a windows computer on my network 192.168.10.50 to telnet and as you can see I am seeing packets but it's not working :-( :-( :-( :-( :-( :-( :-( :-( :-( :-( :-(
sudo iptables -t nat -L -n -v
Chain PREROUTING (policy ACCEPT 15748 packets, 1719K bytes)
pkts bytes target prot opt in out source destination
5 260 DNAT tcp -- eth0 * 192.168.10.0/24 0.0.0.0/0 tcp dpt:1025 to:127.0.0.1:1025
Chain INPUT (policy ACCEPT 15748 packets, 1719K bytes)
pkts bytes target prot opt in out source destination
Chain OUTPUT (policy ACCEPT 730 packets, 73256 bytes)
pkts bytes target prot opt in out source destination
Chain POSTROUTING (policy ACCEPT 730 packets, 73256 bytes)
pkts bytes target prot opt in out source destination
0 0 SNAT tcp -- * lo 0.0.0.0/0 0.0.0.0/0 tcp dpt:1025 to:192.168.10.106
This is me testing the service on the local host email computer
$ telnet 127.0.0.1 1025
Trying 127.0.0.1... Connected to 127.0.0.1.
Escape character is '^]'.
220 127.0.0.1 ESMTP Service Ready
Notice the dropped packets in eth0 received side
$ uname -a
Linux email 5.10.0-23-amd64 #1 SMP Debian 5.10.179-2 (2023-07-14) x86_64 GNU/Linux
bob@email:~ $ ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.10.106 netmask 255.255.255.0 broadcast 192.168.10.255
ether 00:0c:29:63:d5:4f txqueuelen 1000 (Ethernet)
RX packets 126620 bytes 24077186 (22.9 MiB)
RX errors 0 dropped 6447 overruns 0 frame 0
TX packets 30080 bytes 3728557 (3.5 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
loop txqueuelen 1000 (Local Loopback)
RX packets 57 bytes 4931 (4.8 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 57 bytes 4931 (4.8 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
None of the above worked so I tried different variations. I also found a command I was suggested to use that did not seem to help but tried it anyway.
sysctl -w net.ipv4.conf.eth0.route_localnet=1
|
An alternative approach is to use an application forwarder. No iptables or kernel level forwarding is required. In this example I've used socat, but other possibilities may exist. Here the set of permitted source IP addresses is defined as an application argument.
socat TCP-LISTEN:1025,fork,range=192.168.10.0/24,reuseaddr,bind=192.168.10.106 TCP4:127.0.0.1:1025
Here, we've two sets of arguments:
Listening address
LISTEN:1025 - Listen on this port
fork - Fork a subprocess to handle each inbound request
range=192.168.10.0/24 - Accept requests from devices in this network range
reuseaddr - Allow rapid reuse of address/port tuples
bind=192.168.10.106 - Listen on this address (your eth0)
Forwarding/relay address
TCP4:127.0.0.1:1025 - Relay to this address:port
| Service only listens on 127.0.0.1 port 1025. How do you allow any computer on your local network to communicate with this service? |
1,391,814,340,000 |
I am trying to add an extra header item to an existing email in a particular mbox, e.g.
X-archived-to-crm: true,user,CRM-ID
after it was archived, the CRM-ID is basically the id in the DB of the CRM.
My MTA is sendmail, not sure whether this matters.
I had a look mail, mailx but cannot figure out how to do it.
I have been able to do this using Mutt in interactive mode, so there must be a way to do this from the command line.
Any (commandline) utility will do, it just needs to work non interactively.
|
This can be done fairly easily with perl -i as an mbox file is just plain text. There are various mbox manipulation library modules for perl, but something as simple as this doesn't need them.
The biggest difficulty is avoiding writing to the mbox file while something else is writing to it at the same time.
The script below uses the standard dotlock method of avoiding multiple simultaneous writers to the same mbox file (i.e. use mboxfilename.lock).
It should probably do flock and fcntl locking in addition to dotlock, to match whichever locking method(s) are used by your Mail Delivery Agent (MDA) and other programs that may be writing the mbox (e.g. mutt or other Mail User Agents (MUAs), or a Mail Transfer Agent (MTA) like postfix or sendmail, or a POP or IMAP daemon).
I'll leave that as an exercise for the reader - see the File::FcntlLock and File::Flock perl library modules (there are also several similar modules with differing implementations of the same things, these are just the first I found). You can install these on Debian (etc) with apt-get install libfile-flock-perl libfile-fcntllock-perl. Other distros probably have them or similar modules packaged. Otherwise, install with cpan.
#!/usr/bin/perl -i.bak
#!/usr/bin/perl -i
# delete the first #! line if you don't want perl -i to create a .bak copy
use strict;
use Getopt::Std;
my %opts;
getopts('m:i:u:h', \%opts);
if ($opts{h}) {
print "$0 <-m messsage-id> <-u user> <-i crmid> [mbox file...]\n";
exit 1;
};
my $msgid = $opts{m} // die "-m messsage-id is required\n";
my $user = $opts{u} // die "-u user is required\n";
my $crmid = $opts{i} // die "-i crmid is required\n";
# I don't want to implement my own -i, so I'll just iterate
# over each file on @ARGV one at a time
my @files = @ARGV;
foreach my $mbox (@files) {
# if the mbox is locked, then wait until it isn't.
while (-e "$mbox.lock") {
print "$mbox is locked!\n";
sleep 1;
};
# lock it
open(my $touch, ">", "$mbox.lock") || die "couldn't lock $mbox: $!\n";
close($touch);
@ARGV=($mbox);
while (<>) {
print;
# case-insensitive match for "Message-ID" literal string,
# case-sensitive for actual $msgid
if (m/^(?:(?i)Message-ID:) <$msgid>/) {
print "X-archived-to-crm: true,$user,$crmid\n"
};
};
# remove the lock
unlink "$mbox.lock";
}
Given the following mbox file:
From [email protected] Mon Aug 23 16:04:42 2021
Return-Path: <[email protected]>
X-Original-To: [email protected]
Delivered-To: [email protected]
Received: by example.org (Postfix, from userid 1000)
id 6B1DE3F2C; Mon, 23 Aug 2021 16:04:42 +1000 (AEST)
Date: Mon, 23 Aug 2021 16:04:42 +1000
From: Craig Sanders <[email protected]>
To: Craig Sanders <[email protected]>
Subject: test
Message-ID: <[email protected]>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Length: 56
Lines: 6
test messsage
craig
--
craig sanders <[email protected]>
Running the following command:
$ ./insert-header.pl -m '[email protected]' -i 99999 -u cas test.mbox
Results in the mbox file being changed to:
From [email protected] Mon Aug 23 16:04:42 2021
Return-Path: <[email protected]>
X-Original-To: [email protected]
Delivered-To: [email protected]
Received: by example.org (Postfix, from userid 1000)
id 6B1DE3F2C; Mon, 23 Aug 2021 16:04:42 +1000 (AEST)
Date: Mon, 23 Aug 2021 16:04:42 +1000
From: Craig Sanders <[email protected]>
To: Craig Sanders <[email protected]>
Subject: test
Message-ID: <[email protected]>
X-archived-to-crm: true,cas,99999
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Length: 56
Lines: 6
test messsage
craig
--
craig sanders <[email protected]>
BTW, I also test this on a copy of my main mbox with:
$ ./insert-header.pl -m '.*' -i 99999 -u cas main.mbox
And it inserted the same X-archived-to-crm header in every message in the mbox.
| Any utility in Linux to add item to the header of an existing email in a particular mailbox? |
1,391,814,340,000 |
I've been trying to set up a mail server, with dovecot, postfix, opendkim, and spamassassin. After some hassle I managed to get incoming mail working (I signed up for this account with the email!). However, outgoing mail just doesn't work--I tested this by sending from this new email to my old Protonmail account and got an error. Again, it works with incoming mail--sending from that old email to my new one. Sending was tested with Neomutt using msmtp as its mail sending command.
I've got a relayhost that goes to port 587 of my domain. This is because my ISP is fat and blocks port 25 for some reason. Anyways, here's the log messages I get when sending an email:
postfix/submission/smtpd[57255]: NOQUEUE: reject: RCPT from unknown[192.168.86.1]: 454 4.7.1 <[email protected]>: Relay access denied; from=<[email protected]> to=<[email protected]> proto=ESMTP helo=<mail.doma.in>
postfix/smtp[57263]: E45589003B2: to=<[email protected]>, relay=MY.IP[MY.IP]:587, delay=0.2, delays=0.14/0.02/0.02/0.02, dsn=4.7.1, status=deferred (host MY.IP[MY.IP] said: 454 4.7.1 <[email protected]>: Relay access denied (in reply to RCPT TO command))
postfix/submission/smtpd[57255]: disconnect from unknown[192.168.86.1] ehlo=2 starttls=1 mail=1 rcpt=0/1 data=0/1 rset=1 quit=1 commands=6/8
postconf -n:
alias_database = $alias_maps
alias_maps = hash:/etc/postfix/aliases
command_directory = /usr/bin
compatibility_level = 3.6
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
home_mailbox = Mail/Inbox/
html_directory = no
inet_protocols = ipv4
mail_owner = postfix
mailbox_command = /usr/lib/dovecot/deliver
mailq_path = /usr/bin/mailq
manpage_directory = /usr/share/man
meta_directory = /etc/postfix
milter_default_action = accept
milter_protocol = 6
mydestination = $myhostname, $mydomain, localhost, localhost.localdomain, 127.0.0.1, MY.IP
mydomain = doma.in
myhostname = mail.doma.in
mynetworks = , 127.0.0.0/8 [::1]/128 MY.IP/32 MY.PRIVATE.IP MY.IP
newaliases_path = /usr/bin/newaliases
non_smtpd_milters = inet:127.0.0.1:12301
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix
relay_domains = $mydestination
relayhost = [MY.IP]:587
sample_directory = /etc/postfix
sendmail_path = /usr/bin/sendmail
setgid_group = postdrop
shlib_directory = /usr/lib/postfix
smtp_tls_CAfile = /etc/letsencrypt/live/doma.in/cert.pem
smtp_tls_loglevel = 3
smtp_tls_mandatory_protocols = !SSLv2, !SSLv3, !TLSv1, !TLSv1.1
smtp_tls_protocols = !SSLv2, !SSLv3, !TLSv1, !TLSv1.1
smtp_tls_security_level = may
smtpd_milters = inet:127.0.0.1:12301
smtpd_recipient_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_path = private/auth
smtpd_sasl_security_options =
smtpd_sasl_tls_security_options =
smtpd_sasl_type = dovecot
smtpd_tls_auth_only = yes
smtpd_tls_cert_file = /etc/letsencrypt/live/doma.in/fullchain.pem
smtpd_tls_exclude_ciphers = aNULL, LOW, EXP, MEDIUM, ADH, AECDH, MD5, DSS, ECDSA, CAMELLIA128, 3DES, CAMELLIA256, RSA+AES, eNULL
smtpd_tls_key_file = /etc/letsencrypt/live/doma.in/privkey.pem
smtpd_tls_mandatory_protocols = !SSLv2, !SSLv3, !TLSv1, !TLSv1.1
smtpd_tls_protocols = !SSLv2, !SSLv3, !TLSv1, !TLSv1.1
smtpd_tls_security_level = may
tls_preempt_cipherlist = yes
unknown_local_recipient_reject_code = 550
it's listening on port 587:
# lsof -i -P -n|grep 587
...
master 57239 root 94u IPv4 970320 0t0 TCP *:587 (LISTEN)
smtpd 57364 postfix 6u IPv4 970320 0t0 TCP *:587 (LISTEN)
smtpd 57367 postfix 6u IPv4 970320 0t0 TCP *:587 (LISTEN)
smtpd 57371 postfix 6u IPv4 970320 0t0 TCP *:587 (LISTEN)
smtpd 57374 postfix 6u IPv4 970320 0t0 TCP *:587 (LISTEN)
why am I getting this error? I've gone through several other questions where this was asked, notably:
https://serverfault.com/questions/42519/how-to-correct-postfix-relay-access-denied
https://serverfault.com/questions/711588/postfix-relay-access-denied-how-to-fix-it
Relay access denied when using SMTP to external recipients POSTFIX FREEBSD
None of those helped, though
|
I finally fixed this by adding 192.168.86.0/24 to mynetworks. I've got another problem but I'll open up a new question for that.
| Postfix: "Relay access denied" |
1,391,814,340,000 |
Here is my scenario.
I have a txt file. emailADD.txt.
it contains email ids every line
[email protected]
[email protected]
[email protected]
And i have files in a folder
abc.pdf
def.pdf
hij.pdf
and so on
i want a script to send email to the first id with the first attachment. then another email to second id with the second attachment and so on.
both email ids and the attachments will be stored in alphabetical order. the number of email ids and attachments stored will be equal.
Please suggest.
I have this idea from jesse_b but it doesn't involve different attachments to each email id.
#!/bin/bash
file=/location/of/emailAdd.txt
while
read -r email;
do
#printf '%s\n' 'Hello, world!' | sudo mail -s 'This is the email subject' "$email"
done < "$file"
|
I think it would be easier to start from looping through attachments and
extract recipient along the way since shell will expand glob in an
alphabetical order. Your script could look like this:
#!/usr/bin/env sh
line=1
for i in *.pdf
do
echo "$i"
recipient="$(awk -v line="$line" 'NR==line' emailADD.txt)"
if [ -n "$recipient" ]
then
printf "recipient: %s\n" "$recipient"
line=$((line+1))
printf '%s\n' 'Hello, world!' | echo mail -s 'This is the email subject' -a "$i" "$recipient"
fi
done
Remove echo to actually run mail command but run it first with it
to make sure that it will do what you need.
| How to send emails to multiple recipients with each getting a different attachment using mail command from terminal? |
1,391,814,340,000 |
When I'm attaching a file with Russian name, the recipient received the attachment with name noname. I added set rfc2047_parameters = yes to .muttrc, and it started to work for simple filenames like Решение.doc and тест тест.txt. But when I attach a file with a long filename: Электронный документ, полученный из внешней системы.pdf, which is still valid and can be attached though Gmail web interface, it still gives noname as the file name when sent from mutt.
Is it possible to fix?
Update: locale result:
$ locale
LANG=en_US
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=en_US.UTF-8
|
I believe that this is a known bug in older releases of mutt and that it was fixed in May 2019 with commit 6898c083. This means that the fix ought to have been included in release 1.12.1.
I'm unable to reproduce your issue with release 2.0.3 (the current release at the time of writing), so I'm assuming that the fix is still in effect.
The issue was that mutt truncated the filenames of attachments that had long names. The truncation was not done correctly for multi-byte character strings and left the last character of the filename encoded erroneously. When a user's email client noticed that the encoding of the attachment filename was incorrect, it replaced the name with the string noname.
After release 1.12.1, you ought to be able to use filenames of up to 255 characters.
| mutt attachment with long non-ASCII file name is set to "noname" |
1,391,814,340,000 |
I am using systemd to autolaunch a service with the following script: (see below)
I am trying to send an email before the service is started (the commented out line).
the link at the end of the line /home/vincent/wintergreen/service_files/IB_restart_email is the content of the email, as described here in paragraph 7.
Unit]
Description=Manages an instance of IBController
[Service]
Type=forking
User=vincent
Group=vincent
ExecStart=/bin/bash -c "cd /opt/IBController && bash IBControllerStart.sh -inline && sleep 10"
# ExecStartPre=/usr/bin/mail -s "Restarting TWS" [email protected] < /home/vincent/wintergreen/service_files/IB_restart_email
Environment=DISPLAY=:0.0
KillMode=control-group
TimeoutSec=0
Restart=always
[Install]
WantedBy=graphical.target
However, this line returns the error mail: Cannot parse address <' (while expanding <'): Malformed email address. (i can see the error message when opening the journalctl)
This command works when used directly in the shell. Anyone has an idea how to make this mail sending line work when used from the systemd file?
PS: I am using postfix for the mail sending
|
As documented in man systemd.service, systemd has a limited support for shell syntax, which does not include "<". So, the character is set to the "mail" command, resulting in this error.
I presume you are most interested in emails due to automatic restarts, which wold be due to service crashes.
For that, the OnFailure= directive is a better choice. Use it to provide a spaces-separated list of units that are activated when the unit enters the failed state.
There are already ready-made solutions to handle this, like this one which will email you the "status" output (including some log output) of the service when it fails.
Also, consider using the WorkingDirectory= directive instead of manually calling "cd" in ExecStart=.
It also not clear why "sleep 10" would be needed as part of starting the app.
| systemd, send an email after restart |
1,391,814,340,000 |
Is there any way to send a custom e-mail to custom recipients if any user tries to login or login to my system (RHEL6.7) ??
|
There are multiple ways to achieve what you are looking for. I will list out two ways to do it.
logwatch, a log-monitoring system that can send emails reporting any ssh activity.
sudo yum install logwatch
sudo cp /usr/share/logwatch/default.conf/logwatch.conf /etc/logwatch/conf/logwatch.conf
sudo logwatch --service sshd --range today --mailto <custom email IDs of recipients comma separated> --detail low
A custom shell script in the /etc/profile.d folder. Normally, this script will be executed each time any user logs in the system.
You may copy the following script into /etc/profile.d/name_of_the_alerts_file.sh file. It will send an email with the text produced by the echo. The whoami will be replaced by the current user and the hostname by the server's name.
#!/bin/bash
echo -e "
########################################################
# This is an alert you requested for
# User `whoami` logged into `hostname` at `date`
#
#
########################################################
" | mailx -r login-alerts -s "Login-Alert on `hostname`" <recipient 1>,<recipient 2>
The second method is useful if you want to customize the message being sent in the emails.
| Send mail on login for a host |
1,391,814,340,000 |
Trying to design a system that can filter incoming email messages from a syslog server. Need to drop if they appear to be duplicates (throttle them). Procmail pipes them to a perl script for processing. That's all working, except if I get a flurry of emails all at once, postfix seems to spawn multiple instances of the piped script. Obviously this is desirable in most cases, but for this project, I have to be able to process the incoming messages one at a time so that a database field can be updated with a timestamp so that subsequent messages that match a criteria can be dropped instead of forwarded to the recipients. **Is there a way to "queue" these incoming messages to be processed one at a time, instead of in parallel? Thanks.
|
You may use procmail's locking to make multiple instances execute one instance of the perl script at given time. See man procmailrc and man procmailex
:0 w: script.lock
| /.../script.pl
O course there are other ways but How many messages per hour do you expect to process in peak and average hour?
| postfix + procmail -- process serially, not in parallel |
1,391,814,340,000 |
As part of smooth functioning on my application I want to check a count of a particular process and send a email to multiple people if it exceeds certain limit.I have written script for counting process but I dont know for the email part.
Code for processes count
#!/bin/sh
NOP=`ps -ef | grep -I nagios.cfg | grep -v grep |wc -l`
if [ $NOP -gt 2 ]
then
(
echo "More parent processes are running on the server"
)
fi
|
mail command is pretty simple:
echo "More parent processes are running on the server" | mail -s "subject" [email protected] [email protected]
And your script can be optimized to one line:
[ "$(pgrep -c nagios.cfg)" -gt 2 ] && echo "More parent processes are running on the server" | mail -s "subject" [email protected] [email protected]
| Count the number of processes and send a email to multiple people if it exceeds certain limit |
1,391,814,340,000 |
I am planning to use my enterprise email address ( I am working at a company) as a medium for commands. And I want this to work on a linux box, I need by email to be registered there so that if an email comes it will be registered.
Example:
I will send an email with a subject: getsummary
then at a linux box(linux os) received an email with that subject, I want it to execute a perl script I made to send a summary back to the requestor.
|
I'd split you task into two steps: getting emails and parsing emails, because second step depends of first one, if you cannot get emails then you have nothing to parse.
First step depends of MX records and ways you can access MX server. Since you have stated that email is enterprise, I assume that you cannot just change the MX records. I drew related flowchart.
| How to set a linux box to receive emails using my email address [closed] |
1,469,693,791,000 |
I have postfix running in a Docker container.
A cronjob try to send email, but reply
“(CRON) info (No MTA installed, discarding output)” error in the syslog
According to this link, the solution is to install postfix so CRON can send email.
I have postfix running on this Host, is there a way to use it ?
I have some other hosts and postfix isn't running on them, can I also tell them to use the distant docker mail server?
|
The problem is not that postfix is not running but that it should be listening on a mapped port 25 or 587 on the host. Even if that is the case, with not installing postfix on the host, there is probably no installed that sends the mail (gotten from stdin or commandline parameters) to the port.
You install the client programs sSMTP or msmtp for that, but I have solved this within a small wrapper program for my crontab entries that I was using anyway. The wrapper only sends mail if the program (the "real" crontab etnry it called) exits with non-zero exit value or its output contains the string "error:". That reduces the span from my own systems i.e. no email if the program ran fine. The program uses the Python standard library smtp module to send the caught output.
The wrapper runs the program with subprocess.check_output(cmd, stderr=subprocess.STDOUT), and sends the result on error using:
smtp = smtplib.SMTP(host="", port=0) # by default 'localhost' and 25
smtp.connect()
smtp.sendmail(
from_email, to_email_list,
email_header_and_body
)
By setting the host and port I also use this to run jobs from other docker containers.
| Tell guest OS to use my dockerized mail server to send email |
1,469,693,791,000 |
I am writing a program that will be sending external emails using postfix with the mail -s command and I need to verify that the email was sent to the specified address.
In which case, I am curious if postfix right away reports an error that I am able to get as a return code if email failed sending or if postfix will say it was a success as long as a valid email ([email protected]) was entered and then later report in a log file or such that the email was unable to be sent?
Also if the network is down, will postfix still return success as long as a valid email address is used, or will a failure be reported right away?
|
If your postfix configuration is set for logs you can check the logs for the status of a message.
It will contain information such as:
Mar 25 16:07:40 serverName postfix/smtp[3113]: B169ZZZ24F: host foo.net.mx1.name.foo.net[1.2.3.4] refused to talk to me: 421 Offline: HELO/FDNS
Mar 25 16:07:40 serverName postfix/smtp[3036]: 7ZZZFC2440: to=<[email protected]>, relay=mtaz.amz.yahoodns.net[66.196.118.35]:25, delay=11, delays=0.35/0/0.6/9.9, dsn=2.0.0, status=sent (250 ok dirdel)
Mar 25 16:07:36 serverName postfix/smtp[3073]: ZZZZ3C623E: to=<[email protected]>, relay=none, delay=0.55, delays=0.35/0/0.2/0, dsn=5.4.4, status=bounced (Host or domain name not found. Name service error for name=customer.com type=A: Host not found)
This info can be retrieved via a script with lines like: (Not my work. Thanks to whom ever, this is used everyday.)
grep 'status=sent' /var/log/mail.log | awk '{print $7}' | sed 's/to=<//g' | sed 's/>,//g'
grep 'status=deferred' /var/log/mail.log | awk '{print $7}' | sed 's/to=<//g' | sed 's/>,//g'
grep 'status=bounced' /var/log/mail.log | awk '{print $7}' | sed 's/to=<//g' | sed 's/>,//g'
| Does postfix using mail command report if an email was unable to be sent to an address? |
1,469,693,791,000 |
It seems that all emails I receive never make it to my actual inbox. They go to the root email. (in my case this is [email protected])
Here is my /var/log/maillog:
Nov 10 19:43:43 mail postfix/submission/smtpd[12945]: warning: dict_nis_init: NIS domain name not set - NIS lookups disabled
Nov 10 19:43:43 mail postfix/submission/smtpd[12945]: warning: cannot get RSA certificate from file /etc/ssl/certs/ssl-mail.pem: disabling TLS support
Nov 10 19:43:43 mail postfix/submission/smtpd[12945]: warning: TLS library problem: 12945:error:02001002:system library:fopen:No such file or directory:bss_file.c:398:fopen('/etc/ssl/certs/ssl-mail.pem','r'):
Nov 10 19:43:43 mail postfix/submission/smtpd[12945]: warning: TLS library problem: 12945:error:20074002:BIO routines:FILE_CTRL:system lib:bss_file.c:400:
Nov 10 19:43:43 mail postfix/submission/smtpd[12945]: warning: TLS library problem: 12945:error:140DC002:SSL routines:SSL_CTX_use_certificate_chain_file:system lib:ssl_rsa.c:722:
Nov 10 19:43:43 mail postfix/submission/smtpd[12945]: connect from mail-qg0-f49.google.com[209.85.192.49]
Nov 10 19:43:43 mail postfix/submission/smtpd[12945]: lost connection after STARTTLS from mail-qg0-f49.google.com[209.85.192.49]
Nov 10 19:43:43 mail postfix/cleanup[12950]: 37B923FD30: message-id=<[email protected]>
Nov 10 19:43:43 mail postfix/qmgr[12940]: 37B923FD30: from=<[email protected]>, size=901, nrcpt=1 (queue active)
Nov 10 19:43:43 mail postfix/submission/smtpd[12945]: disconnect from mail-qg0-f49.google.com[209.85.192.49]
Nov 10 19:43:43 mail postfix/trivial-rewrite[12951]: warning: do not list domain example.com in BOTH mydestination and virtual_alias_domains
Nov 10 19:43:43 mail postfix/local[12952]: warning: dict_nis_init: NIS domain name not set - NIS lookups disabled
Nov 10 19:43:43 mail postfix/trivial-rewrite[12951]: warning: do not list domain example.com in BOTH mydestination and virtual_alias_domains
Nov 10 19:43:43 mail postfix/local[12952]: 37B923FD30: to=<[email protected]>, orig_to=<postmaster>, relay=local, delay=0.04, delays=0.02/0.01/0/0.01, dsn=2.0.0, status=sent (delivered to maildir)
Nov 10 19:43:43 mail postfix/qmgr[12940]: 37B923FD30: removed
Here is my /etc/postfix/main.cf:
virtual_alias_maps = hash:/etc/postfix/virtual
virtual_alias_domains = hash:/etc/postfix/mydomains
queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
mail_owner = postfix
inet_interfaces = all
# inet_interfaces = localhost
# mydestination = $myhostname, example.com, localhost
unknown_local_recipient_reject_code = 550
alias_database = hash:/etc/aliases
sendmail_path = /usr/sbin/sendmail.postfix
newaliases_path = /usr/bin/newaliases.postfix
mailq_path = /usr/bin/mailq.postfix
setgid_group = postdrop
html_directory = no
manpage_directory = /usr/share/man
sample_directory = /usr/share/doc/postfix-2.10.1/samples
readme_directory = /usr/share/doc/postfix-2.10.1/README_FILES
myhostname = mail.example.com
# mydestination = $myhostname
#mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
mydestination = mail.example.com, example.com, localhost, localhost.localdomain
# mydestination = localhost $mydomain, localhost
# mydestination = localhost.$mydomain, localhost, mail.example.com
mydomain = example.com
myorigin = $mydomain
home_mailbox = mail/
mynetworks = 127.0.0.0/8
inet_interfaces = all
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
smtpd_sasl_local_domain =
smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients = yes
smtpd_sasl_auth_enable = yes
smtpd_recipient_restrictions = reject_unknown_sender_domain, reject_unknown_recipient_domain, reject_unauth_pipelining, permit_mynetworks, smtpd_client_restrictions, reject_unauth_destination
smtpd_tls_cert_file = /etc/ssl/certs/ssl-mail.pem
smtpd_tls_key_file = /etc/ssl/private/ssl-mail.key
smtpd_use_tls = yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_sasl_auth_enable = yes
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/dovecot-auth
smtpd_sasl_authenticated_header = yes
smtpd_sasl_security_options = noanonymous
smtpd_sasl_local_domain = $myhostname
broken_sasl_auth_clients = yes
smtp_use_tls = yes
smtpd_tls_received_header = yes
smtpd_tls_mandatory_protocols = SSLv3, TLSv1
smtpd_tls_mandatory_ciphers = medium
smtpd_tls_auth_only = yes
tls_random_source = dev:/dev/urandom
smtpd_milters = inet:127.0.0.1:8891
non_smtpd_milters = $smtpd_milters
milter_default_action = accept
milter_protocol = 2
I have nothing setup in my /etc/postfix/virtual file. I'm not sure if that is important at this point.
Here is /etc/aliases:
# Basic system aliases -- these MUST be present.
mailer-daemon: postmaster
postmaster: root
# General redirections for pseudo accounts.
bin: root
daemon: root
adm: root
lp: root
sync: root
shutdown: root
halt: root
mail: root
news: root
uucp: root
operator: root
games: root
gopher: root
ftp: root
nobody: root
radiusd: root
nut: root
dbus: root
vcsa: root
canna: root
wnn: root
rpm: root
nscd: root
pcap: root
apache: root
webalizer: root
dovecot: root
fax: root
quagga: root
radvd: root
pvm: root
amandabackup: root
privoxy: root
ident: root
named: root
xfs: root
gdm: root
mailnull: root
postgres: root
sshd: root
smmsp: root
postfix: root
netdump: root
ldap: root
squid: root
ntp: root
mysql: root
desktop: root
rpcuser: root
rpc: root
nfsnobody: root
ingres: root
system: root
toor: root
manager: root
dumper: root
abuse: root
newsadm: news
newsadmin: news
usenet: news
ftpadm: ftp
ftpadmin: ftp
ftp-adm: ftp
ftp-admin: ftp
www: webmaster
webmaster: root
noc: root
security: root
hostmaster: root
info: postmaster
marketing: postmaster
sales: postmaster
support: postmaster
# trap decode to catch security attacks
decode: root
# Person who should get root's mail
#root: marc
|
See the warning in the error log:
Nov 10 19:43:43 mail postfix/trivial-rewrite[12951]: warning: do not list
domain dougbeney.com in BOTH mydestination and virtual_alias_domains
That means exactly what it says. Don't do that. A domain can be either in mydestination or it can be a virtual domain in virtual_alias_domains. It can't be both.
what's in your milter? is it quarantining the incoming message by delivering it to root?
| Every email that I receive gets sent to [email protected] (Postfix on CentOS) |
1,469,693,791,000 |
I created a script to monitor and have a query as below :-
httpUrl="http://some.website.ashx"
balExp=$(curl -v -X POST -d "UID=test&PWD=2222" $httpUrl)
How do I sent email alert (my email for example) if the query return nothing or times out?
Update:
I've modified the script to run the query
if [ $balExp -eq 0 ]
echo "Success"
else
echo "failed"
fi
I always get failed but the curl command return success (0).
|
Curl exit code for failed HTTP requests
Usually if a requested HTTP resource isn’t available, a web server responds with a HTML document corresponding to the relevant HTTP status code, e.g. 404. In such cases, curl accepts this document from the server and since it was successful in getting a response from the web server, it displays the error document and exits with a status of 0 for success.
You want curl to return an error code if there was a problem retrieving the HTTP resource. For that, you need to provide the -f, --fail option to curl. From the curl man page:
Fail silently (no output at all) on server errors. This is mostly done to better enable scripts etc to better deal with failed attempts. In normal cases when an HTTP server fails to deliver a document, it returns an HTML document stating so (which often also describes why and more). This flag will prevent curl from outputting that and return error 22.
This method is not fail-safe and there are occasions where non-successful response codes will slip through, especially when authentication is involved (response codes 401 and 407).
Note: the above is (mostly) copied from my answer to your similar question about curl.
Sending mail
You can use the mail program to send email. On Debian-based systems, it can
be installed via the mailutils package while on Red Hat-based distributions,
it’s provided by the mailx package.
echo "Body of email" | mail [email protected] -s "Subject line"
If you already use a command line mail client such as mutt you can use:
echo "Body of email" | mutt [email protected] -s "Subject line"
Testing the success of a command
When testing the output of a command you don’t need to use test or [. You can simply use the output of the command as in the following script (which incorporates all the above):
httpUrl="http://some.website.ashx"
if balExp=$(curl -f -v -X POST -d "UID=test&PWD=2222" "$httpUrl"); then
echo "$balExp" | mail [email protected] -s "Successful download of $httpUrl"
else
echo "$balExp" | mail [email protected] -s "Problem downloading $httpUrl"
fi
Note that I've quoted the shell variable, $httpUrl using double-quotes so that the script will work with other URLs which may contain characters that are interpreted by the shell (& being a common one).
Finally, the if statement in your question was missing its corresponding then.
| Send email depending on success of curl command |
1,469,693,791,000 |
(AIX 6.1 ) man page for at says -m option could send an email to the user. But this is the default behavior, even without specifying the -m option. Is there a way to turn this off, I do not want mails sent to the user account. man page has no information. I tried +m but it is not accepted)
|
That is pretty simple and also explained in the man page of the at command
The at command mails you all output from standard output and standard
error for the scheduled commands, unless you redirect that output.
It also writes the job number and the scheduled time to standard
error.
Same as for cron, simply redirect stdout and stderr to some file or to /dev/null if you don't need the output, but then you should be pretty sure what job you're running and how to check the results. Simple example would be something like the following (or whatever at job you want to run) :
echo "errlogger 'at test' &> /dev/null" | at now today
If that does not work with the shell you select, try the classic way
echo "errlogger 'at test' >/dev/null 2>&1" | at now today
Maybe it could be worth a try, testing if the same trick as for cron works for at. That is, try prefixing the at job with MAILTO=""
| How to skip email notification for at command in AIX? |
1,469,693,791,000 |
I'm really not into mail configuration, but somehow I managed to configure exim4 and it does send e-mails. I spent so many hours on it though I even can't count. (And I don't know why it is so complicated, while needs are usually very similar: to have e-mails addresses which should be used to actually send e-mails - and that's almost everything, not taking into account a security subject, which is mostly related to authentication).
When I'm sending e-mail, I have automatically set a FROM field as 'root' (linux user). I'd like to have a custom field (e.g. "Contact me"), and I couln't find on internet any answer how to do this.
Second, some say that using linux users as related to email addresses is not a good thing e.g.:
http://t-machine.org/index.php/2014/06/27/webmail-on-your-debian-server-exim4-dovecot-roundcube/
But the tutorials I found use them. I'm not using data base as in the url above, but I would still prefer to have no linux user related to email - is it something difficult to achieve? How could I do this?
Here's /etc/exim4/update-exim4.conf.conf content:
# /etc/exim4/update-exim4.conf.conf
#
# Edit this file and /etc/mailname by hand and execute update-exim4.conf
# yourself or use 'dpkg-reconfigure exim4-config'
#
# Please note that this is _not_ a dpkg-conffile and that automatic changes
# to this file might happen. The code handling this will honor your local
# changes, so this is usually fine, but will break local schemes that mess
# around with multiple versions of the file.
#
# update-exim4.conf uses this file to determine variable values to generate
# exim configuration macros for the configuration file.
#
# Most settings found in here do have corresponding questions in the
# Debconf configuration, but not all of them.
#
# This is a Debian specific file
dc_eximconfig_configtype='internet'
dc_other_hostnames='url.com; mail.url.com; url; localhost; localhost.localdomain'
dc_local_interfaces='127.0.0.1; my_ip'
dc_readhost=''
dc_relay_domains=''
dc_minimaldns='false'
dc_relay_nets=''
dc_smarthost=''
CFILEMODE='644'
dc_use_split_config='true'
dc_hide_mailname=''
dc_mailname_in_oh='true'
dc_localdelivery='maildir_home'
For any case, I substituted my domain with url and ip with my_ip.
And /etc/email-addresses is very short:
root: [email protected]
|
You need to tell mail the name you'd like to use (its currently looking it up in /etc/passwd, most likely). Of course, you could also change the user full name in /etc/passwd (e.g., via chfn -f 'New Name' user, and you really ought not be sending the mail as root!
For Heirloom mail, you can use either the from environment variable, its mailrc config file, or the -r option. Like one of these:
echo 'This is a test.' | mail -r 'Contact Me <root>' \
-s 'Testing' '[email protected]' # using -r argument
# ... or ...
echo 'This is a test.' | from='Contact Me <root>' mail \
-s 'Testing' '[email protected]' # env var 'email'
For other versions of mail, check their manpages.
| Send emails with a custom From: field |
1,469,693,791,000 |
I need a program that would be running as a daemon, connecting to mail server and reading inbox of a specified e-mail address (provided with password, of course =) ). If certain conditions are met, it'd execute a script - and there could be many different conditions with many different scripts =) Conditions could include: sender address, e-mail topic&text, etc. Is there any program like I've described?
|
Sounds like you're looking for fetchmail in conjunction with procmail. Between the two of them, you should be able to solve all your automated mail-reading needs.
| What program constantly reads e-mails and could execute actions under certain conditions? |
1,469,693,791,000 |
I sent an e-mail which included almost 2500 characters of text and one attached 60KiB PNG file. This text included number 185 eight times. However, after the e-mail was encoded to base64 and sent, I'm able to find only three "MTg1"("MTg1" is "185" in base64 encoding) strings from e-mail source. How to explain this? According to e-mail header, content type is "text/plain; charset=UTF-8" and content transfer encoding is "base64".
|
Base64 encoding turns 6 bytes into 8. There are 3 possible encodings for any given plaintext, shifted by several bits each time (and mixed with other encoded text, hence not trivial to find).
>>> '185'.encode('base64')
'MTg1\n'
>>> '\x00185'.encode('base64')
'ADE4NQ==\n'
>>> '\x00\x00185'.encode('base64')
'AAAxODU=\n'
>>> '\x00\x00\x00185'.encode('base64')
'AAAAMTg1\n'
| base64 encoded e-mails and compression |
1,469,693,791,000 |
I'm going to build an experimental mail server with Postfix + Dovecot and Mysql for user accounts.
The server will offer SMTP + POP3 + IMAP.
Is there a way to force users to change their mail account passwords every six months?
|
grep'ing through dovecot 2.1 source code it appears that they have a constant IMAP_RESP_CODE_EXPIRED used for the RFC 5530 "EXPIRED" code, which would be used to tell the client the password has expired. I see code to that notices expired accounts, and returns PASSDB_RESULT_PASS_EXPIRED from various different methods (but not the db-sql method).
Further, I don't see anywhere where the server sends that response.
This holds true in 2.2 as well, where a few more authentication methods gain PASSDB_RESULT_PASS_EXPIRED (but still not db-sql). And still nowhere I see the server sending it.
So, I'd guess that Dovecot currently doesn't support this, but they're (slowly?) working towards it.
I'm not even sure the IMAP protocol provides a way to change a password. I couldn't come up with one despite serious Google attempts.
(You could email people warning them their password is about to expire, and set up a web page for them to change it, but, well, I bet I have several of those in my spam box right now! Oddly enough, not actually sent by mail server's admin. In case the sarcasm doesn't carry, this is a relatively common phishing scheme.)
| Force users to change email password every six months |
1,469,693,791,000 |
I have an email stored in plaintext (yes, headers, messages, attachments, everything in one plaintext file) and I'd like to extract a PDF document from it. I've copied the base64-encoded text, then ran it through base64 -d and catted it to a file. I then tried opening it up, which didn't work, and it doesn't appear like a PDF file.
Is there something I'm doing wrong here? I'm fairly certain that it is, indeed, encoded in base64 and that it's a PDF file.
Here is the email:
---------- MESSAGE FOLLOWS ----------
Date: Tue, 6 Mar 2012 12:24:24 -0800 (PST)
From: "Outer, Inc." <[email protected]>
To: Mike Young <[email protected]>
Message-ID: <[email protected]>
Subject: Your results are in, Mike!
MIME-Version: 1.0
Content-Type: multipart/mixed;
boundary="----=_Part_0_1998493940.1331065464916"
X-Peer: 127.0.0.1
------=_Part_0_1998493940.1331065464916
Content-Type: multipart/alternative;
boundary="----=_Part_1_1254200493.1331065464936"
------=_Part_1_1254200493.1331065464936
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Great job, Mike on your baby!
------=_Part_1_1254200493.1331065464936
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
<html>
<body>
<h3>Great job, Mike on your baby!</h3>
</body>
</html>
------=_Part_1_1254200493.1331065464936--
------=_Part_0_1998493940.1331065464916
Content-Type: application/pdf; name="Baby Results.pdf"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="Baby Results.pdf"
JVBERi0xLjQKJeLjz9MKMyAwIG9iaiA8PC9UeXBlL1hPYmplY3QvQ29sb3JTcGFjZS9EZXZpY2VH
cmF5L1N1YnR5cGUvSW1hZ2UvQml0c1BlckNvbXBvbmVudCA4L1dpZHRoIDI1My9MZW5ndGggMTYx
...
HR5P9F0eg4+P8tWzo2bPl6eGcNwyLqqW+chQi7Fo/CTWPUI7Kud1ZYgpcnSg7do4SKpTy10jyggP
1dVbvqS63pYxNl1JGGcvD1P+VFdN2b7O3YBqXTuiRteun3nmUdcoObmr5qduv09
|
munpack seems like the tool you want.
| Extracting a file attachment from an email message and saving it to a file? |
1,469,693,791,000 |
is there a way via Postfix and or procmail for example or another software to forward e-mails from one inbox to another 2 inboxes where each message goes either to one inbox or the other based on content. Sometimes the message is multipart and the keyword is within the first part.
|
Procmail itself doesn't have any facility for looping over messages you have already received, but the companion formail utility to loop over messages in an mbox file; or, of course, if you are using a mailbox format like Maildir, you can simply loop over the files which contain those messages.
for file in ~/Maildir/cur/deadbeefdecafbadc001b00c ~/Maildir/cur/badc0415106644511745; do
procmail -m testing.rc <"$file";
done
where testing.rc might contain something like
:0
* ^Subject: (foo|bar)
! [email protected]
:0
! [email protected]
to send the matching messages to the first address and the others to the second. (Probably test with a rule which doesn't send anything anywhere!)
For manipulating an mbox file, the invocation would look something like
formail -s procmail -m testing.rc <messages.mbox
To look inside the first MIME part, you basically need to figure out how to extract that part into something Procmail can read. If the content could be base64, you need a base64 decoder, and some pretty complex logic to isolate the message part. Perhaps at that point, use a third-party tool with better support for examining the innards of modern MIME messages? Here is a simple Python tool.
from email import message_from_binary_file
from email.policy import default
import sys
for filename in sys.argv[1:]:
with open(filename, "rb") as msg:
message = message_from_binary_file(msg, policy=default)
if "fnord" in message.get_body(preferencelist=('plain', 'html')).get_content():
print(f"{filename}: there")
else:
print(f"{filename}: not there")
This simply prints "there" or "not there" depending on whether the search term was found. You could obviously extend this to move or copy the input file to another directory, or send the message to a different address, or do something else within the Python script itself; or run it from a Bash script and respond to its output.
But to return to Procmail, if all you need is searching of a simple text/plain part, and can live with it unnecessarily searching other parts than the first one, maybe it's enough to say
:0B
* (\<fnord\>)
! [email protected]
(which demonstrates word boundaries around the search phrase, unlike my Python example). This is pretty brittle still, because even a quoted-printable message could contain
Content-type: text/plain; charset="utf-8"
Content-transfer-encoding: quoted-printable
Annoyingly, QP lets you insert a newline in the midd=
le of a word, so you could end up not finding this f=
nord occurrence.
which the simple Python tool above copes with magnificently.
| Split messages from one inbox to another 2 inboxes based on content |
1,469,693,791,000 |
Install a simple SMTP client:
sudo apt install msmtp msmtp-mda
Set in msmtprc
::
cat .msmtprc
account default
host smtp.qq.com
from [email protected]
auth on
tls on
tls_certcheck off
user [email protected]
password xxxx
logfile ~/.msmtp.log
I can send email with qq account.
echo "Testing msmtp " | mail -s "hi root" -r [email protected] -- [email protected]
The email can be found in yahoo email.
I find a new issue that user can't send email to root in system!
echo "cron task work done " | mail -s "hi root" root
mail: cannot send message: Process exited with a non-zero status
Check the log:
Aug 24 20:47:31 host=smtp.qq.com tls=on auth=on [email protected] [email protected] [email protected] smtpstatus=501 smtpmsg='501 Mail from address must be same as authorization user.' errormsg='envelope from address [email protected] not accepted by the server' exitcode=EX_DATAERR
echo "cron task work done " | mail -s "hi root" -r [email protected] root
The log info:
Aug 29 06:56:39 host=smtp.qq.com tls=on auth=on [email protected] [email protected] [email protected] smtpstatus=501 smtpmsg='501 Mail from address must be same as authorization user.' errormsg='envelope from address [email protected] not accepted by the server' exitcode=EX_DATAERR
Everytime mail command was called ,it relay to external host smtp.qq.com enven if i specify return host as [email protected],how can make mail command send email between user and root in the system?
I find that postfix or exim4 will be removed when to install msmtp-mda,the fact maybe realted with my issue.
|
You've installed a simple forwarding mail server (msmtp). Here is the package description from Debian
Package: msmtp (1.8.23-1)
light SMTP client with support for server profiles
msmtp is an SMTP client that can be used to send mails from Mutt and probably other MUAs (mail user agents). It forwards mails to an SMTP server (for example at a free mail provider), which takes care of the final delivery. Using profiles, it can be easily configured to use different SMTP servers with different configurations, which makes it ideal for mobile clients.
The relevant point here is that it, "forwards mails to an SMTP server […] which takes care of the final delivery".
What this means that using msmtp you can only forward emails to your remote mail server; you cannot deliver locally. If you want to do that install Exim, Postfix, Sendmail, or one of the other full-featured MTAs (mail transport agents).
| How to make mail command to send email to root after installing msmtp? |
1,469,693,791,000 |
Mutt is silently failing to send an email . There are no errors or failures. But sometimes the email is sent while other times it fails to send an email.
This is how I am installing all the required installables/libraries in one task.
sudo apt-get update
sudo apt install snapd
sudo snap install okular
sudo apt install mailutils
sudo apt install mutt
In another task I am sending an email like this:
url=https://dev.azure.com/xyz/project/_build/results?buildId=$(Build.BuildId)
echo -e "$url"
mutt -v
echo -e "Hello All,\n\n Please find inline as well as attached the elaborative test results which $(Agent.JobStatus) and generated \n\nRegards\nQA Team\n\nLink to Azure DevOps Pipeline Build : $url-- [email protected]
Following is the log of sending email . I do not see any errors here.
2023-06-13T06:34:21.9114531Z ##[section]Starting: Email with E2E report and logs using utils
2023-06-13T06:34:21.9118245Z ==============================================================================
2023-06-13T06:34:21.9118373Z Task : Bash
2023-06-13T06:34:21.9118437Z Description : Run a Bash script on macOS, Linux, or Windows
2023-06-13T06:34:21.9118539Z Version : 3.214.0
2023-06-13T06:34:21.9118605Z Author : Microsoft Corporation
2023-06-13T06:34:21.9118684Z Help : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/bash
2023-06-13T06:34:21.9118799Z ==============================================================================
2023-06-13T06:34:22.0517617Z Generating script.
2023-06-13T06:34:22.0538699Z ========================== Starting Command Output ===========================
2023-06-13T06:34:22.0549802Z [command]/usr/bin/bash /home/vsts/work/_temp/8c145d8d-536a-4543-addb-40c24c02f85d.sh
2023-06-13T06:34:22.0625138Z https://dev.azure.com/xyz/project/_build/results?buildId=5209788
2023-06-13T06:34:22.0656911Z Mutt 1.13.2 (2019-12-18)
2023-06-13T06:34:22.0657459Z Copyright (C) 1996-2016 Michael R. Elkins and others.
2023-06-13T06:34:22.0658162Z Mutt comes with ABSOLUTELY NO WARRANTY; for details type `mutt -vv'.
2023-06-13T06:34:22.0658578Z Mutt is free software, and you are welcome to redistribute it
2023-06-13T06:34:22.0658981Z under certain conditions; type `mutt -vv' for details.
2023-06-13T06:34:22.0659300Z
2023-06-13T06:34:22.0660934Z System: Linux 5.15.0-1038-azure (x86_64)
2023-06-13T06:34:22.0661328Z ncurses: ncurses 6.2.20200212 (compiled with 6.2)
2023-06-13T06:34:22.0661631Z libidn: 1.33 (compiled with 1.33)
2023-06-13T06:34:22.0734866Z hcache backend: tokyocabinet 1.4.48
2023-06-13T06:34:22.0735064Z
2023-06-13T06:34:22.0735270Z Compiler:
2023-06-13T06:34:22.0735584Z Using built-in specs.
2023-06-13T06:34:22.0735779Z COLLECT_GCC=gcc
2023-06-13T06:34:22.0736064Z COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper
2023-06-13T06:34:22.0736360Z OFFLOAD_TARGET_NAMES=nvptx-none:hsa
2023-06-13T06:34:22.0736561Z OFFLOAD_TARGET_DEFAULT=1
2023-06-13T06:34:22.0736984Z Target: x86_64-linux-gnu
2023-06-13T06:34:22.0738676Z Configured with: ../src/configure -v --with-pkgversion='Ubuntu 9.4.0-1ubuntu1~20.04.1' --with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,gm2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-9 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-9-Av3uEd/gcc-9-9.4.0/debian/tmp-nvptx/usr,hsa --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
2023-06-13T06:34:22.0739695Z Thread model: posix
2023-06-13T06:34:22.0739956Z gcc version 9.4.0 (Ubuntu 9.4.0-1ubuntu1~20.04.1)
2023-06-13T06:34:22.0740049Z
2023-06-13T06:34:22.0741633Z Configure options: '--build=x86_64-linux-gnu' '--prefix=/usr' '--includedir=\${prefix}/include' '--mandir=\${prefix}/share/man' '--infodir=\${prefix}/share/info' '--sysconfdir=/etc' '--localstatedir=/var' '--disable-silent-rules' '--libdir=\${prefix}/lib/x86_64-linux-gnu' '--libexecdir=\${prefix}/lib/x86_64-linux-gnu' '--disable-maintainer-mode' '--disable-dependency-tracking' '--with-mailpath=/var/mail' '--enable-compressed' '--enable-debug' '--enable-fcntl' '--enable-hcache' '--enable-gpgme' '--enable-imap' '--enable-smtp' '--enable-pop' '--enable-sidebar' '--enable-nntp' '--enable-dotlock' '--disable-fmemopen' '--with-curses' '--with-gnutls' '--with-gss' '--with-idn' '--with-mixmaster' '--with-sasl' '--without-gdbm' '--without-bdb' '--without-qdbm' '--with-tokyocabinet' 'build_alias=x86_64-linux-gnu' 'CFLAGS=-g -O2 -fdebug-prefix-map=/build/mutt-30uNgF/mutt-1.13.2=. -fstack-protector-strong -Wformat -Werror=format-security' 'LDFLAGS=-Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now' 'CPPFLAGS=-Wdate-time -D_FORTIFY_SOURCE=2'
2023-06-13T06:34:22.0742559Z
2023-06-13T06:34:22.0742969Z Compilation CFLAGS: -Wall -pedantic -Wno-long-long -g -O2 -fdebug-prefix-map=/build/mutt-30uNgF/mutt-1.13.2=. -fstack-protector-strong -Wformat -Werror=format-security
2023-06-13T06:34:22.0743153Z
2023-06-13T06:34:22.0743297Z Compile options:
2023-06-13T06:34:22.0743479Z -DOMAIN
2023-06-13T06:34:22.0743612Z +DEBUG
2023-06-13T06:34:22.0743899Z -HOMESPOOL +USE_SETGID +USE_DOTLOCK +DL_STANDALONE +USE_FCNTL -USE_FLOCK
2023-06-13T06:34:22.0744106Z +USE_POP +USE_IMAP +USE_SMTP
2023-06-13T06:34:22.0744394Z -USE_SSL_OPENSSL +USE_SSL_GNUTLS +USE_SASL +USE_GSS +HAVE_GETADDRINFO
2023-06-13T06:34:22.0744658Z +HAVE_REGCOMP -USE_GNU_REGEX
2023-06-13T06:34:22.0744866Z +HAVE_COLOR +HAVE_START_COLOR +HAVE_TYPEAHEAD +HAVE_BKGDSET
2023-06-13T06:34:22.0745086Z +HAVE_CURS_SET +HAVE_META +HAVE_RESIZETERM +HAVE_FUTIMENS
2023-06-13T06:34:22.0745324Z +CRYPT_BACKEND_CLASSIC_PGP +CRYPT_BACKEND_CLASSIC_SMIME +CRYPT_BACKEND_GPGME
2023-06-13T06:34:22.0745584Z -EXACT_ADDRESS -SUN_ATTACHMENT
2023-06-13T06:34:22.0745903Z +ENABLE_NLS -LOCALES_HACK +HAVE_WC_FUNCS +HAVE_LANGINFO_CODESET +HAVE_LANGINFO_YESEXPR
2023-06-13T06:34:22.0746252Z +HAVE_ICONV -ICONV_NONTRANS +HAVE_LIBIDN -HAVE_LIBIDN2 +HAVE_GETSID +USE_HCACHE
2023-06-13T06:34:22.0746476Z +USE_SIDEBAR +USE_COMPRESSED +USE_INOTIFY
2023-06-13T06:34:22.0746674Z -ISPELL
2023-06-13T06:34:22.0746837Z SENDMAIL="/usr/sbin/sendmail"
2023-06-13T06:34:22.0746993Z MAILPATH="/var/mail"
2023-06-13T06:34:22.0747156Z PKGDATADIR="/usr/share/mutt"
2023-06-13T06:34:22.0747315Z SYSCONFDIR="/etc"
2023-06-13T06:34:22.0747487Z EXECSHELL="/bin/sh"
2023-06-13T06:34:22.0747643Z MIXMASTER="mixmaster"
2023-06-13T06:34:22.0747771Z
2023-06-13T06:34:22.0748027Z To contact the developers, please mail to <[email protected]>.
2023-06-13T06:34:22.0748255Z To report a bug, please contact the Mutt maintainers via gitlab:
2023-06-13T06:34:22.0748463Z https://gitlab.com/muttmua/mutt/issues
2023-06-13T06:34:22.0748544Z
2023-06-13T06:34:22.2419708Z ##[section]Finishing: Email with E2E
report and logs using utils
What could be the reason? Set up is on Ubuntu 20.04
|
You're not sending an email with mutt in that example of yours, you're running mutt -v (which displays mutt's version and compilation details), and then you're running echo.
If you want to send a message with mutt, you'd do it something like this:
mutt -s "subject" [email protected] <<__EOF__
Hello All,
Please find inline as well as attached the elaborative test results which $(Agent.JobStatus) and generated
Regards
QA Team
Link to Azure DevOps Pipeline Build : $url
__EOF__
You could use echo or printf or whatever to pipe your message into mutt, but as there are multiple newlines embedded in your msg, it's easier to use a heredoc.
See man mutt for more details on mutt command line options - e.g. you can use -a filename to attach a file using MIME, -i filename to include a file in the body of the message, -c for CC, and -b for BCC.
| Mutt silently fails to send an email from the ci/cd pipeline |
1,469,693,791,000 |
I set up a new RHEL 8 server and it won't let me send email to a specific address.
If I do:
mail -s "Testing" [email protected] < /dev/null
it fails and the logs show
Dec 8 07:59:46 yln sendmail[2029791]: 2B8ExkYP2029791: from=administrator, size=220, class=0, nrcpts=1, msgid=<[email protected]>, relay=administrator@localhost
Dec 8 07:59:46 yln postfix/smtpd[2029792]: connect from localhost[127.0.0.1]
Dec 8 07:59:46 yln postfix/smtpd[2029792]: discarding EHLO keywords: CHUNKING
Dec 8 07:59:46 yln sendmail[2029791]: STARTTLS=client, relay=[127.0.0.1], version=TLSv1.3, verify=FAIL, cipher=TLS_AES_256_GCM_SHA384, bits=256/256
Dec 8 07:59:46 yln postfix/smtpd[2029792]: discarding EHLO keywords: CHUNKING
Dec 8 07:59:46 yln postfix/smtpd[2029792]: NOQUEUE: reject: RCPT from localhost[127.0.0.1]: 550 5.1.1 <[email protected]>: Recipient address rejected: User unknown in local recipient table; from=<[email protected]> to=<[email protected]> proto=ESMTP helo=<yln.info>
Dec 8 07:59:46 yln sendmail[2029791]: 2B8ExkYP2029791: [email protected], ctladdr=administrator (1000/1000), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30220, relay=[127.0.0.1] [127.0.0.1], dsn=5.1.1, stat=User unknown
Dec 8 07:59:46 yln postfix/smtpd[2029792]: disconnect from localhost[127.0.0.1] ehlo=2 starttls=1 mail=1 rcpt=0/1 data=0/1 rset=1 quit=1 commands=6/8
If I send to our test address
mail -s "Testing" [email protected] < /dev/null
it works just fine.
This is an address that's been in use for years so the problem would appear to be on the sending server. I've searched the web but I can't find anything to help solve the problem. (I would note that I have a test server which is almost a clone of the production server with the problem and sending to the email address on it works fine.)
Any ideas on how to fix this? Thank you.
|
Postfix thinks that the domain is local and is not trying to go out and query the record for it and send it to Google's Mail Servers.
Open Postfix's main.cf config file and look for the following line:
mydestination = $mydomain, localhost.$mydomain, localhost
Remove $mydomain and restart postfix
service postfix restart
And try sending the mail again. Postfix will not look localy for that domain
| Server won't send email to specific address |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.