| 1 | .TH qmail-inject 8 |
| 2 | .SH NAME |
| 3 | qmail-inject \- preprocess and send a mail message |
| 4 | .SH SYNOPSIS |
| 5 | .B qmail-inject |
| 6 | [ |
| 7 | .B \-nNaAhH |
| 8 | ] [ |
| 9 | .B \-f\fIsender |
| 10 | ] [ |
| 11 | .I recip ... |
| 12 | ] |
| 13 | .SH DESCRIPTION |
| 14 | .B qmail-inject |
| 15 | reads a mail message from its standard input, |
| 16 | adds appropriate information to the message header, |
| 17 | and invokes |
| 18 | .B qmail-queue |
| 19 | to send the message |
| 20 | to one or more recipients. |
| 21 | |
| 22 | See |
| 23 | .B qmail-header(5) |
| 24 | for information on how |
| 25 | .B qmail-inject |
| 26 | rewrites header fields. |
| 27 | |
| 28 | .B qmail-inject |
| 29 | normally exits 0. |
| 30 | It exits 100 if it was invoked improperly |
| 31 | or if there is a severe syntax error in the message. |
| 32 | It exits 111 for temporary errors. |
| 33 | .SH "ENVIRONMENT VARIABLES" |
| 34 | For the convenience of users who do not run |
| 35 | .B qmail-inject |
| 36 | directly, |
| 37 | .B qmail-inject |
| 38 | takes many options through environment variables. |
| 39 | |
| 40 | The user name in the |
| 41 | .B From |
| 42 | header field is set by |
| 43 | .BR QMAILUSER , |
| 44 | .BR MAILUSER , |
| 45 | .BR USER , |
| 46 | or |
| 47 | .BR LOGNAME , |
| 48 | whichever comes first. |
| 49 | |
| 50 | The host name is normally set by the |
| 51 | .I defaulthost |
| 52 | control |
| 53 | but can be overridden with |
| 54 | .B QMAILHOST |
| 55 | or |
| 56 | .BR MAILHOST . |
| 57 | |
| 58 | The personal name is |
| 59 | .BR QMAILNAME , |
| 60 | .BR MAILNAME , |
| 61 | or |
| 62 | .BR NAME . |
| 63 | |
| 64 | The default envelope sender address is the same as the |
| 65 | default |
| 66 | .B From |
| 67 | address, |
| 68 | but it can be overridden with |
| 69 | .B QMAILSUSER |
| 70 | and |
| 71 | .BR QMAILSHOST . |
| 72 | It may also be modified by the |
| 73 | .B r |
| 74 | and |
| 75 | .B m |
| 76 | letters described below. |
| 77 | Bounces will be sent to this address. |
| 78 | |
| 79 | If |
| 80 | .B QMAILMFTFILE |
| 81 | is set, |
| 82 | .B qmail-inject |
| 83 | reads a list of mailing list addresses, |
| 84 | one per line, |
| 85 | from that file. |
| 86 | If To+Cc includes one of those addresses (without regard to case), |
| 87 | .B qmail-inject |
| 88 | adds a Mail-Followup-To field |
| 89 | with all the To+Cc addresses. |
| 90 | .B qmail-inject |
| 91 | does not add Mail-Followup-To |
| 92 | to a message that already has one. |
| 93 | |
| 94 | The |
| 95 | .B QMAILINJECT |
| 96 | environment variable |
| 97 | can contain any of the following letters: |
| 98 | .TP |
| 99 | .B c |
| 100 | Use address-comment style for the |
| 101 | .B From |
| 102 | field. |
| 103 | Normally |
| 104 | .B qmail-inject |
| 105 | uses name-address style. |
| 106 | .TP |
| 107 | .B s |
| 108 | Do not look at any incoming |
| 109 | .B Return-Path |
| 110 | field. |
| 111 | Normally, if |
| 112 | .B Return-Path |
| 113 | is supplied, it sets the envelope sender address, |
| 114 | overriding all environment variables. |
| 115 | .B Return-Path |
| 116 | is deleted in any case. |
| 117 | .TP |
| 118 | .B f |
| 119 | Delete any incoming |
| 120 | .B From |
| 121 | field. |
| 122 | Normally, if |
| 123 | .B From |
| 124 | is supplied, it overrides the usual |
| 125 | .B From |
| 126 | field created by |
| 127 | .BR qmail-inject . |
| 128 | .TP |
| 129 | .B i |
| 130 | Delete any incoming |
| 131 | .B Message-ID |
| 132 | field. |
| 133 | Normally, if |
| 134 | .B Message-ID |
| 135 | is supplied, it overrides the usual |
| 136 | .B Message-ID |
| 137 | field created by |
| 138 | .BR qmail-inject . |
| 139 | .TP |
| 140 | .B r |
| 141 | Use a per-recipient VERP. |
| 142 | .B qmail-inject |
| 143 | will append each recipient address to the envelope sender |
| 144 | of the copy going to that recipient. |
| 145 | .TP |
| 146 | .B m |
| 147 | Use a per-message VERP. |
| 148 | .B qmail-inject |
| 149 | will append the current date and process ID to the envelope sender. |
| 150 | .SH OPTIONS |
| 151 | .TP |
| 152 | .B \-a |
| 153 | Send the message to all addresses given as |
| 154 | .I recip |
| 155 | arguments; |
| 156 | do not use header recipient addresses. |
| 157 | .TP |
| 158 | .B \-h |
| 159 | Send the message to all header recipient addresses. |
| 160 | For non-forwarded messages, this means |
| 161 | the addresses listed under |
| 162 | .BR To , |
| 163 | .BR Cc , |
| 164 | .BR Bcc , |
| 165 | .BR Apparently-To . |
| 166 | For forwarded messages, this means |
| 167 | the addresses listed under |
| 168 | .BR Resent-To , |
| 169 | .BR Resent-Cc , |
| 170 | .BR Resent-Bcc . |
| 171 | Do not use any |
| 172 | .I recip |
| 173 | arguments. |
| 174 | .TP |
| 175 | .B \-A |
| 176 | (Default.) |
| 177 | Send the message to all addresses given as |
| 178 | .I recip |
| 179 | arguments. |
| 180 | If no |
| 181 | .I recip |
| 182 | arguments are supplied, |
| 183 | send the message to all header recipient addresses. |
| 184 | .TP |
| 185 | .B \-H |
| 186 | Send the message to all header recipient addresses, |
| 187 | and to all addresses given as |
| 188 | .I recip |
| 189 | arguments. |
| 190 | .TP |
| 191 | .B \-f\fIsender |
| 192 | Pass |
| 193 | .I sender |
| 194 | to |
| 195 | .B qmail-queue |
| 196 | as the envelope sender address. |
| 197 | This overrides |
| 198 | .B Return-Path |
| 199 | and all environment variables. |
| 200 | .TP |
| 201 | .B \-N |
| 202 | (Default.) |
| 203 | Feed the resulting message to |
| 204 | .BR qmail-queue . |
| 205 | .TP |
| 206 | .B \-n |
| 207 | Print the message rather than feeding it to |
| 208 | .BR qmail-queue . |
| 209 | .SH "CONTROL FILES" |
| 210 | .TP 5 |
| 211 | .I defaultdomain |
| 212 | Default domain name. |
| 213 | Default: |
| 214 | .IR me , |
| 215 | if that is supplied; |
| 216 | otherwise the literal name |
| 217 | .BR defaultdomain , |
| 218 | which is probably not what you want. |
| 219 | .B qmail-inject |
| 220 | adds this name to any host name without dots, |
| 221 | including |
| 222 | .I defaulthost |
| 223 | if |
| 224 | .I defaulthost |
| 225 | does not have dots. |
| 226 | (Exception: see |
| 227 | .IR plusdomain .) |
| 228 | |
| 229 | The |
| 230 | .B QMAILDEFAULTDOMAIN |
| 231 | environment variable |
| 232 | overrides |
| 233 | .IR defaultdomain . |
| 234 | .TP 5 |
| 235 | .I defaulthost |
| 236 | Default host name. |
| 237 | Default: |
| 238 | .IR me , |
| 239 | if that is supplied; |
| 240 | otherwise the literal name |
| 241 | .BR defaulthost , |
| 242 | which is probably not what you want. |
| 243 | .B qmail-inject |
| 244 | adds this name to any address without a host name. |
| 245 | .I defaulthost |
| 246 | need not be the current host's name. |
| 247 | For example, |
| 248 | you may prefer that outgoing mail show |
| 249 | just your domain name. |
| 250 | |
| 251 | The |
| 252 | .B QMAILDEFAULTHOST |
| 253 | environment variable overrides |
| 254 | .IR defaulthost . |
| 255 | .TP 5 |
| 256 | .I idhost |
| 257 | Host name for Message-IDs. |
| 258 | Default: |
| 259 | .IR me , |
| 260 | if that is supplied; |
| 261 | otherwise the literal name |
| 262 | .BR idhost , |
| 263 | which is certainly not what you want. |
| 264 | .I idhost |
| 265 | need not be the current host's name. |
| 266 | For example, you may prefer to use fake |
| 267 | host names in Message-IDs. |
| 268 | However, |
| 269 | .I idhost |
| 270 | must be a fully-qualified name within your domain, |
| 271 | and each host in your domain should use a different |
| 272 | .IR idhost . |
| 273 | |
| 274 | The |
| 275 | .B QMAILIDHOST |
| 276 | environment variable overrides |
| 277 | .IR idhost . |
| 278 | .TP 5 |
| 279 | .I plusdomain |
| 280 | Plus domain name. |
| 281 | Default: |
| 282 | .IR me , |
| 283 | if that is supplied; |
| 284 | otherwise the literal name |
| 285 | .BR plusdomain , |
| 286 | which is probably not what you want. |
| 287 | .B qmail-inject |
| 288 | adds this name to any host name that ends with a plus sign, |
| 289 | including |
| 290 | .I defaulthost |
| 291 | if |
| 292 | .I defaulthost |
| 293 | ends with a plus sign. |
| 294 | If a host name does not have dots but ends with a plus sign, |
| 295 | .B qmail-inject |
| 296 | uses |
| 297 | .IR plusdomain , |
| 298 | not |
| 299 | .IR defaultdomain . |
| 300 | |
| 301 | The |
| 302 | .B QMAILPLUSDOMAIN |
| 303 | environment variable overrides |
| 304 | .IR plusdomain . |
| 305 | .SH "SEE ALSO" |
| 306 | addresses(5), |
| 307 | qmail-control(5), |
| 308 | qmail-header(5), |
| 309 | qmail-queue(8) |